POST
/
call
/
phone
curl --request POST \
  --url https://api.vapi.ai/call/phone \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "maxDurationSeconds": 1805,
  "assistantId": "<string>",
  "assistant": {
    "name": "<string>",
    "transcriber": {
      "provider": "deepgram",
      "model": "nova-2",
      "keywords": [
        "<string>"
      ]
    },
    "model": {
      "provider": "openai",
      "model": "gpt-4",
      "systemPrompt": "<string>",
      "temperature": 1,
      "functions": [
        {
          "name": "<string>",
          "async": true,
          "description": "<string>",
          "parameters": {}
        }
      ]
    },
    "voice": {
      "provider": "11labs",
      "voiceId": "burt",
      "stability": 0.5,
      "similarityBoost": 0.5,
      "style": true,
      "useSpeakerBoost": true
    },
    "language": "en",
    "forwardingPhoneNumber": "<string>",
    "firstMessage": "<string>",
    "voicemailMessage": "<string>",
    "endCallMessage": "<string>",
    "interruptionsEnabled": true,
    "recordingEnabled": true,
    "endCallFunctionEnabled": true,
    "fillersEnabled": true,
    "clientMessages": [
      "function-call"
    ],
    "serverMessages": [
      "end-of-call-report"
    ],
    "silenceTimeoutSeconds": 305,
    "responseDelaySeconds": 5
  },
  "customerId": "<string>",
  "customer": {
    "number": "<string>",
    "name": "<string>"
  },
  "phoneNumberId": "<string>",
  "phoneNumber": {
    "twilioPhoneNumber": "<string>",
    "twilioAccountSid": "<string>",
    "twilioAuthToken": "<string>",
    "name": "<string>",
    "assistantId": "<string>"
  }
}'
{
  "type": "inboundPhoneCall",
  "status": "queued",
  "endedReason": "assistant-ended-call",
  "maxDurationSeconds": 1805,
  "id": "<string>",
  "orgId": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "startedAt": "2023-11-07T05:31:56Z",
  "endedAt": "2023-11-07T05:31:56Z",
  "cost": 123,
  "transcript": "<string>",
  "recordingUrl": "<string>",
  "stereoRecordingUrl": "<string>",
  "summary": "<string>",
  "messages": [
    {}
  ],
  "twilioCallSid": "<string>",
  "webCallUrl": "<string>",
  "assistantId": "<string>",
  "assistant": {
    "name": "<string>",
    "transcriber": {
      "provider": "deepgram",
      "model": "nova-2",
      "keywords": [
        "<string>"
      ]
    },
    "model": {
      "provider": "openai",
      "model": "gpt-4",
      "systemPrompt": "<string>",
      "temperature": 1,
      "functions": [
        {
          "name": "<string>",
          "async": true,
          "description": "<string>",
          "parameters": {}
        }
      ]
    },
    "voice": {
      "provider": "11labs",
      "voiceId": "burt",
      "stability": 0.5,
      "similarityBoost": 0.5,
      "style": true,
      "useSpeakerBoost": true
    },
    "language": "en",
    "forwardingPhoneNumber": "<string>",
    "firstMessage": "<string>",
    "voicemailMessage": "<string>",
    "endCallMessage": "<string>",
    "interruptionsEnabled": true,
    "recordingEnabled": true,
    "endCallFunctionEnabled": true,
    "fillersEnabled": true,
    "clientMessages": [
      "function-call"
    ],
    "serverMessages": [
      "end-of-call-report"
    ],
    "silenceTimeoutSeconds": 305,
    "responseDelaySeconds": 5
  },
  "customerId": "<string>",
  "customer": {
    "number": "<string>",
    "name": "<string>"
  },
  "phoneNumberId": "<string>",
  "phoneNumber": {
    "twilioPhoneNumber": "<string>",
    "twilioAccountSid": "<string>",
    "twilioAuthToken": "<string>",
    "name": "<string>",
    "assistantId": "<string>"
  }
}

Authorizations

Authorization
string
headerrequired

Retrieve your key from Dashboard.

Body

application/json
maxDurationSeconds
number

This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.

assistantId
string

This is the assistant that will be used for the call. To use a transient assistant, use assistant instead.

assistant
object

This is the assistant that will be used for the call. To use an existing assistant, use assistantId instead.

customerId
string

This is the customer that will be called. To call a transient customer , use customer instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

customer
object

This is the customer that will be called. To call an existing customer, use customerId instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

phoneNumberId
string

This is the phone number that will be used for the call. To use a transient number, use phoneNumber instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

phoneNumber
object

This is the phone number that will be used for the call. To use an existing number, use phoneNumberId instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

Response

201 - application/json
type
enum<string>

This is the type of call.

Available options:
inboundPhoneCall,
outboundPhoneCall,
webCall
status
enum<string>

This is the status of the call.

Available options:
queued,
ringing,
in-progress,
forwarding,
ended
endedReason
enum<string>

This is the explanation for how the call ended.

Available options:
assistant-ended-call,
assistant-error,
assistant-forwarded-call,
assistant-join-timed-out,
assistant-not-found,
customer-busy,
customer-ended-call,
customer-did-not-answer,
db-error,
exceeded-max-duration,
manually-canceled,
no-server-available,
pipeline-error-custom-llm-response-was-invalid,
pipeline-error-custom-llm-request-failed,
pipeline-error-extra-function-failed,
pipeline-error-first-message-failed,
pipeline-error-function-filler-failed,
pipeline-error-function-failed,
pipeline-error-llm-failed,
pipeline-error-openai-voice-failed,
pipeline-error-deepgram-transcriber-failed,
pipeline-error-deepgram-voice-failed,
pipeline-error-eleven-labs-voice-failed,
pipeline-error-eleven-labs-voice-not-found,
pipeline-error-eleven-labs-quota-exceeded,
pipeline-error-playht-voice-failed,
pipeline-error-rime-ai-voice-failed,
server-shutdown,
silence-timed-out,
twilio-failed-to-connect-call,
twilio-closed-websocket,
unknown-error,
voicemail
maxDurationSeconds
number

This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.

id
string
required

This is the unique identifier for the call.

orgId
string
required

This is the unique identifier for the org that this call belongs to.

createdAt
string
required

This is the ISO 8601 date-time string of when the call was created.

updatedAt
string
required

This is the ISO 8601 date-time string of when the call was last updated.

startedAt
string

This is the ISO 8601 date-time string of when the call was started.

endedAt
string

This is the ISO 8601 date-time string of when the call was ended.

cost
number

This is the cost of the call in USD.

transcript
string

This is the transcript of the call.

recordingUrl
string

This is the URL of the recording of the call.

stereoRecordingUrl
string

This is the URL of the recording of the call in two channels.

summary
string

This is the summary of the call.

messages
object[]

These are the messages that were spoken during the call.

twilioCallSid
string

This is the callSid of the phone call.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

webCallUrl
string

This is the URL of the call that the assistant will join.

Only relevant for webCall type.

assistantId
string

This is the assistant that will be used for the call. To use a transient assistant, use assistant instead.

assistant
object

This is the assistant that will be used for the call. To use an existing assistant, use assistantId instead.

customerId
string

This is the customer that will be called. To call a transient customer , use customer instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

customer
object

This is the customer that will be called. To call an existing customer, use customerId instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

phoneNumberId
string

This is the phone number that will be used for the call. To use a transient number, use phoneNumber instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.

phoneNumber
object

This is the phone number that will be used for the call. To use an existing number, use phoneNumberId instead.

Only relevant for outboundPhoneCall and inboundPhoneCall type.