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

# List agents

> Lists the active agents in the API key's workspace, sorted by name. Uses `X-Api-Key` only, so tools can
check a key and then let you pick an agent.




## OpenAPI

````yaml /api-reference/agent-api-openapi.yaml get /v1/agents
openapi: 3.0.3
info:
  title: FinalSay Agent API
  description: >
    Ask a person before your agent acts. Create an approval, then poll for the
    result or receive it on a callback URL.


    Approval endpoints need two headers: `X-Agent-Id` (the agent's UUID) and
    `X-Api-Key` (a workspace API key).

    `GET /v1/agents` needs only `X-Api-Key`.
  version: 1.0.0
servers:
  - url: https://api.finalsay-hitl.com
security:
  - AgentId: []
    ApiKey: []
tags:
  - name: Approvals
    description: Create approvals and read their outcome
  - name: Agents
    description: List the agents a workspace API key can act as
paths:
  /v1/agents:
    get:
      tags:
        - Agents
      summary: List agents
      description: >
        Lists the active agents in the API key's workspace, sorted by name. Uses
        `X-Api-Key` only, so tools can

        check a key and then let you pick an agent.
      operationId: listAgentsForApiKey
      responses:
        '200':
          description: Active agents sorted by name
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentSummary'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    enum:
                      - missing_api_key
                      - invalid_api_key
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    enum:
                      - agents_list_failed
      security:
        - ApiKey: []
components:
  schemas:
    AgentSummary:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: Use as `X-Agent-Id`.
        name:
          type: string
          description: The agent's name, or its id when the name is empty.
  securitySchemes:
    AgentId:
      type: apiKey
      in: header
      name: X-Agent-Id
      description: >-
        The agent's UUID, from the agent's page in the web dashboard or `GET
        /v1/agents`.
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        A workspace API key (starts with `hitl_`). Shown once when an owner or
        admin creates it.

````

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