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

# API Overview

> Overview of the Voicy API endpoints

# API Overview

The Voicy API provides RESTful endpoints for managing calls.

## Base URL

```
https://api.voicy.co/functions/v1
```

Each endpoint is an individual edge function at `{base_url}/{function-name}`.

## Endpoints

### Calls

| Method | Endpoint              | Description                                                |
| ------ | --------------------- | ---------------------------------------------------------- |
| POST   | `/call-dial`          | Initiate an outbound call                                  |
| GET    | `/call-get/{call_id}` | Get call details with transcript, recording, and variables |
| POST   | `/call-list`          | List calls with filters, sorting, and pagination           |

### Agents

| Method | Endpoint                   | Description                                        |
| ------ | -------------------------- | -------------------------------------------------- |
| GET    | `/agent-list`              | List the agents in your account                    |
| GET    | `/agent-get/{agent_id}`    | Get an agent and its variable contract             |
| POST   | `/agent-create`            | Create a prompt-based agent (deployed immediately) |
| PATCH  | `/agent-modify/{agent_id}` | Update a prompt-based agent                        |

## Authentication

Include your API key in the Authorization header:

```
Authorization: Bearer voicy_sk_your_api_key
```

## Request Format

* Use `Content-Type: application/json` for request bodies
* Include `Authorization: Bearer <api_key>` header
* Send JSON-encoded request bodies

## Response Format

Successful responses return the requested data directly as JSON. Error responses:

```json theme={null}
{
  "status": "error",
  "message": "Description of what went wrong"
}
```

## HTTP Status Codes

| Code | Meaning               |
| ---- | --------------------- |
| 200  | Success               |
| 201  | Created               |
| 400  | Bad Request           |
| 401  | Unauthorized          |
| 403  | Forbidden             |
| 404  | Not Found             |
| 422  | Unprocessable Entity  |
| 500  | Internal Server Error |

## Pagination

`/call-list` supports cursor-based pagination:

```json theme={null}
{
  "limit": 50,
  "pagination_key": "last_call_id_from_previous_page"
}
```

The response includes `total_count` for displaying total results.

## Filtering

Filter calls by various criteria:

```json theme={null}
{
  "filter_criteria": {
    "agent_id": ["uuid1", "uuid2"],
    "call_status": ["ended"],
    "direction": ["incoming", "outgoing"],
    "start_timestamp": {
      "lower_threshold": 1704067200000,
      "upper_threshold": 1704153600000
    }
  }
}
```
