📝Update Chatlog Info
Set contact and lead information on an existing chatlog: name, email, phone number, a free-form userId, and any of the chatbot's configured custom fields.
Only the fields present in the request body are modified — omit a field to leave its current value untouched.
Endpoint
POST https://app.wonderchat.io/api/v1/update-chatlog-infoAuthentication
Pass your account API key in the request body as apiKey. The key must have ADMIN permission on the chatbot that owns the chatlog (same auth model as the add-tags-to-chatlog and messages endpoints). Requires a paid plan.
Request Parameters
apiKey
string
✅ Yes
Your account API key
chatlogId
string
✅ Yes
The ID of the chatlog to update
name
string
No
Contact name (userName)
email
string
No
Contact email (userEmail)
phoneNumber
string
No
Contact phone number (userPhoneNumber)
userId
string
No
Free-form identifier for the person in the chat. Not a Wonderchat account ID.
customFields
array of { name, value }
No
Custom field values. name must match a custom field configured on the chatbot.
At least one updatable field (name, email, phoneNumber, userId, or a non-empty customFields) must be provided.
Partial Update Semantics
Updates are partial. Only the fields you include in the request body are changed; any field you omit keeps its current value. To clear a value, send it explicitly (e.g. an empty string) — omitting it does not clear it.
Custom Field Behavior
Each
nameis matched against the chatbot's configured custom fields. An unknown name returns400.Custom field names are case-sensitive and must exactly match what's configured in the chatbot's lead / custom-field settings.
Values are upserted per chatlog + field — calling repeatedly overwrites the existing value rather than stacking duplicates.
Example Request
Response Format
200 OK
Error Responses
400
Validation failed, no fields provided, or an unknown custom field name
{ "error": "Unknown custom field(s): Foo" }
403
Invalid API key or insufficient permission on the chatbot
{ "error": "You do not have permission to update this chatlog" }
404
Chatlog does not exist
{ "error": "Chatlog not found" }
405
Non-POST request
Method Not Allowed
Use Cases
CRM Sync: Attach a CRM record ID via
userIdand keep contact details in sync.Lead Enrichment: Populate custom fields (company, plan, region) collected outside the chat.
Post-chat Updates: Correct or complete contact information after a conversation ends.
Last updated
Was this helpful?