Request Bodies for Chat REST API

To perform a POST or GET request, pass query parameters or create a request body that’s formatted in JSON. Request bodies can contain one or more other request bodies that are nested inside. Each request body can contain unique request properties.

The legacy chat product is scheduled for retirement on February 14, 2026, and is in maintenance mode until then. During this phase, you can continue to use chat, but we no longer recommend that you implement new chat channels. To avoid service interruptions to your customers, migrate to Messaging for In-App and Web. Messaging offers many of the chat features that you love plus asynchronous conversations that can be picked back up at any time. Learn about chat retirement in Help.

Note

Breadcrumb 

Request properties

Property NameTypeDescriptionAvailable Versions
locationStringThe URL of the web page that the chat visitor is viewing.29.0

Request body

1"location":{
2            "type":"string",
3            "description":"The current location or URL of the visitor",
4            "required":true,
5            "version":29.0
6        }

ChasitorInit 

Request properties

Property NameTypeDescriptionAvailable Versions
organizationIdStringThe chat visitor’s Salesforce organization ID.29.0
deploymentIdStringThe ID of the deployment from which the chat originated.29.0
buttonIdStringThe ID of the button from which the chat originated.29.0
agentIdStringThe ID of the agent of a direct-to-agent chat request. For normal chat requests, leave this field empty.29.0
doFallbackBooleanSpecifies the fallback mode if agentId is present. If the value is false, it attempts to route the chat session back to that specific agent. If the value is true, it attempts to route the chat session back to the specific agent first but, if the agent is unavailable, it attempts to route to the button next.29.0
sessionIdStringThe chat visitor’s Chat session ID.29.0
userAgentStringThe chat visitor’s browser user agent.29.0
languageStringThe chat visitor’s spoken language.29.0
screenResolutionStringThe resolution of the chat visitor’s computer screen.29.0
visitorNameStringThe chat visitor’s custom name.29.0
prechatDetailsArray of CustomDetail objectsThe pre-chat information that was provided by the chat visitor.29.0
prechatEntitiesArray of Entity objectsThe records created, searched for, or both depending on what EntityFieldsMaps has enabled.29.0
buttonOverridesArray of StringsThe button override is an ordered list of routing targets and overrides the buttonId, agentId, and doFallback modes. The possible options are:
  • buttonId—Normal routing
  • agentId—Direct-to-agent routing with no fallback
  • agentId_buttonId—Direct-to-agent routing with fallback to the button

You can list one or more of these options, where the order specifies the routing target order. The second or third target is attempted only if the previous one fails.
29.0
receiveQueueUpdatesBooleanIndicates whether the chat visitor receives queue position updates (true) or not (false).29.0
isPostBooleanIndicates whether the chat request was made properly through a POST request (true) or not (false).29.0

Request body

1{
2        organizationId: "00DD0000000JVXs",
3        deploymentId: "572D000000000J6",
4        buttonId: "573D000000000OC",
5        agentId: "005B0000000F3b2",
6        doFallback: true,
7        sessionId: "5503f854-0203-4324-8ed5-f793a367426f",
8        userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36",
9        language: "en-US",
10        screenResolution: "2560x1440",
11        visitorName: "Jon A.",
12        prechatDetails: [
13                {
14                        label: "E-mail Address",
15                        value: "jon@example.com",
16                        entityFieldMaps: [
17                           {
18                                entityName: "Contact",
19                                fieldName: "Email",
20                                isFastFillable: false,
21                                isAutoQueryable: true,
22                                isExactMatchable: true
23                           }
24                        ],
25                        transcriptFields: [
26                                "c__EmailAddress"
27                        ],
28                        displayToAgent: true
29                }
30        ],
31        prechatEntities: [],
32        buttonOverrides: [
33                "573D000000000OD"
34        ],
35        receiveQueueUpdates: true,
36        isPost: true
37}

ChasitorResyncState 

Request properties

Property NameTypeDescriptionAvailable Versions
organizationIdStringThe chat visitor’s Salesforce organization ID.29.0

Request body

1{
2        organizationId: "00DD0000000JVXs"
3}

ChasitorSneakPeek 

Request properties

Property NameTypeDescriptionAvailable Versions
positionintegerThe position of the Sneak Peek update in the chat.29.0
textStringThe text that the chat visitor is typing in the text input area of the chat window.29.0

Request body

1{
2        position: 3,
3        text: "Hi there."
4}

ChatMessage 

Request properties

Property NameTypeDescriptionAvailable Versions
textStringThe text of the chat visitor’s message to the agent.29.0

Request body

1{
2        text: "I have a question about my account."
3}

CustomEvent 

Request properties

Property NameTypeDescriptionAvailable Versions
typeStringThe type of custom event that occurred, used for adding the event listener on the agent’s side.29.0
dataStringData that’s relevant to the event that was sent to the agent.29.0

Request body

1{
2        type: "PromptForCreditCard",
3        data: "Visa"
4}

MultiNoun 

Request properties

NameTypeDescriptionAvailable Versions
nounsArray of NounWrapper objectsAn array of noun objects and their properties that are batched in the MultiNoun request.29.0

Request body

1{
2        nouns: [
3                {
4                        prefix: "Chasitor",
5                        noun: "ChatMessage",
6                        object: {
7                                text: "Goodbye"
8                        }
9                },
10                {
11                        prefix: "Chasitor",
12                        noun: "ChatEnd",
13                        object: {}
14                }
15        ]
16}

SensitiveDataRuleTriggered for Agents 

Request properties

Property NameTypeDescriptionAvailable Versions
rulesArray of Rule objectsA list of sensitive data rules applied to the chat session.29.0
chatIdStringThe ID of the chat session. 

Request body

1{
2    "rules": [
3        {
4            "name": "Replace-Bad-Word"
5        },
6        {
7            "name": "Filter-Out-Digits"
8        }
9    ],
10    "chatId": "1a240b1a-f60e-456d-9f77-41cbfa7b9159"
11}

SensitiveDataRuleTriggered for Chasitors 

Request properties

Property NameTypeDescriptionAvailable Versions
rulesArray of Rule objectsA list of sensitive data rules applied to the chat session.29.0

Request body

1{
2    "rules": [
3        {
4            "id": "0GORM00000001dM",
5            "name": "Replace-Bad-Word"
6        },
7        {
8            "id": "0GORM00000001dW",
9            "name": "Filter-Out-Digits"
10        }
11    ]
12}