---
sourceDocument: Zurich API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/api-reference

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Voice Interaction Resource API

# Voice Interaction Resource API {#ariaid-title1}

* Release version: Zurich
* 
* Updated July 31, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 17 minutes to read

The Voice Interaction API provides endpoints to transcribe and store voice interactions between agents and callers during a telephone conversation. It works in conjunction with Virtual Agent and Live Agent chats.
You can use this API to persist transcribed messages from an on-going phone call in real-time
or to transcribe and store an existing voice conversation recording for historical purposes.
Transcribed messages appear in Agent Workspace, allowing agents to leverage
features such as agent assist and search, while talking to a caller. Transcribed messages
are persisted in the Conversation Message \[sys_cs_message\] table.

## Call flow

The following call flow shows how to use the Voice Interaction API to create a voice interaction record, transcribe and store the messages within that voice conversation, and then close the voice conversation record. You can also use business rules and other scripts to perform this functionality, however, this type of implementation is not covered in this section.

1. First, call the [Voice Interaction Resource - POST /cs/voice-interactions](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-POST-voice_inter "Creates a voice interaction record within the Interaction [interaction] table.") endpoint to create a voice interaction record in the Interaction \[interaction\] table.
2. Then call the [Voice Interaction Resource - POST /cs/voice-interactions/{interactionId}/messages](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-POST-voice_inter-messages "Adds the specified voice conversations messages to the specified voice transaction record. These messages are typically generated using third-party vendor software. Currently, only Amazon Connect is supported.") endpoint to store translated messages from the voice conversation into the Conversation Message table. If you are processing a real-time conversation, you should call this endpoint frequently, so that the messages appear in Agent Workspace in a timely manner. When processing a recording for historical purposes, you can pass all messages in a single endpoint call.
3. Once you are finished persisting the voice messages, call the [Voice Interaction Resource - PATCH /cs/voice-interactions/{interactionId}/state](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-PATCH-voice_inter-state "Terminates the specified voice interaction. Once called, no additional voice messages are translated and stored for the phone conversation.") endpoint to terminate the capture and close the voice interaction record.

## Availability

This API is available in the base ServiceNow system. Access is
restricted by the ACLs imposed on the Interaction \[interaction\] and Conversation
\[sys_cs_conversation\] tables.

## Voice Interaction Resource - PATCH /cs/voice-interactions/{interactionId}/state {#ariaid-title2}

Terminates the specified voice interaction. Once called, no additional voice messages
are translated and stored for the phone conversation.
<br />

### URL format

Versioned URL:
/api/now/{api_version}/cs/voice-interactions/{interactionId}/state

Default URL:
/api/now/v1/cs/voice-interactions/{interactionId}/state  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/sYu7wNPLliq5~U4ai0aL_g "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cspfk_WKHcwVeXgD~XuntQ "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#vir-PATCH-voice_inter-state__entry__2}{#vir-PATCH-voice_inter-state__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| interactionId | Sys_id of the interaction record whose voice interaction to terminate. Passed back by the [Voice Interaction Resource - POST /cs/voice-interactions](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-POST-voice_inter "Creates a voice interaction record within the Interaction [interaction] table.") endpoint. Data type: String Table: Interaction \[interaction\] |
[Table 1. Path parameters]

{#vir-PATCH-voice_inter-state__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 2. Query parameters]

{#vir-PATCH-voice_inter-state__entry__12}

| Name | Description |
|-|-|
| recordingURL | URL where the original voice recording is located. If configured to do so, this URL appears in Agent Workspace. Data type: String Default: None |
| state | Required. State of the voice interaction. Only supported value: closed_complete Data type: String |
[Table 3. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-PATCH-voice_inter-state__entry__18}{#vir-PATCH-voice_inter-state__accept-RESTAPI}{#vir-PATCH-voice_inter-state__content_type-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
[Table 4. Request headers]

{#vir-PATCH-voice_inter-state__entry__24}

| Header | Description |
|-|-|
| None |   |
[Table 5. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-PATCH-voice_inter-state__entry__28}{#vir-PATCH-voice_inter-state__entry-200-status-code}{#vir-PATCH-voice_inter-state__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. Badly formed JSON or required parameters were not passed. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
[Table 6. Status codes]

### Response body parameters (JSON or XML)

{#vir-PATCH-voice_inter-state__entry__36}

| Name | Description |
|-|-|
| result | Status of the operation. Possible values: * Success * Failed If an error is encountered, a message that describes the error is also returned. If the error is on the ServiceNow instance, the instance logs the associated stack trace. |
[ ]

### cURL request

The following example shows how to terminate a voice instance.

    curl "http://instance.servicenow.com/api/now/v1/ cs/voice-interactions/86837a386f0331003b3c498f5d3ee4ca/state" \ 
    --request PATCH \
    --header "Content-Type: application/json" \
    --header "Accept:application/json" \
    --user 'username':'password' \
    -d {
      "state": "closed_complete",
      "recordingURL": "https: //zoom_instance/rec/QbF7XmPFHPlX1LG"
    }'

Response:

    {
      "result": "Success"
    }

## Voice Interaction Resource - POST /cs/voice-interactions {#ariaid-title3}

Creates a voice interaction record within the Interaction \[interaction\]
table.
You must create this record before trying to save any transcribed voice messages. You can
also use this endpoint to assign a call to a specific agent by passing in their specific
user ID.

### URL format

Versioned URL:
/api/now/{api_version}/cs/voice-interactions

Default URL:
/api/now/v1/cs/voice-interactions  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/sYu7wNPLliq5~U4ai0aL_g "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cspfk_WKHcwVeXgD~XuntQ "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#vir-POST-voice_inter__entry__2}{#vir-POST-voice_inter__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 7. Path parameters]

{#vir-POST-voice_inter__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 8. Query parameters]

{#vir-POST-voice_inter__entry__10}

| Name | Description |
|-|-|
| agentId | Unique identifier of the agent to assign the voice interaction to. Data type: String Default: Invoke Virtual Agent |
| callerPhoneNumber | Caller's callback phone number. This is the number the agent uses to reach the caller in case the call drops. Data type: String Format: E.164 standard compliant Default: None |
| clientSessionId | Unique identifier of a record in an external system used to track this phone call across systems, enabling integration between ServiceNow and third-party platforms (for example, CCaaS providers). Data type: String Default: None |
| inboundId | Unique identifier of the application provider for the voice service. Data type: String Default: Pulled from chat |
| userId | Required. Phone number of the caller who made the call associated with the voice transaction. Data type: String Format: Defined by the software that created the voice conversation script. Typically E.164 standard compliant. |
[Table 9. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter__entry__22}{#vir-POST-voice_inter__accept-RESTAPI}{#vir-POST-voice_inter__content_type-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
[Table 10. Request headers]

{#vir-POST-voice_inter__entry__28}

| Header | Description |
|-|-|
| None |   |
[Table 11. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter__entry__32}{#vir-POST-voice_inter__entry-200-status-code}{#vir-POST-voice_inter__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. Badly formed JSON or required parameters were not passed. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
[Table 12. Status codes]

### Response body parameters (JSON or XML)

{#vir-POST-voice_inter__entry__40}

| Name | Description |
|-|-|
| interactionId | Sys_id of the newly created voice interaction record. Use this sys_id when: * Calling the [Voice Interaction Resource - POST /cs/voice-interactions/{interactionId}/messages](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-POST-voice_inter-messages "Adds the specified voice conversations messages to the specified voice transaction record. These messages are typically generated using third-party vendor software. Currently, only Amazon Connect is supported.") endpoint to add a message to the voice interaction. * Calling the [Voice Interaction Resource - PATCH /cs/voice-interactions/{interactionId}/state](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-PATCH-voice_inter-state "Terminates the specified voice interaction. Once called, no additional voice messages are translated and stored for the phone conversation.") endpoint to end the voice interaction. Data type: String Table: Interaction \[interaction\] |
[ ]

### cURL request

The following code example shows how to initiate a voice interaction and transfer the call
to a specific agent.

    curl "http://instance.servicenow.com/api/now/v1/cs/voice-interactions" \ 
    --request POST \ 
    --header "Accept:application/json" \ 
    --user 'username':'password' \ 
    --header "Content-Type: application/json"\ 
    -d '{ 
      "userId": "+14089178877",
      "agentId": "beth.anglin",
      "callerPhoneNumber": "+14089178878",
      "clientSessionId": "f8453abb-a33d-45b7-bf01-52b7a821e99z"
    }'

Response:

    {
      "result": {
        "interactionId": "4462cb4753751110b6e8ddeeff7b12ca"
      }
    }

## Voice Interaction Resource - POST
/cs/voice-interactions/{interactionId}/conversation {#ariaid-title4}

Creates a conversation record within the Conversation \[sys_cs_conversation\] table for
the specified interaction.
<br />

### URL format

Versioned URL:
/api/now/{api_version}/cs/voice-interactions/{interactionId}/conversation

Default URL:
/api/now/v1/cs/voice-interactions/{interactionId}/conversation  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/sYu7wNPLliq5~U4ai0aL_g "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cspfk_WKHcwVeXgD~XuntQ "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#vir-POST-voice_inter-conver__entry__2}{#vir-POST-voice_inter-conver__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| interactionId | Sys_id of the interaction record for which to create the conversation record. This value is returned by the [Voice Interaction Resource - POST /cs/voice-interactions](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-POST-voice_inter "Creates a voice interaction record within the Interaction [interaction] table.") endpoint and stored in the Interaction \[interaction\] table. Data type: String |
[Table 13. Path parameters]

{#vir-POST-voice_inter-conver__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 14. Query parameters]

{#vir-POST-voice_inter-conver__entry__12}

| Name | Description |
|-|-|
| agentId | Unique identifier of the agent to assign the voice interaction to. Data type: String Default: Invoke Virtual Agent |
| callerPhoneNumber | Caller's callback phone number. This is the number the agent uses to reach the caller in case the call drops. Data type: String Format: E.164 standard compliant Default: None |
| clientSessionId | Unique identifier of a record in an external system used to track this phone call across systems, enabling integration between ServiceNow and third-party platforms (for example, CCaaS providers). Data type: String Default: None |
| inboundId | Unique identifier of the application provider for the voice service. Data type: String Default: Pull from the chat |
| userId | Required. Phone number of the caller who made the call associated with the voice transaction. Data type: String Format: Defined by the software that created the voice conversation script. Typically E.164 standard compliant. |
[Table 15. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter-conver__entry__24}{#vir-POST-voice_inter-conver__accept-RESTAPI}{#vir-POST-voice_inter-conver__content_type-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
[Table 16. Request headers]

{#vir-POST-voice_inter-conver__entry__30}

| Header | Description |
|-|-|
| None |   |
[Table 17. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter-conver__entry__34}{#vir-POST-voice_inter-conver__entry-200-status-code}{#vir-POST-voice_inter-conver__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. Badly formed JSON or required parameters were not passed. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
[Table 18. Status codes]

### Response body parameters (JSON or XML)

{#vir-POST-voice_inter-conver__entry__42}

| Name | Description |
|-|-|
| conversationId | Sys_id of the newly created conversation record. Data type: String Table: Conversation \[sys_cs_conversation\] |
[ ]

### cURL request

The following code example shows how to call this endpoint.

    curl "http://instance.servicenow.com/api/now/v1/cs/voice-interactions/7662cb4721751ea0b6e8dda1b27b131f/conversation" \  
    --request POST \  
    --header "Accept:application/json" \  
    --user 'username':'password' \  
    --header "Content-Type: application/json"\  
    -d '{  
      "userId": "+14089178877", 
      "agentId": "admin@example.com", 
      "callerPhoneNumber": "+14089178878", 
      "clientSessionId": "f8453abb-a33d-45b7-bf01-52b7a821e99z" 
    }' 

Response:

    { 
      "result": "a47e1afdb7471110b6e8bc15ae11a934" 
    } 

## Voice Interaction Resource - POST /cs/voice-interactions/{interactionId}/messages {#ariaid-title5}

Adds the specified voice conversations messages to the specified voice transaction
record. These messages are typically generated using third-party vendor software. Currently,
only Amazon Connect is supported.
You can call this endpoint multiple times during real-time transcribing of the call or pass
all messages in a single call if you are transcribing the call for historical purposes. If
you are processing a real-time conversation, you should call this endpoint frequently, so
that the messages appear in Agent Workspace in a timely manner. Messages are
ordered based on their start and end times in relation to the start of the call.

### URL format

Versioned URL:
/api/now/{api_version}/cs/voice-interactions/{interactionId}/messages

Default URL:
/api/now/v1/cs/voice-interactions/{interactionId}/messages  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/sYu7wNPLliq5~U4ai0aL_g "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cspfk_WKHcwVeXgD~XuntQ "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#vir-POST-voice_inter-messages__entry__2}{#vir-POST-voice_inter-messages__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| interactionId | Sys_id of the interaction record to add the specified messages to. This value is returned by the [Voice Interaction Resource - POST /cs/voice-interactions](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-POST-voice_inter "Creates a voice interaction record within the Interaction [interaction] table.") endpoint and stored in the Interaction \[interaction\] table. Data type: String |
[Table 19. Path parameters]

{#vir-POST-voice_inter-messages__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 20. Query parameters]

{#vir-POST-voice_inter-messages__entry__12}

| Name | Description |
|-|-|
| \<json_string\> | List of messages to attach to the specified voice interaction. "<json_string>":[ { "attributes": [Array], "beginOffsetMillis": Long, "content": "String" "endOffsetMillis": Long, "id": "String", "isEvent": Boolean, "isInternalMessage": Boolean, "loudnessScore": "Number", "participantId": "String", "sentiment": "String" } ] |
| \<json_string\>.attributes | Key-value pairs to associate to the voice interaction. These can be any type of data object, from simple objects to complex compound objects. They are used as unique identifiers when invoking Amazon Web Services APIs. Data type: Array of Objects Default: None |
| \<json_string\>.beginOffsetMillis | Required. Time offset between the start of the voice interaction and the start of the associated message. For example: "beginOffsetMillis": 2650. Data type: Long Unit: Milliseconds |
| \<json_string\>.content | Required. Text of the message to add to the voice interaction. Data type: String |
| \<json_string\>.endOffsetMillis | Required. Time offset between the start of the voice interaction and the end of the message. For example: "endOffsetMillis": 9380. Data type: Long Unit: Milliseconds |
| \<json_string\>.id | Message UUID of the source of this voice conversation, such as for AmazonConnect. Sets the source message ID column value. Data type: String Default: None |
| \<json_string\>.isEvent | Set by Amazon Connect but not currently used by the method. Flag that indicates whether the associated message is an event. Valid values: * true: Message is an event. * false: Message is not an event. Data type: Boolean Default: false |
| \<json_string\>.isInternalMessage | Flag that indicates whether this is an internal message and shouldn't be shown to the caller. Transcriptions are typically considered internal messages and only appear for the agent and not to the caller. In addition, Agent Whisper is used when a silent third-party is chatting with or is brought into a phone conversation without the caller knowing and offers advice to an agent. The caller doesn't hear or see these messages, but the agent does. Valid values: * true: Internal message, don't display to the caller. * false: Not an internal message, display to caller. {#vir-POST-voice_inter-messages__ul_sdw_bf3_vvb} Data type: Boolean Default: false |
| \<json_string\>.loudnessScore | Measurement as to how loudly a customer or agent is speaking during a call. Contact Lens displays an analysis of the conversation that shows where they may be talking loudly and have a negative sentiment. Data type: Number Range: -1.0 (negative) to 1.0 (positive) Default: Null |
| \<json_string\>.participantId | Required. Participant associated with the message. Valid values: * AGENT * CUSTOMER Data type: String |
| \<json_string\>.sentiment | Sentiment of the message. This value is generated by a third-party provider. Based on the ServiceNow instance configuration settings, this value is then translated to be either positive, negative, or neutral and is stored in the conversation and interaction record. Valid values: * NEGATIVE * NEUTRAL * POSITIVE Data type: String Default: Null |
[Table 21. Request body parameters (Amazon Connect)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter-messages__entry__36}{#vir-POST-voice_inter-messages__accept-RESTAPI}{#vir-POST-voice_inter-messages__content_type-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
[Table 22. Request headers]

{#vir-POST-voice_inter-messages__entry__42}

| Header | Description |
|-|-|
| None |   |
[Table 23. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter-messages__entry__46}{#vir-POST-voice_inter-messages__entry-200-status-code}{#vir-POST-voice_inter-messages__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. Badly formed JSON or required parameters were not passed. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
[Table 24. Status codes]

### Response body parameters (JSON or XML)

{#vir-POST-voice_inter-messages__entry__54}

| Name | Description |
|-|-|
| result | Message that describes the results of the call. Data type: String |
| Conversation id | Sys_id of the voice interaction message record that was created. Data type: String Table: Voice Transcript Conversation Message \[sys_cs_message_voice_transcript\] |
[ ]

### cURL request

The following example shows how to add messages to an existing voice interaction
record.

    curl "http://instance.servicenow.com/api/now/v1/cs/voice-interactions/86837a386f0331003b3c498f5d3ee4ca/messages" \ 
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type: application/json"\ 
    --user 'username':'password' \
    -d ' [ 
      { 
        "isEvent": "false",  
        "isInternalMessage": "false",  
        "beginOffsetMillis": 10000,  
        "content": "This is John. How can I help you?",  
        "endOffsetMillis": 15000,  
        "id": "954c4edc-31a8-48b0-8f6e-7fa0c4ca00a8",  
        "participantId": "AGENT",  
        "sentiment": "NEUTRAL",  
        "loudnessScore": "null",  
        "attributes": [{  
          "key": "key1",  
          "value": "value1"  
          }, {  
          "key": "key2",  
          "value": "value2"  
        }] 
      },  
      {  
        "isEvent": "false",  
        "isInternalMessage": "false",  
        "beginOffsetMillis": 20000,  
        "content": "Uh, yes, John. Um, I'm a little very frustrated right now.",  
        "endOffsetMillis": 25000,  
        "id": "18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f",  
        "participantId": "CUSTOMER",  
        "sentiment": "NEGATIVE"  
      },  
      {  
        "isEvent": "false",  
        "isInternalMessage": "false",  
        "beginOffsetMillis": 30000,  
        "content": "I am sorry to hear that",  
        "endOffsetMillis": 35000,  
        "id": "18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f",  
        "participantId": "AGENT",  
        "sentiment": "NEGATIVE",  
     
      },  
      {  
        "isEvent":"false",
        "isInternalMessage":"false",
        "beginOffsetMillis":40000,
        "content":"Can you help me with my insurance? My ssn is 123-12-1234",
        "endOffsetMillis":45000,
        "id":"ab09b3b6-23fd-4e41-be05-6b2b53c19059",
        "participantId":"CUSTOMER",
        "sentiment":"NEUTRAL" 
      },  
      {  
        "isEvent":"False",
        "isInternalMessage":"False",
        "beginOffsetMillis":50000, 
        "content":"Of course, let me check your account",
        "endOffsetMillis":55000,
        "id":"18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f",
        "participantId":"AGENT",
        "sentiment":"NEUTRAL" 
      }  
    ]'

Response:

    { 
      "result": "Voice conversation transcript has been successfully saved. Conversation id: 8439d3c753b51110b6e8ddeeff7b12e2" 
    }

## Voice Interaction Resource - POST /cs/voice-interactions/transcript {#ariaid-title6}

Adds messages to an existing voice interaction after a call is completed. You can use
this API to attach transcribed messages of a voice call between an agent and caller.
<br />

### URL format

Versioned URL:
/api/now/{api_version}/cs/voice-interactions/{interactionId}/transcript

Default URL:
/api/now/v1/cs/voice-interactions/{interactionId}/transcript  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/sYu7wNPLliq5~U4ai0aL_g "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cspfk_WKHcwVeXgD~XuntQ "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#vir-POST-voice_inter-transcript__entry__2}{#vir-POST-voice_inter-transcript__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 25. Path parameters]

{#vir-POST-voice_inter-transcript__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 26. Query parameters]

{#vir-POST-voice_inter-transcript__entry__10}{#vir-POST-voice_inter-transcript__vto-interactionId-REST-entry}

| Name | Description |
|-|-|
| conversationStarted | Start time of the conversation. Data type: String Format: YYYY-MM-DD HH:MM:SS Table: Interaction \[interaction\] |
| interactionId | Sys_id of the interaction record to add the specified messages to. This value is returned by the [Voice Interaction Resource - POST /cs/voice-interactions](https://www.servicenow.com/docs/PA28YNA44BNaUIn8EUlSkw#vir-POST-voice_inter "Creates a voice interaction record within the Interaction [interaction] table.") endpoint. Data type: String Table: Interaction \[interaction\] |
| source | Name of the channel that originally created the conversation interaction transcript. Currently, the only supported value is `Amazon Connect`. Data type: String |
| transcript | List of messages to attach to the specified voice interaction. "transcript":[ { "attributes": [Array], "beginOffsetMillis": Long, "content": "String" "endOffsetMillis": Long, "id": "String", "isEvent": Boolean, "isInternalMessage": Boolean, "loudnessScore": "String", "participantId": "String", "sentiment": "String" } ] Data type: Array of Objects |
| transcript.attributes | Key-value pairs to associate to the voice interaction. These can be any type of data object, from simple objects to complex compound objects. They are used as unique identifiers when invoking Amazon Web Services APIs. Data type: Array of Objects Default: None |
| transcript.beginOffsetMillis | Required. Time offset between the start of the voice interaction and the start of the associated message. For example: "beginOffsetMillis": 2650. Data type: Long Unit: Milliseconds |
| transcript.content | Required. Text of the message to add to the voice interaction. Data type: String |
| transcript.endOffsetMillis | Required. Time offset between the start of the voice interaction and the end of the message. For example: "endOffsetMillis": 9380. Data type: Long Unit: Milliseconds |
| transcript.id | Message UUID of the source of this voice conversation, such as for AmazonConnect. Sets the source message ID column value. Data type: String Default: None |
| transcript.isEvent | Set by Amazon Connect but not currently used by the method. Flag that indicates whether the associated message is an event. Valid values: * true: Message is an event. * false: Message is not an event. Data type: Boolean Default: false |
| transcript.isInternalMessage | Flag that indicates whether this is an internal message and shouldn't be shown to the caller. Transcriptions are typically considered internal messages and only appear for the agent and not to the caller. In addition, Agent Whisper is used when a silent third-party is chatting with or is brought into a phone conversation without the caller knowing and offers advice to an agent. The caller doesn't hear or see these messages, but the agent does. Valid values: * true: Internal message, don't display to the caller. * false: Not an internal message, display to caller. {#vir-POST-voice_inter-transcript__ul_sdw_bf3_vvb} Data type: Boolean Default: false |
| transcript.loudnessScore | Measurement as to how loudly a customer or agent is speaking during a call. Contact Lens displays an analysis of the conversation that shows where they may be talking loudly and have a negative sentiment. Data type: Number Range: -1.0 (negative) to 1.0 (positive) Default: Null |
| transcript.participantId | Required. Participant associated with the message. Valid values: * AGENT * CUSTOMER Data type: String |
| transcript.sentiment | Sentiment of the message. This value is generated by a third-party provider. Based on the ServiceNow instance configuration settings, this value is then translated to be either positive, negative, or neutral and is stored in the conversation and interaction record. Valid values: * NEGATIVE * NEUTRAL * POSITIVE Data type: String Default: Null |
[Table 27. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter-transcript__entry__40}{#vir-POST-voice_inter-transcript__accept-RESTAPI}{#vir-POST-voice_inter-transcript__content_type-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
[Table 28. Request headers]

{#vir-POST-voice_inter-transcript__entry__46}

| Header | Description |
|-|-|
| None |   |
[Table 29. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/5p0ILxi5PWo5cXuREsZCAQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#vir-POST-voice_inter-transcript__entry__50}{#vir-POST-voice_inter-transcript__entry-200-status-code}{#vir-POST-voice_inter-transcript__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. Badly formed JSON or required parameters were not passed. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
[Table 30. Status codes]

### Response body parameters (JSON or XML)

{#vir-POST-voice_inter-transcript__entry__58}

| Name | Description |
|-|-|
| result | Message that describes the results of the call. Data type: String |
| Conversation id | Sys_id of the voice conversation table where the messages were attached. Data type: String Table: Conversation \[sys_cs_message_conversation\] |
[ ]

### cURL request

The following example shows how to add messages to an existing voice interaction
record.

    curl "http://instance.servicenow.com/api/now/v1/cs/voice-interactions/transcript" \  
    --request POST \ 
    --header "Accept:application/json" \ 
    --header "Content-Type: application/json"\  
    --user 'username':'password' \ 
    -d ' { 
      "interactionId": "e67a6c30c7233010967a34c91dc26068", 
      "source": "Amazon Connect", 
      "conversationStarted": "2021-08-06 15:07:51", 
      "transcript": [ 
        { 
          "isEvent": "False", 
          "isInternalMessage": "False", 
          "beginOffsetMillis": 100000, 
          "content": "This is John. How can I help you?", 
          "endOffsetMillis": 150000, 
          "id": "954c4edc-31a8-48b0-8f6e-7fa0c4ca00a8", 
          "participantId": "AGENT", 
          "sentiment": "NEUTRAL" 
        }, 
        { 
          "isEvent": "False",
          "isInternalMessage": "False", 
          "beginOffsetMillis": 200000, 
          "content": "Uh, yes, John. Um, I'm a little frustrated right now.", 
          "endOffsetMillis": 25000, 
          "id": "18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f", 
          "participantId": "CUSTOMER", 
          "sentiment": "NEGATIVE" 
        } 
      ] 
    } ' 

Response:

    {  
      "result": "Voice conversation transcript has been successfully saved. Conversation id: 8439d3c753b51110b6e8ddeeff7b12e2"  
    }


