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

# Retrieve agent

> Get one agent, including its `corpus` and `knowledge_ids`. List still returns those fields, marked deprecated.



## OpenAPI

````yaml get /agents/{agent_id}
openapi: 3.0.3
info:
  version: 0.1.1
  title: Datagrid API
  description: Datagrid API
servers:
  - url: https://api.datagrid.com/v1
security:
  - BearerAuth: []
paths:
  /agents/{agent_id}:
    get:
      tags:
        - Agents
      summary: Retrieve agent
      description: >-
        Get one agent, including its `corpus` and `knowledge_ids`. List still
        returns those fields, marked deprecated.
      operationId: RetrieveAgent
      parameters:
        - name: agent_id
          in: path
          required: true
          description: The ID of the agent to retrieve
          schema:
            type: string
      responses:
        '200':
          description: Agent details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '404':
          description: >-
            Not found. The requested agent does not exist, or the authenticated
            user does not have permission to access it.
        '429':
          description: >-
            Rate limit exceeded. The request has been throttled because the rate
            limit for this endpoint has been reached. Check the `Retry-After`
            response header and retry after the specified number of seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
components:
  schemas:
    Agent:
      allOf:
        - type: object
          required:
            - object
            - id
            - name
            - emoji
            - description
            - created_at
            - agent_model
            - llm_model
            - knowledge_ids
            - corpus
            - tools
            - mcp_servers
            - system_prompt
            - custom_prompt
            - planning_prompt
          properties:
            object:
              type: string
              enum:
                - agent
              description: The object type, always 'agent'
            id:
              type: string
              description: Unique identifier for the agent
            name:
              type: string
              description: The name of the agent
            emoji:
              type: string
              description: The emoji of the agent
              nullable: true
            description:
              type: string
              description: The description of the agent
              nullable: true
            created_at:
              type: string
              format: date-time
              description: The ISO string for when the agent was created
              nullable: false
            managed_by_app:
              type: object
              nullable: true
              properties:
                app_uuid:
                  type: string
                  description: The UUID of the app that manages the agent
                app_name:
                  type: string
                  description: The name of the app that manages the agent
        - $ref: '#/components/schemas/AgentConfig'
    RateLimitError:
      type: object
      description: >-
        Returned when the rate limit is exceeded. Rate limits are enforced per
        teamspace, endpoint path, and HTTP method over a 60-second sliding
        window. Each endpoint may have its own limit — check the
        X-RateLimit-Limit response header for the effective value.
      required:
        - error
        - message
        - retryable
        - status_code
      properties:
        status_code:
          type: integer
          description: The HTTP status code (429).
        statusCode:
          type: integer
          deprecated: true
          description: Deprecated. Use status_code instead.
        error:
          type: string
          enum:
            - rate_limit_exceeded
          description: The error code identifying this as a rate limit error.
        message:
          type: string
          description: A human-readable error message.
        mitigation:
          type: string
          description: Suggested action to resolve the error.
        retryable:
          type: boolean
          description: Whether the request can be retried after a delay.
        details:
          type: object
          properties:
            reason:
              type: string
              description: A detailed explanation of why the rate limit was exceeded.
    AgentConfig:
      allOf:
        - $ref: '#/components/schemas/AgentConfigShared'
        - type: object
          properties:
            agent_model:
              $ref: '#/components/schemas/AgentModel'
              nullable: false
            llm_model:
              $ref: '#/components/schemas/LlmModel'
              nullable: false
            tools:
              type: array
              items:
                $ref: '#/components/schemas/Tool'
              description: Tools that this agent can use.
              nullable: false
            mcp_servers:
              type: array
              items:
                $ref: '#/components/schemas/AgentMcpServer'
              description: Registered MCP servers enabled for this agent.
              nullable: false
    AgentConfigShared:
      type: object
      properties:
        knowledge_ids:
          type: array
          nullable: true
          deprecated: true
          description: >-
            Deprecated, use corpus instead. Array of Knowledge IDs the agent
            should use during the converse. When omitted, all knowledge is used.
          items:
            type: string
        corpus:
          type: array
          nullable: true
          description: >-
            Array of corpus items the agent should use during the converse. When
            omitted, all knowledge is used.
          items:
            oneOf:
              - $ref: '#/components/schemas/CorpusKnowledgeItem'
              - $ref: '#/components/schemas/CorpusPageItem'
        system_prompt:
          type: string
          description: Directs your AI Agent's operational behavior.
          nullable: true
        custom_prompt:
          type: string
          description: >-
            Use custom prompt to instruct the style and formatting of the
            agent's response
          nullable: true
        planning_prompt:
          type: string
          description: >-
            Define the planning strategy your AI Agent should use when breaking
            down tasks and solving problems
          nullable: true
    AgentModel:
      anyOf:
        - $ref: '#/components/schemas/AgentModelEnum'
        - type: string
      type: string
      enum:
        - magpie-1.1
        - magpie-1.1-flash
        - magpie-2.0
        - magpie-2.5
        - magpie-2.5-flash
        - magpie-3.0
        - llm-only
      default: magpie-2.5
      description: >
        The agent model determines the processing mode for Converse requests.
        The Datagrid web app exposes **Ask**, **Extended**, and **Execute** as
        Converse **`chat_mode`** (`llm_router`, `light_agent`, `full_agent`).
        The values below set **`config.agent_model`** (model tier and tool
        limits)—use both fields when mirroring in-app behavior.


        **Execute** (full tool use, planning, and multi-step reasoning; aligns
        with **Execute** in the web app / `full_agent`):

        - `magpie-2.0` — Legacy full-agent model with proactive planning and
        reasoning.

        - `magpie-2.5` — Default. Latest full-agent model — faster, more
        adaptable, and built to handle a broader range of real-world tasks.

        - `magpie-1.1` — Previous-generation full agent model.


        **Extended** (search-focused; aligns with **Extended** in the web app /
        `light_agent`; not **Ask**):

        - `magpie-1.1-flash` — Fast model optimized for RAG use cases. Only
        supports the `semantic_search` tool. A 400 error will be returned if
        other tools are specified.


        **Direct LLM** (no tool execution; **`agent_model` only**—**Ask** in the
        web app is `chat_mode: llm_router`, not `magpie-1.1-flash`):

        - `llm-only` — Runs a direct LLM conversation with no planning or tool
        calls. A 400 error will be returned if tools are specified.


        **BETA**: Magpie 3.0. Behavior and schema may change.

        - `magpie-3.0` — **BETA**. Available on the public Converse API. In-app
        rollout flags do not apply to this request.


        Can also accept any custom string value for future model versions.
      nullable: true
    LlmModel:
      anyOf:
        - $ref: '#/components/schemas/LlmModelEnum'
        - type: string
      default: gemini-3.1-flash-lite
      description: >-
        The LLM used to generate responses. Any id returned by `GET /v1/models`
        with `type: llm` is accepted; the enum lists the ids known when this
        spec was generated. Deprecated Gemini 2.x Flash ids are accepted for
        backward compatibility and automatically run as gemini-3.1-flash-lite.
    Tool:
      type: object
      required:
        - name
      properties:
        name:
          $ref: '#/components/schemas/ToolName'
        connection_id:
          type: string
          description: The ID of the connection to use for the tool.
          nullable: true
    AgentMcpServer:
      type: object
      required:
        - object
        - server_id
        - name
        - base_url
        - status
        - credential_id
      properties:
        object:
          type: string
          enum:
            - agent_mcp_server
        server_id:
          type: string
        name:
          type: string
        base_url:
          type: string
          format: uri
        status:
          type: string
        tool_count:
          type: integer
        last_synced_at:
          type: string
          format: date-time
        credential_id:
          type: string
          nullable: true
    CorpusKnowledgeItem:
      type: object
      required:
        - type
        - knowledge_id
      properties:
        type:
          type: string
          enum:
            - knowledge
          description: The type of the corpus item. Always 'knowledge' for knowledge items.
          x-stainless-const: true
        knowledge_id:
          type: string
          description: The ID of the knowledge to include in the corpus.
    CorpusPageItem:
      type: object
      required:
        - type
        - page_id
      properties:
        type:
          type: string
          enum:
            - page
          description: The type of the corpus item. Always 'page' for page items.
          x-stainless-const: true
        page_id:
          type: string
          description: The ID of the page to include in the corpus.
    AgentModelEnum:
      type: string
      enum:
        - magpie-1.1
        - magpie-1.1-flash
        - magpie-2.0
        - magpie-2.5
        - magpie-2.5-flash
        - magpie-3.0
        - llm-only
      description: >-
        Predefined agent model versions. `magpie-3.0` is beta: behavior and
        schema may change.
    LlmModelEnum:
      type: string
      description: >-
        Every `llm_model` id accepted at the time this spec was generated,
        grouped by publisher and serving platform. `GET /v1/models` is the
        authoritative list for your teamspace, including which ids currently run
        as requested. Sunset ids stay accepted and run as their successor.
      enum:
        - gemini-2.0-flash
        - gemini-2.5-flash
        - gemini-2.5-flash-lite
        - gemini-2.5-pro
        - gemini-3-flash-preview
        - gemini-3-pro-preview
        - gemini-3.1-flash-lite
        - gemini-3.1-pro-preview
        - gemini-3.5-flash
        - gemini-3.5-flash-lite
        - gemini-3.6-flash
        - gemini-3.7-flash
        - gemini-3.8-flash
        - gemini-4-argon
        - gemini-live-2.5-flash-native-audio
        - gemini-1.5-flash-001
        - gemini-1.5-flash-002
        - gemini-2.0-flash-001
        - gemini-2.5-flash-preview-04-17
        - gemini-1.5-pro-001
        - gemini-1.5-pro-002
        - gemini-2.5-pro-preview-05-06
        - claude-haiku-4-5@20251001
        - claude-sonnet-4-6@default
        - claude-opus-4-6@default
        - claude-opus-4-7
        - claude-opus-4-8
        - claude-sonnet-5
        - claude-opus-5
        - claude-opus-5-5
        - claude-fable-5-1
        - claude-sonnet-5-5
        - claude-haiku-5-5
        - anthropic.claude-haiku-4-5-20251001-v1:0
        - anthropic.claude-sonnet-4-5-20250929-v1:0
        - anthropic.claude-sonnet-4-6
        - anthropic.claude-opus-4-5-20251101-v1:0
        - anthropic.claude-opus-4-6-v1
        - anthropic.claude-opus-4-7
        - anthropic.claude-opus-4-8
        - anthropic.claude-sonnet-5
        - anthropic.claude-opus-5
        - anthropic.claude-opus-5-5
        - anthropic.claude-fable-5-1
        - anthropic.claude-sonnet-5-5
        - anthropic.claude-haiku-5-5
        - gpt-4o-mini
        - gpt-4o
        - gpt-4.1-mini
        - gpt-4.1
        - gpt-5-mini
        - gpt-5
        - gpt-5.1
        - chatgpt-4o-latest
        - gpt-4-turbo
        - gpt-4
        - openai.gpt-5.5
        - openai.gpt-5.6-luna
        - openai.gpt-5.6-sol
        - openai.gpt-5.6-terra
        - openai.gpt-6-luna
        - openai.gpt-6-sol
        - openai.gpt-6-astra
        - openai.gpt-6.1-sol
        - xai.grok-4.7
        - amazon.nova-2-lite-v1:0
    ToolName:
      type: string
      description: The unique identifier for a tool.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.