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

# List Agents

> List all agents with filtering and pagination

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer olive_live_xxx` or `Bearer eyJ...` (JWT)
</ParamField>

### Query Parameters

<ParamField query="type" type="string">
  Filter by type: `super_agent` or `sub_agent`
</ParamField>

<ParamField query="status" type="string">
  Filter by status: `active`, `suspended`, `terminated`
</ParamField>

<ParamField query="parent_agent_id" type="string">
  Filter by parent agent (for sub-agents)
</ParamField>

<ParamField query="search" type="string">
  Search by name, business name, or phone
</ParamField>

<ParamField query="limit" type="integer" default="50">
  Results per page (max 100)
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Pagination offset
</ParamField>

***

## Response

<ResponseField name="agents" type="array">
  Array of agent objects
</ResponseField>

<ResponseField name="total_count" type="integer">
  Total matching agents
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL - All Agents theme={null}
  curl -X GET "https://demo.api.vultlocal.com/api/v1/agents" \
    -H "Authorization: Bearer olive_live_xxx"
  ```

  ```bash cURL - Super-Agents Only theme={null}
  curl -X GET "https://demo.api.vultlocal.com/api/v1/agents?type=super_agent" \
    -H "Authorization: Bearer olive_live_xxx"
  ```

  ```bash cURL - Sub-Agents of Parent theme={null}
  curl -X GET "https://demo.api.vultlocal.com/api/v1/agents?parent_agent_id=agent_abc123" \
    -H "Authorization: Bearer olive_live_xxx"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "agents": [
      {
        "id": "agent_abc123",
        "type": "super_agent",
        "business_name": "ABC Money Services",
        "first_name": "John",
        "last_name": "Doe",
        "status": "active",
        "float_balance_formatted": "5,000,000.00 SLE",
        "sub_agent_count": 12
      },
      {
        "id": "agent_xyz789",
        "type": "sub_agent",
        "business_name": "Corner Shop",
        "first_name": "Jane",
        "last_name": "Smith",
        "status": "active",
        "float_balance_formatted": "500,000.00 SLE",
        "parent_agent_id": "agent_abc123"
      }
    ],
    "total_count": 150,
    "limit": 50,
    "offset": 0
  }
  ```
</ResponseExample>

***

## Common Filters

| Use Case          | Query                            |
| ----------------- | -------------------------------- |
| All super-agents  | `?type=super_agent`              |
| Active sub-agents | `?type=sub_agent&status=active`  |
| My sub-agents     | `?parent_agent_id={my_agent_id}` |
| Search by name    | `?search=John`                   |

***

## Errors

| Status | Code             | Description              |
| ------ | ---------------- | ------------------------ |
| 401    | `UNAUTHORIZED`   | Invalid API key          |
| 403    | `FORBIDDEN`      | Insufficient permissions |
| 500    | `INTERNAL_ERROR` | Server error             |


## OpenAPI

````yaml olive-openapi.json GET /agents
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /agents:
    get:
      tags:
        - Agents
      summary: List all agents
      description: List agents with optional filtering by type and parent
      parameters:
        - description: Filter by agent type (super_agent or sub_agent)
          name: agent_type
          in: query
          schema:
            type: string
        - description: Filter by parent agent ID
          name: parent_agent_id
          in: query
          schema:
            type: string
        - description: Number of results to return
          name: limit
          in: query
          schema:
            type: integer
            default: 50
        - description: Offset for pagination
          name: offset
          in: query
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API Key for third-party integrations (WhatsApp, Smart PAY, VULT).
        Format: 'Bearer olive_live_xxxxxxxxxxxxx'
      type: apiKey
      name: Authorization
      in: header
    BearerAuth:
      description: >-
        JWT token from admin login for administrative operations. Format:
        'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
      type: apiKey
      name: Authorization
      in: header

````