Place an outbound call with an inline agent spec (ephemeral)
const url = 'https://api.pingram.io/voice/call';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"phoneNumber":"example","spec":{"name":"example","instructions":"example","inbound":{"firstAction":"speak","greeting":"example"},"outbound":{"firstAction":"speak","opener":"example","voicemailAction":"hangup","voicemailMessage":"example"},"model":{"mode":"chained","llm":"example","stt":"example","tts":"example","voiceId":"example","language":"example","speechSpeed":1,"temperature":1,"maxTokens":1},"tools":[{"type":"transfer","transferMode":"warm","destination":"example","briefing":"example"}],"variables":[{"name":"example","description":"example","defaultValue":"example"}],"conversation":{"turnDetection":"semantic","minEndOfTurnSilenceMs":1,"allowInterruptions":true,"minInterruptionDurationMs":1,"silenceTimeoutSeconds":1,"maxCallLengthSeconds":1,"agentCanEndCall":true},"compliance":{"recordingEnabled":true}},"variables":{"additionalProperty":"example"},"agentId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pingram.io/voice/call \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "phoneNumber": "example", "spec": { "name": "example", "instructions": "example", "inbound": { "firstAction": "speak", "greeting": "example" }, "outbound": { "firstAction": "speak", "opener": "example", "voicemailAction": "hangup", "voicemailMessage": "example" }, "model": { "mode": "chained", "llm": "example", "stt": "example", "tts": "example", "voiceId": "example", "language": "example", "speechSpeed": 1, "temperature": 1, "maxTokens": 1 }, "tools": [ { "type": "transfer", "transferMode": "warm", "destination": "example", "briefing": "example" } ], "variables": [ { "name": "example", "description": "example", "defaultValue": "example" } ], "conversation": { "turnDetection": "semantic", "minEndOfTurnSilenceMs": 1, "allowInterruptions": true, "minInterruptionDurationMs": 1, "silenceTimeoutSeconds": 1, "maxCallLengthSeconds": 1, "agentCanEndCall": true }, "compliance": { "recordingEnabled": true } }, "variables": { "additionalProperty": "example" }, "agentId": "example" }'Authorizations
Request Bodyrequired
object
object
object
object
Separate STT, LLM, and TTS providers. For best call quality, prefer s2s mode.
object
‘provider:model’, e.g. ‘openai:gpt-4o’
‘provider:model’, e.g. ‘deepgram:nova-3’
‘provider:model’, e.g. ‘elevenlabs:eleven_multilingual_v2’
Provider-native voice id for the selected TTS provider (e.g. ElevenLabs UUID, OpenAI alloy).
Speech-to-speech realtime model — best call quality.
object
‘provider:model’, e.g. ‘openai:gpt-realtime’
Provider-native voice id for the selected realtime model (e.g. OpenAI marin).
object
object
object
object
HTTPS webhook invoked when the model calls this tool during a call.
object
object
object
Opaque identifier for an uploaded knowledge document.
object
object
When true (default), the agent may invoke the built-in end_call action.
object
Optional per-call {{variable}} overrides.
object
Saved agent id when testing from the dashboard playground.
Responses
200
Successful response
object
Stable tracking id — use with GET /voice/calls/{trackingId}.
Examplegenerated
{ "trackingId": "example", "callControlId": "example", "websocket": "example"}400
Bad Request - validation errors, invalid input
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}401
Unauthorized
402
Payment Required - usage limits exceeded
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}500
Internal Server Error
502
Bad Gateway - provider error
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}