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

# List Agents

> List all agents registered with Memanto.

## Overview

Returns every agent stored locally by Memanto, sorted by creation time (newest first). Each entry includes namespace, pattern, activity counters, and status.

## Authentication

<ParamField header="Authorization" type="string">
  `Bearer <key>` — required unless the request originates from a loopback client. See [Management Endpoint Authentication](/api-reference/authentication#management-endpoint-authentication-agent-lifecycle).
</ParamField>

<ParamField header="X-Api-Key" type="string">
  Alternative to `Authorization: Bearer` — same credential.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "http://localhost:8000/api/v2/agents"
  ```

  ```bash cURL (non-loopback, with credential) theme={null}
  curl -X GET "https://memanto.example.com/api/v2/agents" \
    -H "Authorization: Bearer $MOORCHEH_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - OK theme={null}
  {
    "agents": [
      {
        "agent_id": "customer-support",
        "namespace": "memanto_agent_customer-support",
        "pattern": "support",
        "description": "Handles customer inquiries",
        "created_at": "2026-05-04T10:30:00.000000",
        "last_session": "2026-05-04T14:22:00.000000",
        "memory_count": 42,
        "session_count": 5,
        "status": "ready"
      },
      {
        "agent_id": "data-analyst",
        "namespace": "memanto_agent_data-analyst",
        "pattern": "project",
        "description": "Analyzes metrics",
        "created_at": "2026-05-03T09:15:00.000000",
        "last_session": null,
        "memory_count": 0,
        "session_count": 0,
        "status": "ready"
      }
    ],
    "count": 2
  }
  ```

  ```json 401 - Unauthorized (Management Auth Required) theme={null}
  {
    "detail": "Unauthorized. Agent management endpoints require either a loopback client or a valid management credential (Authorization: Bearer <key> or X-Api-Key)."
  }
  ```

  ```json 500 - Server Error theme={null}
  {
    "detail": {
      "error": "InternalServerError",
      "message": "An unexpected error occurred",
      "details": {
        "original_error": "..."
      }
    }
  }
  ```
</ResponseExample>

## Next Steps

After listing your agents, you can:

* [Create Agent](/api-reference/agents/create-agent) to add a new one
* [Get Agent](/api-reference/agents/get-agent) to inspect a specific agent
* [Activate Agent](/api-reference/sessions/activate-agent) to begin a session with an agent
