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

# Get Agents

> Return the list of agents accessible to the current API-key-authenticated frontend user.

## Get Agents

Retrieves a list of all agents accessible to the authenticated user.

### Request

**Method:** `POST`\
**Endpoint:** `/api/get-agents`\
**Headers:**

* `X-Authorization`: Your API key (required)
* `Content-Type`: `application/json`

**Request Body:**

```json theme={null}
{
  "uid": "string"
}
```

**Parameters:**

* `uid` (string, required): Your user ID

### Response

**Success Response (200):**

```json theme={null}
[
  {
    "uid": "string",
    "agentId": "string",
    "name": "string",
    "country": "string",
    "businessPhoneNumber": "string"
  }
]
```

**Error Responses:**

* `400 Bad Request`: Invalid request body
* `401 Unauthorized`: Invalid or missing API key
* `500 Internal Server Error`: Server error

### Example

```bash theme={null}
curl -X POST https://app.phonely.ai/api/get-agents \
  -H "X-Authorization: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "user123"
  }'
```


## OpenAPI

````yaml POST /get-agents
openapi: 3.0.1
info:
  title: Phonely API
  description: API for Phonely services including agent management and call summaries
  version: 1.0.0
servers:
  - url: https://app.phonely.ai/api
security: []
paths:
  /get-agents:
    post:
      summary: Get agents information
      description: Retrieve information for all agents associated with the user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetOrgsRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrgInfo'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GetOrgsRequest:
      type: object
      required:
        - uid
      properties:
        uid:
          type: string
          description: User ID
    OrgInfo:
      type: object
      properties:
        orgId:
          type: string
          description: Organization ID
        name:
          type: string
          description: Organization name
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code or identifier
        message:
          type: string
          description: Detailed error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization

````