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

# Register Agent

> Register a new agent or update an existing one.



## OpenAPI

````yaml https://agentex.dev-sgp.scale.com/openapi.json post /agents/register
openapi: 3.1.0
info:
  title: Agentex API
  version: 0.1.0
servers: []
security: []
paths:
  /agents/register:
    post:
      tags:
        - Agents
      summary: Register Agent
      description: Register a new agent or update an existing one.
      operationId: register_agent_agents_register_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterAgentRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterAgentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RegisterAgentRequest:
      properties:
        name:
          type: string
          pattern: ^[a-z0-9-]+$
          title: Name
          description: The unique name of the agent.
        description:
          type: string
          title: Description
          description: The description of the agent.
        acp_url:
          type: string
          title: Acp Url
          description: The URL of the ACP server for the agent.
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: >-
            Optional agent ID if the agent already exists and needs to be
            updated.
        acp_type:
          $ref: '#/components/schemas/ACPType'
          description: The type of ACP to use for the agent.
        principal_context:
          anyOf:
            - {}
            - type: 'null'
          title: Principal Context
          description: Principal used for authorization
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: The metadata for the agent's registration.
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
      type: object
      required:
        - name
        - description
        - acp_url
        - acp_type
      title: RegisterAgentRequest
    RegisterAgentResponse:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the agent.
        name:
          type: string
          title: Name
          description: The unique name of the agent.
        description:
          type: string
          title: Description
          description: The description of the action.
        status:
          $ref: '#/components/schemas/AgentStatus'
          description: >-
            The status of the action, indicating if it's building, ready,
            failed, etc.
          default: Unknown
        acp_type:
          $ref: '#/components/schemas/ACPType'
          description: The type of the ACP Server (Either sync or async)
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Reason
          description: The reason for the status of the action.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The timestamp when the agent was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The timestamp when the agent was last updated
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: The metadata for the agent's registration.
        registered_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Registered At
          description: The timestamp when the agent was last registered
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
        production_deployment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Production Deployment Id
          description: ID of the current production deployment.
        agent_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Api Key
          description: The API key for the agent, if applicable.
      type: object
      required:
        - id
        - name
        - description
        - acp_type
        - created_at
        - updated_at
      title: RegisterAgentResponse
      description: Response model for registering an agent.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ACPType:
      type: string
      enum:
        - sync
        - async
        - agentic
      title: ACPType
    AgentInputType:
      type: string
      enum:
        - text
        - json
      title: AgentInputType
    AgentStatus:
      type: string
      enum:
        - Ready
        - Failed
        - Unknown
        - Deleted
        - Unhealthy
        - BuildOnly
      title: AgentStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````