VoiceDock Docs
ApiCall Control

Send control command to active call

Send real-time commands to an active call. The call must be in "in-progress" status. **⚠️ IMPORTANT: xAI Realtime Model Limitations** Call control has **significant limitations** when using xAI Realtime (grok-realtime-v1) due to its speech-to-speech architecture: - ❌ `inject-context`: Limited effectiveness - context may not influence responses reliably - ❌ `say`: Does not work reliably - commands often timeout or fail to trigger speech - ✅ `end-call`: Works reliably - ⚠️ `transfer`: Partial support - announcement may not work, but transfer executes **Why the limitations?** xAI Realtime is an end-to-end audio model that processes speech directly without intermediate text. It expects continuous audio input and cannot reliably respond to text-based control commands mid-conversation. **Recommendation:** If you need full call control support (`inject-context`, `say`, `transfer` with announcements), use the traditional pipeline: - **Provider**: `openai` with `gpt-4o` or `gpt-4o-mini` - **STT**: Deepgram (`nova-3-general`) - **TTS**: ElevenLabs or OpenAI TTS - **Result**: All control commands work reliably **Command Types:** - `inject-context`: Silently add information to the agent's context (traditional models only) - `say`: Make the agent speak specific text (traditional models only) - `end-call`: End the call with an optional final message (works with all models) - `transfer`: Transfer the call to another destination (partial xAI Realtime support) **Use Cases:** - SMS verification: Inject received codes into the conversation - CRM integration: Add customer context mid-call - Human escalation: Transfer to a live agent - Emergency end: Gracefully terminate problematic calls

POST
/calls/{id}/control

Send real-time commands to an active call. The call must be in "in-progress" status.

⚠️ IMPORTANT: xAI Realtime Model Limitations

Call control has significant limitations when using xAI Realtime (grok-realtime-v1) due to its speech-to-speech architecture:

  • inject-context: Limited effectiveness - context may not influence responses reliably
  • say: Does not work reliably - commands often timeout or fail to trigger speech
  • end-call: Works reliably
  • ⚠️ transfer: Partial support - announcement may not work, but transfer executes

Why the limitations? xAI Realtime is an end-to-end audio model that processes speech directly without intermediate text. It expects continuous audio input and cannot reliably respond to text-based control commands mid-conversation.

Recommendation: If you need full call control support (inject-context, say, transfer with announcements), use the traditional pipeline:

  • Provider: openai with gpt-4o or gpt-4o-mini
  • STT: Deepgram (nova-3-general)
  • TTS: ElevenLabs or OpenAI TTS
  • Result: All control commands work reliably

Command Types:

  • inject-context: Silently add information to the agent's context (traditional models only)
  • say: Make the agent speak specific text (traditional models only)
  • end-call: End the call with an optional final message (works with all models)
  • transfer: Transfer the call to another destination (partial xAI Realtime support)

Use Cases:

  • SMS verification: Inject received codes into the conversation
  • CRM integration: Add customer context mid-call
  • Human escalation: Transfer to a live agent
  • Emergency end: Gracefully terminate problematic calls

Authorization

BearerAuth
AuthorizationBearer <token>

API key authentication. Get your key from the dashboard.

In: header

Path Parameters

id*string

Call ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/calls/string/control" \  -H "Content-Type: application/json" \  -d '{    "type": "inject-context",    "content": "The customer has been verified as John Smith, account #12345",    "trigger_response": true  }'
{
  "success": true,
  "message": "Command sent successfully"
}
{
  "error": "Invalid API key",
  "message": "string"
}
{
  "error": "Invalid API key",
  "message": "string"
}
{
  "error": "Invalid API key",
  "message": "string"
}

Initiate outbound call POST

Initiate an outbound call from an AI assistant to a destination phone number. **Phone Number Selection (Important for Resellers):** You can specify which phone number to call from using the `number_id` parameter. This is **highly recommended** for: - **Resellers**: Ensure calls are made from numbers dedicated to specific clients - **Branding**: Always use the same caller ID for recognition - **Compliance**: Meet legal requirements for specific numbers - **Local presence**: Use local numbers for better answer rates If `number_id` is not provided, the system will automatically select an available number from your organization's pool, which may not be appropriate for reseller scenarios where numbers are client-specific. **Three Usage Modes:** 1. **Reference Mode** (`assistant_id`) - Reference an existing assistant from your dashboard - Uses the assistant's pre-configured settings - Simplest option for standard calls 2. **Transient Mode** (`assistant`) - Create a one-time assistant configuration without saving - Full control over STT/LLM/TTS configuration - Perfect for personalized or context-specific calls 3. **Hybrid Mode** (`assistant_id` + `assistant_override`) - Reference a saved assistant as the base - Override specific fields (e.g., first_message, llm_config.messages) - Best for personalization while keeping base config **⚠️ Deprecated:** `agent_id`, `agent`, and `agent_config` are deprecated. Use `assistant_id`, `assistant`, and `assistant_override` instead. **Use Cases:** - Appointment reminders with personalized greetings - Customer follow-ups with dynamic context - Survey calls with specific question flows - Delivery notifications - Payment reminders with account-specific details **Configuration Notes:** - When using `xai_realtime` provider, omit `stt_config` and `tts_config` (handled internally) - For other providers (`openai`, `mistral`), both `stt_config` and `tts_config` are required - The call will be initiated immediately and the response will include a `call_id` to track progress **Response Time:** Your call will typically connect within 2-5 seconds.

List all campaigns GET

Retrieve all outbound campaigns in your organization.