Docs
patch

Update visitor context

Updates context data for a visitor (geolocation data is automatically removed).

Visitors
Endpoint
/visitors/{token}/context
Method
patch
Plan Required
FREE
Authorization
Bearer Token required
Permissions
WRITE
Content-Type
application/json

API Tester(Loading...)

Loading API token configuration...

Payload

URL Parameters

tokenstringrequired

Visitor token

Body Parameters

Content-Type: application/jsonrequired

Schema:

name

string
John Doe

context

object
[object Object]

Response

200Updated visitor with new context

id

number
No example

name

string
No example

token

string
No example

ip

string
No example

context

string
No example

websiteId

number
No example

country

string
No example

city

string
No example

online

boolean
No example

createdAt

string
No example

updatedAt

string
No example
400Bad request - Invalid context data
No response details available
401Unauthorized - Invalid or missing API token
No response details available
404Visitor not found
No response details available

Expected Response

JSON
{
  "id": "abc123def456",
  "name": "John Doe",
  "token": "sk-abc123def456ghi789",
  "ip": "sample_ip",
  "context": "Sample text content",
  "websiteId": "abc123def456",
  "country": 10,
  "city": "New York",
  "online": true,
  "createdAt": "2024-03-15T14:30:00Z",
  "updatedAt": "2024-03-15"
}

API Access Token

Base URL

https://api.5chat.io