Enums
The schema defines 14 custom PostgreSQL enum types for type-safe status tracking and categorization.
user_role
Defines access levels for platform users.
| Value | Description |
|---|---|
agency_owner | Full access to agency resources, can manage credentials and delete agents |
agency_admin | Can manage agents, phone numbers, and campaigns |
agency_member | Read access to agency data |
client_admin | Admin access scoped to a specific client |
client_viewer | Read-only access scoped to a specific client |
admin | Platform-level administrator |
Used by: users.role
call_direction
Direction of a phone call.
| Value | Description |
|---|---|
inbound | Incoming call to a Telnyx number |
outbound | Outgoing call initiated by the platform |
Used by: agency_phone_numbers.direction, agent_mappings.default_direction, calls.direction
phone_number_status
Lifecycle status of a purchased phone number.
| Value | Description |
|---|---|
pending | Number purchase initiated, not yet confirmed |
active | Number is live and can receive/make calls |
inactive | Number is temporarily disabled |
released | Number permanently released back to Telnyx |
Used by: agency_phone_numbers.status
batch_status
Status of an outbound call batch operation.
| Value | Description |
|---|---|
pending | Batch created but not yet started |
scheduled | Batch scheduled for future execution |
processing | Batch is actively making calls |
paused | Batch execution temporarily paused |
completed | All contacts in the batch have been processed |
failed | Batch terminated due to errors |
Used by: call_batches.status
batch_mode
Execution mode for a call batch.
| Value | Description |
|---|---|
immediate | Start processing as soon as created |
scheduled | Wait until scheduled_for timestamp |
Used by: call_batches.mode
call_source
How a call record was created in the system.
| Value | Description |
|---|---|
webhook | Created from a real-time Ultravox webhook event |
historical_sync | Imported during a historical sync job |
Used by: calls.source
transcript_status
Processing state of a call's transcript.
| Value | Description |
|---|---|
pending | Transcript not yet fetched |
fetching | Transcript fetch in progress |
completed | Transcript successfully retrieved |
failed | Transcript fetch failed after max retries |
Used by: calls.transcript_status
analysis_status
Processing state of a call's AI analysis.
| Value | Description |
|---|---|
pending | Analysis not yet started |
processing | Analysis in progress |
completed | Analysis successfully completed |
failed | Analysis failed after max retries |
Used by: calls.analysis_status
enrichment_type
Type of enrichment job in the processing queue.
| Value | Description |
|---|---|
transcript | Fetch call transcript from Ultravox |
analysis | Run AI analysis on the transcript via OpenRouter |
Used by: enrichment_queue.type
processing_status
Generic processing status for queue items.
| Value | Description |
|---|---|
pending | Waiting to be processed |
processing | Currently being processed |
completed | Successfully processed |
failed | Processing failed (may retry if attempts < max_attempts) |
Used by: enrichment_queue.status, webhook_queue.status
sync_job_status
Status of a historical data sync job.
| Value | Description |
|---|---|
pending | Job created, waiting to be picked up |
in_progress | Job is actively fetching and importing data |
completed | All data successfully imported |
failed | Job terminated due to errors |
cancelled | Job cancelled by user |
Used by: historical_sync_jobs.status
campaign_type
Type of campaign, determines AI analysis behavior.
| Value | Description |
|---|---|
sdr | Sales Development Representative -- analysis focuses on meetings booked, qualified leads, objections |
cs | Customer Success -- analysis focuses on issues resolved, escalations, satisfaction |
Used by: campaigns.type
contact_status
Status of a contact within a campaign.
| Value | Description |
|---|---|
pending | Not yet called |
scheduled | Scheduled for a specific time |
calling | Currently being called |
completed | Call completed |
failed | Call failed after max attempts |
Used by: campaign_contacts.status
contact_outcome
Outcome of a call attempt to a campaign contact.
| Value | Description |
|---|---|
no_answer | Contact did not answer |
answered | Contact answered the call |
voicemail | Call went to voicemail |
busy | Line was busy |
declined | Contact declined the call |
callback_scheduled | Contact requested a callback |
Used by: campaign_contacts.outcome