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/jsonorapplication/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 Name | Type | Description | Required |
|---|---|---|---|
startTime | string | The 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 |
endTime | string | The 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 |
enqueueTime | string | The date and time (in UTC) when the voice call was placed in the queue. | No |
acceptTime | string | The date and time (in UTC) when the rep accepted the voice call. | No |
fromNumber | string | The number from which the voice call was made. For example, for an inbound call, this value is the end user’s phone number. | No |
totalHoldDuration | int32 | The 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 |
longestHoldDuration | int32 | Within the entire call, the longest length of time (in seconds) the rep put the voice call on hold. | No |
numberOfHolds | int32 | The 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 |
queue | string | The name of the queue that the rep who serviced the voice call belonged to. | No |
agent | string | The rep’s username. | No |
agentInteractionDuration | int32 | The 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 |
callOrigin | string | Information about how this call originated. Possible values are:
| No |
recordingLocation | string | The 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 |
totalRecordingDuration | int32 | The 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. | |
callAttributes | string | Use 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:
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 |
isActiveCall | boolean | Indicates 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 |
disconnectReason | string | The 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