Create Voice Call Context

Allocates a server-minted contextID handle for a voice call transfer to Agentforce Voice.

Use this API to obtain a contextID handle before performing a SIP-address transfer of the PSTN call to Salesforce. The partner telephony system calls this API to reserve the context, then places the returned contextID in a SIP X-header on the outbound SIP-address transfer leg. Salesforce’s SIP relay looks up the stored call context by this contextID at ringing time and hands the call off to Agentforce Voice with the correct session context. The returned contextID is valid for a limited time and can’t be supplied by the client—the value is always server-minted. This API is available only to organizations provisioned for Agentforce Voice with the contextID transfer mode enabled.

https://{MyDomain}.my.salesforce-scrt.com/telephony/v1/voiceCalls/createVoiceCallContext

Where {MyDomain} is a value configured as part of Salesforce setup.

POST

Authorization: Bearer <token>

String. Standard header. The authorization token, where <token> is the JSON Web Token (JWT). Required.

Content-Type: <format>

String. Standard header. The format of the request body. Valid formats include JSON and XML. For example, application/json or application/xml. Required.

Telephony-Provider-Name: <telephony provider name>

String. Custom header. The name of the telephony provider that calls this API. For example, Amazon Connect.

The request body is CreateVoiceCallContextRequest.

Property NameTypeDescriptionRequired
fromNumberstringThe caller’s phone number in E.164 format. For example, +14155551234. This number is used for validation during call lookup.Yes
countryCodestringISO 3166-1 alpha-2 country code of the destination. For example, US.Yes
contextobjectThe voice-call context (VoiceCallContext) associated with this reservation. See context (VoiceCallContext).Yes
Property NameTypeDescriptionRequired
scrt2DomainstringThe SCRT2 domain URL for the Salesforce organization. For example, https://example.my.salesforce-scrt.com.Yes
toNumberstringThe virtual phone number in E.164 format that you configure in Salesforce.Yes
callIdstringThe ID of the initial voice call record (VC1) that’s created when the inbound call to the partner contact center. If omitted, context chaining with the parent voice call doesn’t happen.No
partnerCallIdstringVendor call key or UUID for the originating call leg. Reserved for phase 2.No
transactionIdstringA UUID that uniquely identifies this createVoiceCallContext request. If provided, Salesforce uses this value to support idempotent retry behavior. If the partner contact center retries the request due to a timeout or transient error, passing the same transactionId ensures that a duplicate contextID lease isn’t created.No

The contextID can’t be supplied by the client. The server always mints a new UUIDv4 and returns it in the response.

The response body is CreateVoiceCallContextResponse.

Property NameTypeDescription
statusstringOutcome of the context reservation. One of success or failure.
modestringMode of the reserved handle. Always contextID for this endpoint.
handleobjectThe reserved handle (VoiceCallContextHandle). See handle (VoiceCallContextHandle).
Property NameTypeDescription
contextIDstringServer-minted UUIDv4 context identifier. Place this value in the SIP X-header on the SIP-address transfer leg.
expiresAtstringISO-8601 timestamp at which the lease expires.

Request:

Response: