Links

Register Livechat Visitor

Register a visitor's information before creating a new Omnichannel room. You can set basic information such as name, phone, custom fields, and the initial department
HTTP Method
URL
Requires Auth
POST
/api/v1/livechat/visitor
no

Body

Key
Example Value
Description
visitor*
{ "visitor": { ... }
Enter the body parameters in the visitor object.
token*
erdsfdjs43828492
Enter a random unique string as the visitor token.
name
John Doe
Visitor's name.
email
Visitor's email ID.
department
Support
The department that the visitor wants to register to.
phone
+37265783468
Visitor's phone number.
username
kim.jane
The agent's user name.
custom fields: key, value, overwite
"customFields": [{ "key": "address", "value": "Rocket.Chat street",
"overwrite": true }]
Enter the custom field key, value, and whether you want to overwrite this information.

Example Call

curl --location 'http://localhost:3000/api/v1/livechat/visitor' \
--header 'Content-Type: application/json' \
--data-raw '{
"visitor": {
"name": "Livechat Visitor",
"email": "[email protected]",
"department": "Support",
"token": "iNKE8a6k6cjbqWhWd",
"phone": "55 51 5555-5555",
"customFields": [{
"key": "address",
"value": "Rocket.Chat street",
"overwrite": true
}]
}
}'

Example Response

{
"visitor": {
"_id": "642fc15452492a08c3a756de",
"username": "guest-19",
"status": "online",
"ts": "2023-04-07T07:08:04.375Z",
"_updatedAt": "2023-11-03T08:23:23.449Z",
"name": "Livechat Visitor",
"phone": [
{
"phoneNumber": "55 51 5555-5555"
}
],
"token": "iNKE8a6k6cjbqWhWd",
"visitorEmails": [
{
"address": "[email protected]"
}
],
"department": "64181a0728384134ed600dcc"
},
"success": true
}
After registering the visitor, create the Omnichannel room using the same token used in this endpoint.
Last modified 25d ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.