Documentation Index

Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt

Use this file to discover all available pages before exploring further.

Register Livechat Visitor

Prev Next
Post
/api/v1/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.

The response may include externalIds when the visitor has been linked to an external system by an omnichannel app. This field cannot be set through this endpoint's request body.

Changelog

Version Description
8.4.0 Added externalIds field to the visitor response.
Body parameters
Example 1
{
  "visitor": {
    "name": "Livechat Visitor",
    "email": "visitor@rocket.chat",
    "department": "Support",
    "token": "iNKE8a6k6cjbqWhWd",
    "phone": "55 51 5555-5555",
    "customFields": [
      {
        "key": "address",
        "value": "Rocket.Chat street",
        "overwrite": true
      }
    ]
  }
}
Expand All
object
visitor
object Required

Enter the body parameters in the visitor object.

name
string

The visitor's name.

email
string

The visitor's email.

department
string

The department that the visitor wants to register to.

token
string Required

Enter a random unique string as the visitor token.

phone
string

The visitor's phone number.

username
string

The agent's username.

customFields
Array of object

Enter the custom field key, value, and whether you want to overwrite this information.

object
key
string
Exampleaddress
value
string
ExampleRocket.Chat street
overwrite
boolean
Responses
200
Success Example
{
  "visitor": {
    "_id": "6a22b1765528fa64dd29de70",
    "username": "guest-10",
    "status": "online",
    "ts": "2026-06-05T11:22:30.664Z",
    "_updatedAt": "2026-06-05T11:22:30.665Z",
    "name": "Postman Test Visitor",
    "phone": [
      {
        "phoneNumber": "+15551234567"
      }
    ],
    "token": "test-token-12345",
    "visitorEmails": [
      {
        "address": "postman-test@example.com"
      }
    ]
  },
  "success": true
}
Expand All
object
visitor
object
_id
string
username
string
status
string
ts
string
_updatedAt
string
name
string
phone
Array of object
object
phoneNumber
string
token
string
visitorEmails
Array of object
object
address
string
department
string
externalIds
Array of object

Channel-specific external identifiers (e.g. WhatsApp BSUID). Set by omnichannel apps via apps-engine, not through this REST endpoint's request body.

object
appId
string

ID of the omnichannel app that registered this identifier.

entityId
string

External identifier value (e.g. Meta BSUID).

metadata
object

Optional app-specific metadata (e.g. WhatsApp username).

success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "Match error: Missing key 'visitor'"
}
Example 2
{
  "success": false,
  "error": "Match error: Missing key 'token' in field visitor"
}
object
success
boolean
error
string