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

# Get Agent

> Retrieve agent details by ID

## Request

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

### Path Parameters

<ParamField path="id" type="string" required>
  Agent UUID (e.g., `agent_abc123`)
</ParamField>

***

## Response

<ResponseField name="agent" type="object">
  <Expandable title="Agent Object">
    <ResponseField name="id" type="string">
      Unique agent UUID
    </ResponseField>

    <ResponseField name="type" type="string">
      `super_agent` or `sub_agent`
    </ResponseField>

    <ResponseField name="business_name" type="string">
      Registered business name
    </ResponseField>

    <ResponseField name="first_name" type="string">
      Agent first name
    </ResponseField>

    <ResponseField name="last_name" type="string">
      Agent last name
    </ResponseField>

    <ResponseField name="phone_number" type="string">
      Contact phone
    </ResponseField>

    <ResponseField name="status" type="string">
      `active`, `suspended`, `terminated`
    </ResponseField>

    <ResponseField name="float_balance" type="integer">
      Current float in cents
    </ResponseField>

    <ResponseField name="float_balance_formatted" type="string">
      Formatted balance
    </ResponseField>

    <ResponseField name="parent_agent_id" type="string">
      Parent agent (sub-agents only)
    </ResponseField>

    <ResponseField name="sub_agent_count" type="integer">
      Number of sub-agents (super-agents only)
    </ResponseField>
  </Expandable>
</ResponseField>

***

## Examples

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

<ResponseExample>
  ```json 200 Super-Agent theme={null}
  {
    "agent": {
      "id": "agent_abc123",
      "type": "super_agent",
      "business_name": "ABC Money Services",
      "first_name": "John",
      "last_name": "Doe",
      "phone_number": "+23277123456",
      "email": "john@abcmoney.sl",
      "location": "Freetown CBD",
      "status": "active",
      "float_balance": 5000000,
      "float_balance_formatted": "5,000,000.00 SLE",
      "commission_tier": "premium",
      "settlement_mode": "instant",
      "sub_agent_count": 12,
      "created_at": "2025-01-01T10:00:00Z"
    }
  }
  ```

  ```json 200 Sub-Agent theme={null}
  {
    "agent": {
      "id": "agent_xyz789",
      "type": "sub_agent",
      "business_name": "Corner Shop",
      "first_name": "Jane",
      "last_name": "Smith",
      "phone_number": "+23276654321",
      "status": "active",
      "float_balance": 500000,
      "float_balance_formatted": "500,000.00 SLE",
      "parent_agent_id": "agent_abc123",
      "parent_agent_name": "ABC Money Services",
      "created_at": "2025-01-15T10:30:00Z"
    }
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Agent not found",
    "code": "NOT_FOUND"
  }
  ```
</ResponseExample>

***

## Errors

| Status | Code             | Description                       |
| ------ | ---------------- | --------------------------------- |
| 401    | `UNAUTHORIZED`   | Invalid API key                   |
| 403    | `FORBIDDEN`      | Not authorized to view this agent |
| 404    | `NOT_FOUND`      | Agent not found                   |
| 500    | `INTERNAL_ERROR` | Server error                      |


## OpenAPI

````yaml olive-openapi.json GET /agents/{id}
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/{id}:
    get:
      tags:
        - Agents
      summary: Get agent details
      description: Get detailed information about an agent
      parameters:
        - description: Agent ID
          name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Not Found
          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

````