← Back to Documentation
API Reference
VoiceRail has two services: the API for management and the Voice service for calls.
Base URLs
API
https://api.voicerail.ai/v1Voice
https://voice.voicerail.ai/api/v1Authentication
All API requests require two headers:
Authentication
# All requests require these headers
curl https://api.voicerail.ai/v1/assistants \
-H "Authorization: Bearer $VOICERAIL_KEY" \
-H "X-Organization-Id: org_xxxx"Authorization- Bearer token from dashboardX-Organization-Id- Your organization ID
API Endpoints
Management endpoints for assistants, organizations, phone numbers, and archetypes.
Assistants
| Method | Endpoint | Description |
|---|---|---|
| POST | /assistants | Create a new assistant |
| GET | /assistants | List all assistants |
| GET | /assistants/:id | Get assistant by ID |
| PUT | /assistants/:id | Update assistant |
| DELETE | /assistants/:id | Delete assistant |
Create Assistant
curl -X POST https://api.voicerail.ai/v1/assistants \
-H "Authorization: Bearer $VOICERAIL_KEY" \
-H "X-Organization-Id: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "Alex",
"archetype": "helper",
"discProfile": {
"dominance": 45,
"influence": 70,
"steadiness": 60,
"conscientiousness": 50
},
"voice": {
"provider": "azure",
"voiceId": "en-US-JennyNeural"
}
}'Organizations
| Method | Endpoint | Description |
|---|---|---|
| POST | /organizations | Create organization |
| GET | /organizations/:id | Get organization by ID |
| PUT | /organizations/:id | Update organization (MCP servers, hold music) |
| DELETE | /organizations/:id | Delete organization |
Phone Numbers
| Method | Endpoint | Description |
|---|---|---|
| POST | /phone-numbers | Create phone number mapping |
| GET | /phone-numbers | List all phone number mappings |
| GET | /phone-numbers/:id | Get phone number mapping by ID |
| GET | /phone-numbers/by-number/:number | Lookup by E.164 phone number |
| PUT | /phone-numbers/:id | Update phone number mapping |
| DELETE | /phone-numbers/:id | Delete phone number mapping |
Custom Archetypes
| Method | Endpoint | Description |
|---|---|---|
| POST | /archetypes | Upload custom archetype (YAML) |
| GET | /archetypes | List custom archetypes |
| GET | /archetypes/:name | Get archetype by name |
| DELETE | /archetypes/:name | Delete custom archetype |
Call Sessions (Real-time)
| Method | Endpoint | Description |
|---|---|---|
| GET | /call-sessions | List active call sessions |
| GET | /call-sessions/:id | Get active session details |
Call sessions show active (non-terminal) calls. Poll every 2-5 seconds for monitoring.
Health & Info
| Method | Endpoint | Description |
|---|---|---|
| GET | /health | Health check endpoint |
| GET | / | Service info (version, environment) |
Voice Service Endpoints
Call management endpoints on the Voice service (voice.voicerail.ai).
Calls
| Method | Endpoint | Description |
|---|---|---|
| POST | /calls | Initiate outbound call |
| GET | /calls | List calls (filter by assistant, status, date) |
| GET | /calls/:id | Get call details |
| GET | /calls/:id/transcript | Get call transcript (JSON or text) |
| GET | /calls/:id/recording | Get recording download URL (24h expiry) |
| GET | /calls/:id/live-transcript | Get live transcript (active calls only) |
| GET | /calls/:id/live-state | Get live state with memory (active calls) |
Initiate Call
# Note: Calls are made to the Voice service, not the API
# fromPhoneNumber is optional - defaults to assistant's mapped number
curl -X POST https://voice.voicerail.ai/api/v1/calls \
-H "Authorization: Bearer $VOICERAIL_KEY" \
-H "X-Organization-Id: $ORG_ID" \
-H "Content-Type: application/json" \
-d '{
"assistantId": "asst_xxx",
"toPhoneNumber": "+15551234567"
}'Error Handling
All errors return JSON with a consistent structure:
Error Response
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "Validation Failed",
"status": 400,
"detail": "The assistant_id field is required",
"errors": {
"assistantId": ["The AssistantId field is required."]
}
}| Status | Meaning |
|---|---|
| 400 | Bad request - invalid parameters or validation failed |
| 401 | Unauthorized - invalid or missing API key |
| 403 | Forbidden - valid key but no permission for resource |
| 404 | Not found - resource doesn't exist |
| 409 | Conflict - resource already exists or concurrent modification |
| 429 | Rate limited - too many requests |
| 503 | Service unavailable - database or ACS error |
| 500 | Server error - unexpected error occurred |
Rate Limits
Default rate limits by plan:
| Plan | Requests/min | Concurrent Calls |
|---|---|---|
| Free | 60 | 2 |
| Pro | 600 | 20 |
| Enterprise | Custom | Custom |
Rate limit headers are included in every response:
X-RateLimit-Limit- Requests allowed per windowX-RateLimit-Remaining- Requests remainingX-RateLimit-Reset- Unix timestamp when window resets
OpenAPI Specification
The full OpenAPI (Swagger) specification is available at:
- Swagger UI:
https://api.voicerail.ai/docs - OpenAPI JSON:
https://api.voicerail.ai/swagger/v1/swagger.json
Use these to generate client libraries for your language of choice.
Next steps
- • Follow the quickstart guide
- • Configure assistant settings
- • Use the LLM prompt for AI coding assistants