{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://api-evangelist.com/schemas/vapi/vapi-phone-number-schema.json", "title": "Vapi ByoPhoneNumber", "description": "JSON Schema for the Vapi ByoPhoneNumber resource as returned by the Vapi API.", "type": "object", "properties": { "fallbackDestination": { "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", "oneOf": [ { "type": "object", "properties": { "message": { "description": "This is spoken to the customer before connecting them to the destination.\n\nUsage:\n- If this is not provided and transfer tool messages is not provided, default is \"Transferring the call now\".\n- If set to \"\", nothing is spoken. This is useful when you want to silently transfer. This is especially use" }, "type": { "type": "string", "enum": [ "number" ] }, "numberE164CheckEnabled": { "type": "boolean", "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on yo" }, "number": { "type": "string", "description": "This is the phone number to transfer the call to." }, "extension": { "type": "string", "description": "This is the extension to dial after transferring the call to the `number`." }, "callerId": { "type": "string", "description": "This is the caller ID to use when transferring the call to the `number`.\n\nUsage:\n- If not provided, the caller ID will be the number the call is coming **from**.\n Example: a customer with number +14151111111 calls in to and the assistant transfers out to +16470000000. +16470000000 will see +1415111" }, "transferPlan": { "description": "This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to `blind-transfer`.\n\n@default `transferPlan.mode='blind-transfer'`" }, "description": { "type": "string", "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." } }, "required": [ "type", "number" ] }, { "type": "object", "properties": { "message": { "description": "This is spoken to the customer before connecting them to the destination.\n\nUsage:\n- If this is not provided and transfer tool messages is not provided, default is \"Transferring the call now\".\n- If set to \"\", nothing is spoken. This is useful when you want to silently transfer. This is especially use" }, "type": { "type": "string", "enum": [ "sip" ] }, "sipUri": { "type": "string", "description": "This is the SIP URI to transfer the call to." }, "callerId": { "type": "string", "description": "This is the caller ID to use when transferring the call to the `sipUri`.\n\nUsage:\n- If not provided, the caller ID will be determined by the SIP infrastructure.\n- Set to '{{customer.number}}' to always use the customer's number as the caller ID.\n- Set to '{{phoneNumber.number}}' to always use the pho" }, "transferPlan": { "description": "This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to `blind-transfer`.\n\n@default `transferPlan.mode='blind-transfer'`" }, "sipHeaders": { "type": "object", "description": "These are custom headers to be added to SIP refer during transfer call." }, "description": { "type": "string", "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." } }, "required": [ "type", "sipUri" ] } ] }, "hooks": { "type": "array", "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": {} }, "provider": { "type": "string", "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", "enum": [ "byo-phone-number" ] }, "numberE164CheckEnabled": { "type": "boolean", "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on yo" }, "id": { "type": "string", "description": "This is the unique identifier for the phone number." }, "orgId": { "type": "string", "description": "This is the unique identifier for the org that this phone number belongs to." }, "createdAt": { "type": "string", "description": "This is the ISO 8601 date-time string of when the phone number was created.", "format": "date-time" }, "updatedAt": { "type": "string", "description": "This is the ISO 8601 date-time string of when the phone number was last updated.", "format": "date-time" }, "status": { "type": "string", "description": "This is the status of the phone number.", "enum": [ "active", "activating", "blocked" ] }, "name": { "type": "string", "description": "This is the name of the phone number. This is just for your own reference." }, "assistantId": { "type": "string", "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expe" }, "workflowId": { "type": "string", "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expe" }, "squadId": { "type": "string", "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expecte" }, "server": { "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { "type": "object", "properties": { "timeoutSeconds": { "type": "number", "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20" }, "credentialId": { "type": "string", "description": "The credential ID for server authentication" }, "staticIpAddressesEnabled": { "type": "boolean", "description": "If enabled, requests will originate from a static set of IPs owned and managed by Vapi.\n\n@default false" }, "encryptedPaths": { "type": "array", "description": "This is the paths to encrypt in the request body if credentialId and encryptionPlan are defined.", "items": { "type": "object" } }, "url": { "type": "string", "description": "This is where the request will be sent." }, "headers": { "type": "object", "description": "These are the headers to include in the request.\n\nEach key-value pair represents a header name and its value.\n\nNote: Specifying an Authorization header here will override the authorization provided by the `credentialId` (if provided). This is an anti-pattern and should be avoided outside of edge cas" }, "backoffPlan": { "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)" } } } ] }, "number": { "type": "string", "description": "This is the number of the customer." }, "credentialId": { "type": "string", "description": "This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number.\n\nYou can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId." } }, "required": [ "provider", "id", "orgId", "createdAt", "updatedAt", "credentialId" ] }