> ## 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.

# List agents

> List agents for the authenticated organization. `corpus` and `knowledge_ids` are deprecated on this endpoint and still returned from the agent's stored selectors. Null means all knowledge. They do not expand tenant datasets and tables. Retrieve an agent to read knowledge scope after they are removed from list.



## OpenAPI

````yaml get /agents
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:
    get:
      tags:
        - Agents
      summary: List agents
      description: >-
        List agents for the authenticated organization. `corpus` and
        `knowledge_ids` are deprecated on this endpoint and still returned from
        the agent's stored selectors. Null means all knowledge. They do not
        expand tenant datasets and tables. Retrieve an agent to read knowledge
        scope after they are removed from list.
      operationId: ListAgents
      parameters:
        - name: search
          in: query
          required: false
          description: >-
            Optional search string to filter agents by name. Case-insensitive
            partial match.
          schema:
            type: string
            maxLength: 255
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/after'
        - $ref: '#/components/parameters/before'
      responses:
        '200':
          description: List of agents
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentListResponse'
        '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:
  parameters:
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 50
        minimum: 1
        maximum: 100
      required: false
      description: The limit on the number of objects to return, ranging between 1 and 100.
    after:
      name: after
      in: query
      schema:
        type: string
      required: false
      description: >-
        A cursor to use in pagination. `after` is an object ID that defines your
        place in the list. For example, if you make a list request and receive
        100 objects, ending with `obj_foo`, your subsequent call can include
        `after=obj_foo` to fetch the next page of the list.
    before:
      name: before
      in: query
      schema:
        type: string
      required: false
      description: >-
        A cursor to use in pagination. `before` is an object ID that defines
        your place in the list. For example, if you make a list request and
        receive 100 objects, starting with `obj_bar`, your subsequent call can
        include `before=obj_bar` to fetch the previous page of the list.
  schemas:
    AgentListResponse:
      type: object
      required:
        - object
        - data
        - has_more
      properties:
        object:
          type: string
          enum:
            - list
          description: The object type, always 'list'
        data:
          type: array
          items:
            $ref: '#/components/schemas/AgentListItem'
          description: >-
            Array of agents. `corpus` and `knowledge_ids` are deprecated on list
            and still returned. Null means all knowledge.
        has_more:
          type: boolean
          description: Whether there are more results available
    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.
    AgentListItem:
      description: >-
        An agent as returned by List agents. `corpus` and `knowledge_ids` are
        deprecated on this endpoint and still returned. Null means all
        knowledge. Retrieve the agent to read knowledge scope after they are
        removed from list.
      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
            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
            agent_model:
              $ref: '#/components/schemas/AgentModel'
            llm_model:
              $ref: '#/components/schemas/LlmModel'
            knowledge_ids:
              type: array
              nullable: true
              deprecated: true
              description: >-
                Deprecated on list, and deprecated in favor of `corpus`. Still
                returned. Null means all knowledge.
              items:
                type: string
            corpus:
              type: array
              nullable: true
              deprecated: true
              description: >-
                Deprecated on list. Still returned from the agent's stored
                selectors, without expanding tenant knowledge. Null means all
                knowledge. Retrieve the agent to read knowledge scope after this
                field is removed from list.
              items:
                oneOf:
                  - $ref: '#/components/schemas/CorpusKnowledgeItem'
                  - $ref: '#/components/schemas/CorpusPageItem'
            tools:
              type: array
              items:
                $ref: '#/components/schemas/Tool'
              description: Tools that this agent can use.
            mcp_servers:
              type: array
              items:
                $ref: '#/components/schemas/AgentMcpServer'
              description: Registered MCP servers enabled for this agent.
    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.
    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.
    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
    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.