Update a Voice Call Record

Updates a voice call (VoiceCall) record.

Use this API to update the parameters of a voice call record. The endpoint is an asynchronous operation. You can’t query for the status of the API call. This endpoint can also be used to create a voice call even after the call has ended. This behavior is useful in scenarios where you want to log a record in Salesforce for abandoned or missed calls, or for any other scenario where a voice call wasn’t already created.

Don’t run this API call more than one time. If you run this API call more than one time, each subsequent API call overwrites the following properties with the latest values: totalHoldDuration, numberOfHolds, and agentInteractionDuration.

This API call functions by making two separate database updates. The first database update passes the parameters recordingLocation and totalRecordingDuration, which are used to create a corresponding VoiceCallRecording record. The second database update passes all the other parameters. If you’re using the Update a Voice Call Record API call as an Apex trigger, the trigger is invoked only by the second database update.

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

Where {MyDomain} is a value configured as part of Salesforce Voice setup and {CALL ID} is the Salesforce voice call ID (voiceCallId) or the telephony vendor’s contact ID.

PATCH

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.

Property NameTypeDescriptionRequired
startTimestringThe date and time (in UTC) when the voice call started.
The VoiceCall.CallDurationInSeconds value is only updated if both startTime and endTime are passed.
No
endTimestringThe date and time (in UTC) when the voice call ended.
The VoiceCall.CallDurationInSeconds value is only updated if both startTime and endTime are passed.
No
enqueueTimestringThe date and time (in UTC) when the voice call was placed in the queue.No
acceptTimestringThe date and time (in UTC) when the rep accepted the voice call.No
fromNumberstringThe number from which the voice call was made. For example, for an inbound call, this value is the end user’s phone number.No
totalHoldDurationint32The total length of time (in seconds) the rep put the voice call on hold. Salesforce sets this value to zero (0) if no value is passed.
If you set this value, you must also set the recording location (recordingLocation). If you run this API call more than one time after the voice call, each subsequent API call overwrites the totatlHoldDuration property with the latest value.
No
longestHoldDurationint32Within the entire call, the longest length of time (in seconds) the rep put the voice call on hold.No
numberOfHoldsint32The total number of holds within the entire call. Salesforce sets this value to zero (0) if no value is passed. If you run this API call more than one time after the voice call, each subsequent API call overwrites the numberOfHolds property with the latest value.No
queuestringThe name of the queue that the rep who serviced the voice call belonged to.No
agentstringThe rep’s username.No
agentInteractionDurationint32The total length of time (in seconds) of the rep interaction. Salesforce sets this value to zero (0) if no value is passed. If you set this value, you must also set the recording location (recordingLocation).
If you run this API call more than one time after the voice call, each subsequent API call overwrites the agentInteractionDuration property with the latest value.
No
callOriginstringInformation about how this call originated.
Possible values are:
  • Preview. Represents a preview dialer.
  • Progressive. Represents a progressive dialer.
  • Voicemail. Represents a voicemail call.
No
recordingLocationstringThe location of the voice call recording if call recording was enabled.
NOTE: This field is required when updating any fields related to a recording.
No
totalRecordingDurationint32The total length of time (in seconds) of the voice call recording. If a value isn’t passed, this value defaults to the sum of agentInteractionDuration + totalHoldDuration. 
callAttributesstringUse this property to pass additional fields for the voice call record. The value is a JSON string of key-value pairs. Custom fields ending in __c are accepted without restriction. These standard fields are also accepted:
  • SourceType
  • ToPhoneNumber
  • CallOrigin
  • RecordTypeId

Other standard fields can’t be set through this property.
Note: Fields that aren’t recognized are excluded from the update without returning an error.
No
isActiveCallbooleanIndicates whether the conversation is still open and active (true). The default value is false.
If set to true, the voice call conversation is still open, and any real-time transcription messages sent through the POST /telephony/v1/voiceCalls/{vendorCallKey}/messages API will continue to be accepted. Any pending service routing records associated with the voice call remain pending. VoiceCall.CallDisposition remains “in-progress.”
If set to false, the voice call conversation is closed if VoiceCall.NextCallId is NULL. Any pending service routing records associated with the voice call are cleared. VoiceCall.CallDisposition is set to “completed,” and the VoiceCall.CustomerHoldDuration and VoiceCall.NumberOfHolds values are reset to zero (0).
No
disconnectReasonstringThe reason why the voice call was disconnected. If the parameter is passed in with the payload, the value and isError attributes are required, where value is the message stating how the call was disconnected, and isError is set to true.
For example, see disconnectReason.
If a customer drops a call after accepting the callback offer, set the disconnectReason field to CALLBACK. Otherwise, the initial call can be incorrectly classified as abandoned.
For Amazon Connect instances, see DisconnectReason in the Amazon Connect contact records data model page for a list of possible reasons why a voice call may be disconnected.
No

Request:

Response:

See Also