Admin API (Self-hosted)
API reference for self-hosted deployments
Note:
This API is only relevant if you're self-hosting chans. For managed deployments, use the dashboard to manage agents and settings.
Overview
The Admin API provides programmatic control over chans resources for self-hosted deployments.
Base URL: Your self-hosted endpoint (e.g., https://api.your-domain.com)
Authentication
All admin endpoints require an API key via the X-API-Key header:
curl -H "X-API-Key: YOUR_ADMIN_API_KEY" \ https://api.your-domain.com/admin/v1/agents
Set your API key via the CHANS_ADMIN_API_KEY environment variable.
Admin Panel
Access the web-based Admin Panel at /home for managing presets, agents, and viewing conversations.
Endpoints
Health (Public)
| Method | Path | Description |
|---|---|---|
| GET | /health | Basic health check |
| GET | /health/ready | Database readiness |
| GET | /health/live | Container liveness |
| GET | /health/providers | Provider status |
SDK Session (Public)
| Method | Path | Description |
|---|---|---|
| POST | /sdk/v1/session | Create voice session (requires agent token) |
Agents
| Method | Path | Description |
|---|---|---|
| GET | /admin/v1/agents | List agents |
| POST | /admin/v1/agents | Create agent |
| GET | /admin/v1/agents/{id} | Get agent |
| PATCH | /admin/v1/agents/{id} | Update agent |
| DELETE | /admin/v1/agents/{id} | Delete agent |
| GET | /admin/v1/agents/{id}/stats | Agent statistics |
| GET | /admin/v1/agents/{id}/sessions | Agent sessions |
Presets
| Method | Path | Description |
|---|---|---|
| GET | /admin/v1/presets | List presets |
| GET | /admin/v1/presets/available | List available providers |
| POST | /admin/v1/presets | Create preset |
| GET | /admin/v1/presets/{id} | Get preset |
| PATCH | /admin/v1/presets/{id} | Update preset |
| DELETE | /admin/v1/presets/{id} | Delete preset |
Sessions
| Method | Path | Description |
|---|---|---|
| GET | /admin/v1/sessions | List sessions |
| GET | /admin/v1/sessions/{id} | Session details |
Conversations
| Method | Path | Description |
|---|---|---|
| GET | /admin/v1/conversations | List conversations |
| GET | /admin/v1/conversations/{id} | Conversation messages |
Errors
| Method | Path | Description |
|---|---|---|
| GET | /admin/v1/errors | List errors |
| GET | /admin/v1/errors/{id} | Get error |
| GET | /admin/v1/errors/stats/summary | Error statistics |
| POST | /admin/v1/errors/{id}/resolve | Resolve error |
Rate Limits
Default rate limits (configurable via environment):
| Variable | Default | Description |
|---|---|---|
CHANS_RATE_LIMIT_RPM | 60 | Requests per minute |
CHANS_RATE_LIMIT_BURST | 10 | Burst size |
Rate limit headers are included in responses:
X-RateLimit-Limit: 60X-RateLimit-Remaining: 55X-RateLimit-Reset: 1705315200