curl --request GET \
--url https://api.cozmox.ai/phone-number/{id} \
--header 'Authorization: Bearer <token>'{
"provider": "byo-phone-number",
"id": "<string>",
"orgId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"credentialId": "<string>",
"fallbackDestination": {
"type": "number",
"number": "<string>",
"message": "<string>",
"numberE164CheckEnabled": true,
"extension": "<string>",
"callerId": "<string>",
"transferPlan": {
"mode": "blind-transfer",
"message": "<string>",
"timeout": 60,
"sipVerb": "refer",
"holdAudioUrl": "<string>",
"transferCompleteAudioUrl": "<string>",
"twiml": "<string>",
"summaryPlan": {
"messages": [
{}
],
"enabled": true,
"timeoutSeconds": 30.5
},
"sipHeadersInReferToEnabled": true,
"fallbackPlan": {
"message": "<string>",
"endCallEnabled": true
}
},
"description": "<string>"
},
"hooks": [
{
"on": "call.ringing",
"do": [
{
"type": "transfer",
"destination": {
"type": "number",
"number": "<string>",
"message": "<string>",
"numberE164CheckEnabled": true,
"extension": "<string>",
"callerId": "<string>",
"transferPlan": {
"mode": "blind-transfer",
"message": "<string>",
"timeout": 60,
"sipVerb": "refer",
"holdAudioUrl": "<string>",
"transferCompleteAudioUrl": "<string>",
"twiml": "<string>",
"summaryPlan": {
"messages": [
{}
],
"enabled": true,
"timeoutSeconds": 30.5
},
"sipHeadersInReferToEnabled": true,
"fallbackPlan": {
"message": "<string>",
"endCallEnabled": true
}
},
"description": "<string>"
}
}
]
}
],
"numberE164CheckEnabled": true,
"status": "active",
"name": "<string>",
"assistantId": "<string>",
"workflowId": "<string>",
"squadId": "<string>",
"server": {
"timeoutSeconds": 20,
"url": "<string>",
"headers": {},
"backoffPlan": {
"type": "fixed",
"maxRetries": 0,
"baseDelaySeconds": 1
}
},
"number": "<string>"
}curl --request GET \
--url https://api.cozmox.ai/phone-number/{id} \
--header 'Authorization: Bearer <token>'{
"provider": "byo-phone-number",
"id": "<string>",
"orgId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"credentialId": "<string>",
"fallbackDestination": {
"type": "number",
"number": "<string>",
"message": "<string>",
"numberE164CheckEnabled": true,
"extension": "<string>",
"callerId": "<string>",
"transferPlan": {
"mode": "blind-transfer",
"message": "<string>",
"timeout": 60,
"sipVerb": "refer",
"holdAudioUrl": "<string>",
"transferCompleteAudioUrl": "<string>",
"twiml": "<string>",
"summaryPlan": {
"messages": [
{}
],
"enabled": true,
"timeoutSeconds": 30.5
},
"sipHeadersInReferToEnabled": true,
"fallbackPlan": {
"message": "<string>",
"endCallEnabled": true
}
},
"description": "<string>"
},
"hooks": [
{
"on": "call.ringing",
"do": [
{
"type": "transfer",
"destination": {
"type": "number",
"number": "<string>",
"message": "<string>",
"numberE164CheckEnabled": true,
"extension": "<string>",
"callerId": "<string>",
"transferPlan": {
"mode": "blind-transfer",
"message": "<string>",
"timeout": 60,
"sipVerb": "refer",
"holdAudioUrl": "<string>",
"transferCompleteAudioUrl": "<string>",
"twiml": "<string>",
"summaryPlan": {
"messages": [
{}
],
"enabled": true,
"timeoutSeconds": 30.5
},
"sipHeadersInReferToEnabled": true,
"fallbackPlan": {
"message": "<string>",
"endCallEnabled": true
}
},
"description": "<string>"
}
}
]
}
],
"numberE164CheckEnabled": true,
"status": "active",
"name": "<string>",
"assistantId": "<string>",
"workflowId": "<string>",
"squadId": "<string>",
"server": {
"timeoutSeconds": 20,
"url": "<string>",
"headers": {},
"backoffPlan": {
"type": "fixed",
"maxRetries": 0,
"baseDelaySeconds": 1
}
},
"number": "<string>"
}This is to bring your own phone numbers from your own SIP trunks or Carriers.
byo-phone-number This is the unique identifier for the phone number.
This is the unique identifier for the org that this phone number belongs to.
This is the ISO 8601 date-time string of when the phone number was created.
This is the ISO 8601 date-time string of when the phone number was last updated.
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.
You can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId.
This is the fallback destination an inbound call will be transferred to if:
assistantId is not setsquadId is not setassistant-request message to the serverUrl failsIf this is not set and above conditions are met, the inbound call is hung up with an error message.
Show child attributes
number This is the phone number to transfer the call to.
3 - 40This is spoken to the customer before connecting them to the destination.
Usage:
assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.
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.
Use cases:
false: To allow non-E164 numbers like +001234567890, 1234, or abc. This is useful for dialing out to non-E164 numbers on your SIP trunks.true (default): To allow only E164 numbers like +14155551234. This is standard for PSTN calls.If false, the number is still required to only contain alphanumeric characters (regex: /^\+?[a-zA-Z0-9]+$/).
@default true (E164 check is enabled)
This is the extension to dial after transferring the call to the number.
1 - 10This is the caller ID to use when transferring the call to the number.
Usage:
callerId.For Twilio, you can read up more here: https://www.twilio.com/docs/voice/twiml/dial#callerid
40This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to blind-transfer.
@default transferPlan.mode='blind-transfer'
Show child attributes
This configures how transfer is executed and the experience of the destination party receiving the call.
Usage:
blind-transfer: The assistant forwards the call to the destination without any message or summary.blind-transfer-add-summary-to-sip-header: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.warm-transfer-say-message: The assistant dials the destination, delivers the message to the destination party, connects the customer, and leaves the call.warm-transfer-say-summary: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call.warm-transfer-wait-for-operator-to-speak-first-and-then-say-message: The assistant dials the destination, waits for the operator to speak, delivers the message to the destination party, and then connects the customer.warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer.warm-transfer-twiml: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call.warm-transfer-experimental: The assistant puts the customer on hold, dials the destination, and if the destination answers (and is human), delivers a message or summary before connecting the customer. If the destination is unreachable or not human (e.g., with voicemail detection), the assistant delivers the fallbackMessage to the customer and optionally ends the call.@default 'blind-transfer'
blind-transfer, blind-transfer-add-summary-to-sip-header, warm-transfer-say-message, warm-transfer-say-summary, warm-transfer-twiml, warm-transfer-wait-for-operator-to-speak-first-and-then-say-message, warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary, warm-transfer-experimental This is the message the assistant will deliver to the destination party before connecting the customer.
Usage:
mode is blind-transfer-add-summary-to-sip-header, warm-transfer-say-message, warm-transfer-wait-for-operator-to-speak-first-and-then-say-message, or warm-transfer-experimental.This is the timeout in seconds for the warm-transfer-wait-for-operator-to-speak-first-and-then-say-message/summary
@default 60
1 <= x <= 600This specifies the SIP verb to use while transferring the call.
This is the URL to an audio file played while the customer is on hold during transfer.
Usage:
mode is warm-transfer-experimental.This is the URL to an audio file played after the warm transfer message or summary is delivered to the destination party. It can be used to play a custom sound like 'beep' to notify that the transfer is complete.
Usage:
mode is warm-transfer-experimental.This is the TwiML instructions to execute on the destination call leg before connecting the customer.
Usage:
mode is warm-transfer-twiml.Play, Say, Gather, Hangup and Pause verbs.Example:
<Say voice="alice" language="en-US">Hello, transferring a customer to you.</Say>
<Pause length="2"/>
<Say>They called about billing questions.</Say>4096This is the plan for generating a summary of the call to present to the destination party.
Usage:
mode is blind-transfer-add-summary-to-sip-header or warm-transfer-say-summary or warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary or warm-transfer-experimental.Show child attributes
These are the messages used to generate the summary.
@default: [ { "role": "system", "content": "You are an expert note-taker. You will be given a transcript of a call. Summarize the call in 2-3 sentences. DO NOT return anything except the summary." }, { "role": "user", "content": "Here is the transcript:\n\n{{transcript}}\n\n. Here is the ended reason of the call:\n\n{{endedReason}}\n\n" } ]
You can customize by providing any messages you want.
Here are the template variables available:
call.artifact.transcriptassistant.model.messages[type=system].contentcall.endedReasonThis determines whether a summary is generated and stored in call.analysis.summary. Defaults to true.
Usage:
@default true
This is how long the request is tried before giving up. When request times out, call.analysis.summary will be empty.
Usage:
@default 5 seconds
1 <= x <= 60This flag includes the sipHeaders from above in the refer to sip uri as url encoded query params.
@default false
This configures the fallback plan when the transfer fails (destination unreachable, busy, or not human).
Usage:
mode is warm-transfer-experimental.warm-transfer-experimental, a default message will be used.Show child attributes
This is the message the assistant will deliver to the customer if the transfer fails.
This controls what happens after delivering the failure message to the customer.
@default true
This is the description of the destination, used by the AI to choose when and how to transfer the call.
This is the hooks that will be used for incoming calls to this phone number.
Show child attributes
This is the event to trigger the hook on
call.ringing 1000This is the set of actions to perform when the hook triggers
Show child attributes
This is the type of action - must be "transfer"
transfer This is the destination details for the transfer - can be a phone number or SIP URI
Show child attributes
number This is the phone number to transfer the call to.
3 - 40This is spoken to the customer before connecting them to the destination.
Usage:
assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message for the destination assistant.This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the contents field.
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.
Use cases:
false: To allow non-E164 numbers like +001234567890, 1234, or abc. This is useful for dialing out to non-E164 numbers on your SIP trunks.true (default): To allow only E164 numbers like +14155551234. This is standard for PSTN calls.If false, the number is still required to only contain alphanumeric characters (regex: /^\+?[a-zA-Z0-9]+$/).
@default true (E164 check is enabled)
This is the extension to dial after transferring the call to the number.
1 - 10This is the caller ID to use when transferring the call to the number.
Usage:
callerId.For Twilio, you can read up more here: https://www.twilio.com/docs/voice/twiml/dial#callerid
40This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to blind-transfer.
@default transferPlan.mode='blind-transfer'
Show child attributes
This configures how transfer is executed and the experience of the destination party receiving the call.
Usage:
blind-transfer: The assistant forwards the call to the destination without any message or summary.blind-transfer-add-summary-to-sip-header: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.warm-transfer-say-message: The assistant dials the destination, delivers the message to the destination party, connects the customer, and leaves the call.warm-transfer-say-summary: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call.warm-transfer-wait-for-operator-to-speak-first-and-then-say-message: The assistant dials the destination, waits for the operator to speak, delivers the message to the destination party, and then connects the customer.warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer.warm-transfer-twiml: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call.warm-transfer-experimental: The assistant puts the customer on hold, dials the destination, and if the destination answers (and is human), delivers a message or summary before connecting the customer. If the destination is unreachable or not human (e.g., with voicemail detection), the assistant delivers the fallbackMessage to the customer and optionally ends the call.@default 'blind-transfer'
blind-transfer, blind-transfer-add-summary-to-sip-header, warm-transfer-say-message, warm-transfer-say-summary, warm-transfer-twiml, warm-transfer-wait-for-operator-to-speak-first-and-then-say-message, warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary, warm-transfer-experimental This is the message the assistant will deliver to the destination party before connecting the customer.
Usage:
mode is blind-transfer-add-summary-to-sip-header, warm-transfer-say-message, warm-transfer-wait-for-operator-to-speak-first-and-then-say-message, or warm-transfer-experimental.This is the timeout in seconds for the warm-transfer-wait-for-operator-to-speak-first-and-then-say-message/summary
@default 60
1 <= x <= 600This specifies the SIP verb to use while transferring the call.
This is the URL to an audio file played while the customer is on hold during transfer.
Usage:
mode is warm-transfer-experimental.This is the URL to an audio file played after the warm transfer message or summary is delivered to the destination party. It can be used to play a custom sound like 'beep' to notify that the transfer is complete.
Usage:
mode is warm-transfer-experimental.This is the TwiML instructions to execute on the destination call leg before connecting the customer.
Usage:
mode is warm-transfer-twiml.Play, Say, Gather, Hangup and Pause verbs.Example:
<Say voice="alice" language="en-US">Hello, transferring a customer to you.</Say>
<Pause length="2"/>
<Say>They called about billing questions.</Say>4096This is the plan for generating a summary of the call to present to the destination party.
Usage:
mode is blind-transfer-add-summary-to-sip-header or warm-transfer-say-summary or warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary or warm-transfer-experimental.Show child attributes
These are the messages used to generate the summary.
@default: [ { "role": "system", "content": "You are an expert note-taker. You will be given a transcript of a call. Summarize the call in 2-3 sentences. DO NOT return anything except the summary." }, { "role": "user", "content": "Here is the transcript:\n\n{{transcript}}\n\n. Here is the ended reason of the call:\n\n{{endedReason}}\n\n" } ]
You can customize by providing any messages you want.
Here are the template variables available:
call.artifact.transcriptassistant.model.messages[type=system].contentcall.endedReasonThis determines whether a summary is generated and stored in call.analysis.summary. Defaults to true.
Usage:
@default true
This is how long the request is tried before giving up. When request times out, call.analysis.summary will be empty.
Usage:
@default 5 seconds
1 <= x <= 60This flag includes the sipHeaders from above in the refer to sip uri as url encoded query params.
@default false
This configures the fallback plan when the transfer fails (destination unreachable, busy, or not human).
Usage:
mode is warm-transfer-experimental.warm-transfer-experimental, a default message will be used.Show child attributes
This is the message the assistant will deliver to the customer if the transfer fails.
This controls what happens after delivering the failure message to the customer.
@default true
This is the description of the destination, used by the AI to choose when and how to transfer the call.
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.
Use cases:
false: To allow non-E164 numbers like +001234567890, 1234, or abc. This is useful for dialing out to non-E164 numbers on your SIP trunks.true (default): To allow only E164 numbers like +14155551234. This is standard for PSTN calls.If false, the number is still required to only contain alphanumeric characters (regex: /^\+?[a-zA-Z0-9]+$/).
@default true (E164 check is enabled)
This is the status of the phone number.
active, activating, blocked This is the name of the phone number. This is just for your own reference.
40This is the assistant that will be used for incoming calls to this phone number.
If 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 expected.
This is the workflow that will be used for incoming calls to this phone number.
If 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 expected.
This is the squad that will be used for incoming calls to this phone number.
If 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 expected.
This is where cozmox will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.
The order of precedence is:
Show child attributes
This is the timeout in seconds for the request. Defaults to 20 seconds.
@default 20
1 <= x <= 30020
This is where the request will be sent.
These are the headers to include in the request.
Each key-value pair represents a header name and its value.
This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).
@default undefined (the request will not be retried)
Show child attributes
This is the type of backoff plan to use. Defaults to fixed.
@default fixed
"fixed"
This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries).
@default 0
0 <= x <= 100
This is the base delay in seconds. For linear backoff, this is the delay between each retry. For exponential backoff, this is the initial delay.
0 <= x <= 101
This is the number of the customer.
3 - 40