# API reference

The Vocenya REST API is organized around resources, uses JSON for requests and responses, and standard HTTP status codes. Every request is authenticated with an organization API key.

- Base URL: `https://vocenya.com/api/public/v1`
- Authentication: `Authorization: Bearer $VOCENYA_API_KEY` ([Authentication](https://vocenya.com/docs/authentication))
- Lists: newest first, cursor paginated, up to 100 per page ([Pagination](https://vocenya.com/docs/pagination))
- Rate limit: 120 requests per minute per key ([Rate limits](https://vocenya.com/docs/rate-limits))
- Errors: `{"message": "...", "code": "..."}` ([Errors](https://vocenya.com/docs/errors))
- OpenAPI document: [https://vocenya.com/docs/api.json](https://vocenya.com/docs/api.json)

This reference is generated from the API code itself, so it always matches what the API does.

## Resources

### [Account](https://vocenya.com/docs/reference/account.md)

- `GET /me`: Get the current key

### [Calls](https://vocenya.com/docs/reference/calls.md)

- `GET /calls`: List calls (`calls:read`)
- `GET /calls/{call}`: Get a call (`calls:read`)

### [Leads](https://vocenya.com/docs/reference/leads.md)

- `GET /leads`: List leads (`leads:read`)
- `POST /leads`: Create a lead (`leads:write`)
- `GET /leads/{lead}`: Get a lead (`leads:read`)

### [Bookings](https://vocenya.com/docs/reference/bookings.md)

- `GET /bookings`: List bookings (`bookings:read`)
- `GET /bookings/{booking}`: Get a booking (`bookings:read`)

### [Outbound calls](https://vocenya.com/docs/reference/outbound-calls.md)

- `GET /outbound-calls`: List outbound calls (`outbound:write`)
- `POST /outbound-calls`: Queue an outbound AI call (`outbound:write`)
- `GET /outbound-calls/{outboundCall}`: Get an outbound call (`outbound:write`)

### [Do Not Call](https://vocenya.com/docs/reference/do-not-call.md)

- `GET /do-not-call`: List Do Not Call entries (`dnc:read`)
- `POST /do-not-call`: Add a number to the Do Not Call list (`dnc:write`)
- `DELETE /do-not-call/{entry}`: Remove a number from the Do Not Call list (`dnc:write`)

### [Blocked callers](https://vocenya.com/docs/reference/blocked-callers.md)

- `GET /blocked-callers`: List blocked callers (`dnc:read`)
- `POST /blocked-callers`: Block a caller (`dnc:write`)
- `DELETE /blocked-callers/{entry}`: Unblock a caller (`dnc:write`)

### [Chats](https://vocenya.com/docs/reference/chats.md)

- `GET /chats`: List chats (`chats:read`)
- `GET /chats/{chat}`: Get a chat (`chats:read`)
- `POST /chats/{chat}/messages`: Reply in a chat (`chats:write`)
- `POST /chats/{chat}/close`: Close a chat (`chats:write`)

### [Webhooks](https://vocenya.com/docs/reference/webhooks.md)

- `GET /webhook-endpoints`: List webhook endpoints (`webhooks:manage`)
- `POST /webhook-endpoints`: Create a webhook endpoint (`webhooks:manage`)
- `DELETE /webhook-endpoints/{webhookEndpoint}`: Delete a webhook endpoint (`webhooks:manage`)
- `POST /webhook-endpoints/{webhookEndpoint}/test`: Send a test event (`webhooks:manage`)
