> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beam.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Process agent setup steps

> Multi-step agent configuration endpoint. Use this after agent creation (via /agent-context and /agent-creation).

**GENERATE_SOP**: Generates Standard Operating Procedures for the agent
- Required: agentId, query
- Returns: nextStep (GRAPH_GENERATION)

**GRAPH_GENERATION**: Creates agent workflow graph
- Required: agentId
- Returns: nextStep (TOOL_MATCHING)

**TOOL_MATCHING**: Matches existing tools to agent needs
- Required: agentId
- Returns: nextStep (TOOL_GENERATION)

**TOOL_GENERATION**: Generates new custom tools if needed
- Required: agentId
- Returns: nextStep (TOOL_INTEGRATION)

**TOOL_INTEGRATION**: Integrates selected tools with the agent
- Required: agentId
- Returns: nextStep (UPDATE_AGENT)

**UPDATE_AGENT**: Finalizes and updates the agent configuration
- Required: agentId
- Returns: nextStep (AGENT_UPDATED)

Note: Use /agent-context first to get threadId, then /agent-creation to create the agent and get agentId before using this endpoint.



## OpenAPI

````yaml post /agent-setup
openapi: 3.0.0
info:
  title: Public API
  description: Public endpoints to interact with agents and orchestrate tasks
  version: '1.0'
  contact: {}
servers:
  - url: https://api.beamstudio.ai
security: []
tags: []
paths:
  /agent-setup:
    post:
      tags:
        - Agent Setup
      summary: Process agent setup steps
      description: >-
        Multi-step agent configuration endpoint. Use this after agent creation
        (via /agent-context and /agent-creation).


        **GENERATE_SOP**: Generates Standard Operating Procedures for the agent

        - Required: agentId, query

        - Returns: nextStep (GRAPH_GENERATION)


        **GRAPH_GENERATION**: Creates agent workflow graph

        - Required: agentId

        - Returns: nextStep (TOOL_MATCHING)


        **TOOL_MATCHING**: Matches existing tools to agent needs

        - Required: agentId

        - Returns: nextStep (TOOL_GENERATION)


        **TOOL_GENERATION**: Generates new custom tools if needed

        - Required: agentId

        - Returns: nextStep (TOOL_INTEGRATION)


        **TOOL_INTEGRATION**: Integrates selected tools with the agent

        - Required: agentId

        - Returns: nextStep (UPDATE_AGENT)


        **UPDATE_AGENT**: Finalizes and updates the agent configuration

        - Required: agentId

        - Returns: nextStep (AGENT_UPDATED)


        Note: Use /agent-context first to get threadId, then /agent-creation to
        create the agent and get agentId before using this endpoint.
      operationId: BeamAgentController_processInformation
      parameters:
        - name: current-workspace-id
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetupBeamAgentDTO'
      responses:
        '200':
          description: >-
            Agent setup step processed successfully. Response structure varies
            by step (see operation description).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSetupProcessResponseDto'
        '201':
          description: ''
        '400':
          description: >-
            Bad Request - Missing required fields for the current step or
            invalid step provided.
      security:
        - x-api-key: []
components:
  schemas:
    SetupBeamAgentDTO:
      type: object
      properties:
        query:
          type: string
          maxLength: 50000
          description: >-
            User input or instructions for the current setup step. Use this to
            provide context about what the agent should do, describe its
            purpose, or give feedback during the setup process.
          example: >-
            I want to create an agent that helps users with customer support
            inquiries
        contextFileIds:
          description: >-
            Array of context file UUIDs to attach to the agent. These files
            provide additional knowledge or reference materials that the agent
            can use when processing requests.
          example:
            - a1b2c3d4-e5f6-7890-abcd-ef1234567890
            - b2c3d4e5-f6a7-8901-bcde-f12345678901
          type: array
          items:
            type: string
            format: uuid
        agentId:
          type: string
          format: uuid
          description: >-
            UUID of the agent. Required for all setup steps (GENERATE_SOP and
            onwards) to identify which agent is being configured.
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
        agentSetupStep:
          enum:
            - GENERATE_SOP
            - GRAPH_GENERATION
            - TOOL_MATCHING
            - TOOL_GENERATION
            - TOOL_INTEGRATION
            - UPDATE_AGENT
            - AGENT_UPDATED
            - CREATE_TASK
          type: string
          description: >-
            Current step in the agent setup workflow. Use /agent-context and
            /agent-creation first, then use this endpoint for the remaining
            steps:


            • GENERATE_SOP - Generate Standard Operating Procedures for the
            agent (requires query)

            • GRAPH_GENERATION - Create the agent's workflow graph

            • TOOL_MATCHING - Match existing tools to the agent's needs

            • TOOL_GENERATION - Generate new custom tools if needed

            • TOOL_INTEGRATION - Integrate selected tools with the agent

            • UPDATE_AGENT - Finalize and update the agent configuration

            • AGENT_UPDATED - Confirmation that setup is complete
          example: GENERATE_SOP
      required:
        - agentId
        - agentSetupStep
    AgentSetupProcessResponseDto:
      type: object
      properties:
        nextStep:
          enum:
            - GENERATE_SOP
            - GRAPH_GENERATION
            - TOOL_MATCHING
            - TOOL_GENERATION
            - TOOL_INTEGRATION
            - UPDATE_AGENT
            - AGENT_UPDATED
            - CREATE_TASK
          type: string
          description: >-
            The next step in the agent setup workflow. Use this value to
            determine which step to call next.
          example: SOP_GENERATION
        agentResponse:
          description: >-
            Agent creation response containing the created agent details and
            associated context files.
          allOf:
            - $ref: '#/components/schemas/SaveAgentResponseDto'
      required:
        - nextStep
        - agentResponse
    SaveAgentResponseDto:
      type: object
      properties:
        agent:
          $ref: '#/components/schemas/Agent'
        contextFiles:
          type: array
          items:
            type: string
      required:
        - agent
        - contextFiles
    Agent:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the agent.
          example: agent-123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Name of the agent.
          example: Customer Support Agent
        description:
          type: string
          description: Description of the agent.
        settings:
          description: Agent settings.
          allOf:
            - $ref: '#/components/schemas/AgentSettingDto'
        config:
          description: Agent configuration.
          allOf:
            - $ref: '#/components/schemas/AgentConfig'
        workspaceId:
          type: string
          description: UUID of the workspace.
        creatorId:
          type: string
          description: UUID of the creator.
        type:
          enum:
            - beam-os
            - user-agent
            - pre-configured-agent
          type: string
          description: Type of the agent.
        vectorDbId:
          type: string
          description: UUID of the vector database.
        defaultTaskId:
          type: string
          description: Default task ID.
        themeIconUrl:
          type: string
          description: URL of the theme icon for the agent.
          example: https://example.com/icons/support-agent.png
        agentCategoryId:
          type: string
          description: UUID of the agent category.
        userAccessTokenId:
          type: string
          description: UUID of the user access token.
        agentSetupSessionId:
          type: string
          description: UUID of the agent setup session.
        agentIntroMessage:
          type: string
          description: Agent introduction message.
        agentSetupMessage:
          type: string
          description: Agent setup message.
        skipAgentSetupSop:
          type: boolean
          description: Whether to skip agent setup SOP.
        isAttachmentDataPulledIn:
          type: boolean
          description: >-
            Whether attachment data from tasks should be pulled into the agent
            context.
        creditUsage:
          type: number
          description: Total credit usage for this agent.
          example: 12.5
        order:
          type: number
          description: Display order of the agent.
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - id
        - name
        - creatorId
        - type
        - vectorDbId
        - creditUsage
        - order
        - createdAt
        - updatedAt
    AgentSettingDto:
      type: object
      properties:
        prompts:
          description: Array of prompt templates used to guide the agent behavior.
          example:
            - You are a helpful customer support agent.
            - Always be polite and professional.
          type: array
          items:
            type: string
        preferredModel:
          type: string
          description: Preferred AI model for this agent.
          example: gpt-4
        instructions:
          type: string
          description: Additional instructions for agent behavior.
          example: Focus on providing concise answers.
      required:
        - prompts
    AgentConfig:
      type: object
      properties:
        restrictions:
          type: string
        taskTemplates:
          type: array
          items:
            $ref: '#/components/schemas/AgentTaskTemplate'
        tools:
          type: array
          items:
            type: string
        llmTools:
          type: array
          items:
            type: object
        sop:
          type: object
        defaultTaskId:
          type: string
        workspaceId:
          type: string
    AgentTaskTemplate:
      type: object
      properties:
        id:
          type: string
          description: Template ID.
        objective:
          type: string
          description: Task objective.
        description:
          type: string
          description: Task description.
        steps:
          description: Steps in this task template.
          type: array
          items:
            $ref: '#/components/schemas/AgentTaskTemplateStep'
        default:
          type: boolean
          description: Whether this is the default template.
        category:
          $ref: '#/components/schemas/AgentTaskTemplateCategory'
        lastUpdatedAt:
          format: date-time
          type: string
          description: Last updated timestamp.
      required:
        - id
        - objective
        - description
        - steps
    AgentTaskTemplateStep:
      type: object
      properties:
        step:
          type: string
          description: Step description.
        toolId:
          type: string
          description: Tool ID.
        iconSrc:
          type: string
          description: Icon source URL.
        iconUrl:
          type: string
          description: Icon URL.
        beamTool:
          type: boolean
          description: Whether this is a Beam tool.
        gptTool:
          type: boolean
          description: Whether this is a GPT tool.
        consentRequired:
          type: boolean
          description: Whether consent is required.
        integrationId:
          type: string
          description: Integration ID.
        isIntegrationRequired:
          type: boolean
          description: Whether integration is required.
        isIntegrationConnected:
          type: boolean
          description: Whether integration is connected.
        integrationProvider:
          type: string
          description: Integration provider.
        integrationIdentifier:
          type: string
          description: Integration identifier.
        toolDetail:
          type: object
        integrationCustomAuthParameters:
          type: object
      required:
        - step
    AgentTaskTemplateCategory:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````