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

# Get an agent

> Retrieve an agent and its schema details.

Agents can have both a live published version and a draft version with newer
unpublished changes. Use the `version` parameter to choose which state to return.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/profound/openapi.documented.yml get /v1/agents/{agent_id}
openapi: 3.1.0
info:
  title: External API
  version: 60df76cc2b9752c279276872b19310c02da38378
servers:
  - url: https://api.tryprofound.com
    description: Production Server
security: []
paths:
  /v1/agents/{agent_id}:
    get:
      tags:
        - Agents
      summary: Get an agent
      description: >-
        Retrieve an agent and its schema details.


        Agents can have both a live published version and a draft version with
        newer

        unpublished changes. Use the `version` parameter to choose which state
        to return.
      operationId: get_agent_v1_agents__agent_id__get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: The ID of the agent to retrieve.
            title: Agent Id
          description: The ID of the agent to retrieve.
        - name: version
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AgentVersion'
            description: >-
              Version of the agent to retrieve. Use `published` for the live
              version, or `draft` for the latest unpublished changes for the
              same agent. Defaults to `published`.
            default: published
          description: >-
            Version of the agent to retrieve. Use `published` for the live
            version, or `draft` for the latest unpublished changes for the same
            agent. Defaults to `published`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Profound from '@profoundai/client';


            const client = new Profound({
              apiKey: process.env['PROFOUND_API_KEY'], // This is the default and can be omitted
            });


            const agent = await
            client.agents.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(agent.id);
        - lang: Python
          source: |-
            import os
            from profound import Profound

            client = Profound(
                api_key=os.environ.get("PROFOUND_API_KEY"),  # This is the default and can be omitted
            )
            agent = client.agents.retrieve(
                agent_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(agent.id)
components:
  schemas:
    AgentVersion:
      type: string
      enum:
        - published
        - draft
      title: AgentVersion
      description: Version selector for retrieving a specific agent.
    AgentDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique ID for the agent.
        organization_id:
          type: string
          format: uuid
          title: Organization Id
          description: Unique ID of the organization that owns the agent.
        name:
          type: string
          title: Name
          description: Display name of the agent.
        status:
          $ref: '#/components/schemas/AgentStatus'
          description: Current status of the agent.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the agent was created.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Short description of the agent, if provided.
        schema:
          anyOf:
            - $ref: '#/components/schemas/AgentSchema'
            - type: 'null'
          description: >-
            Input and output schemas for this agent. Omitted while the agent's
            graph cannot be previewed (e.g. an empty or structurally-invalid
            draft); check `validation` to see what needs fixing.
        validation:
          anyOf:
            - $ref: '#/components/schemas/AgentValidation'
            - type: 'null'
          description: >-
            Validation report for the agent's graph, when available. Use
            `validation.valid` to check the agent is publishable.
      additionalProperties: false
      type: object
      required:
        - id
        - organization_id
        - name
        - status
        - created_at
      title: AgentDetail
      description: Detailed information for an agent.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentStatus:
      type: string
      enum:
        - draft
        - published
        - unknown
      title: AgentStatus
      description: Current availability status for an agent.
    AgentSchema:
      properties:
        input:
          additionalProperties: true
          type: object
          title: Input
          description: >-
            JSON Schema for the agent's `inputs` object. Use the top-level
            property keys as input field names when starting a run.
        output:
          additionalProperties: true
          type: object
          title: Output
          description: >-
            JSON Schema for the `outputs` object returned by `GET
            /v1/agents/{agent_id}/runs/{run_id}`.
      additionalProperties: false
      type: object
      required:
        - input
        - output
      title: AgentSchema
      description: Schema metadata for an agent.
    AgentValidation:
      properties:
        valid:
          type: boolean
          title: Valid
          description: Whether the agent's graph is valid and ready to publish.
        issues:
          items:
            $ref: '#/components/schemas/AgentValidationIssue'
          type: array
          title: Issues
          description: >-
            Problems found while validating the graph. Empty when `valid` is
            true.
      additionalProperties: false
      type: object
      required:
        - valid
      title: AgentValidation
      description: >-
        Result of validating an agent's graph.


        Mirrors the report computed on every read, so callers can confirm a
        draft

        is publishable before calling publish.
    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
    AgentValidationIssue:
      properties:
        code:
          type: string
          title: Code
          description: Stable machine-readable identifier for the kind of issue.
        message:
          type: string
          title: Message
          description: Human-readable description of the issue.
        node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Id
          description: ID of the node the issue applies to, if node-specific.
        node_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Title
          description: Display title of the affected node, if available.
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
          description: Name of the offending field on the node, if field-specific.
        field_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Field Title
          description: Display title of the affected field, if available.
        violation:
          anyOf:
            - type: string
            - type: 'null'
          title: Violation
          description: The specific constraint that was violated, if available.
      additionalProperties: false
      type: object
      required:
        - code
        - message
      title: AgentValidationIssue
      description: A single problem found while validating an agent's graph.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````