Conversations
Mark conversation as read
Marks a conversation as read. Pass conversation_id in the JSON body (not the path, since provider IDs may contain @ / :). Telegram requires a single up_to_message_id from a message received by the current account in this conversation and marks that message and earlier messages as read; omitting the ID or providing a non-empty up_to_message_sender_id is not supported. For a WhatsApp message receipt, provide non-empty up_to_message_id and up_to_message_sender_id together; use the matching webhook data.sender.id for a group message. For WhatsApp only, omitting both message fields or leaving both empty after trimming marks the whole conversation as read; providing only one non-empty value returns 400 invalid_request.
https://api.unifyport.ai/v1/accounts/{account_id}/conversations/readSupported channels
Before you call
Use a server-side X-Api-Key for the workspace that owns the resource. Replace every placeholder before running a sample.
Prepare your parameters
- account_id
- Use data.id from account creation or an account query. Account identifiers belong to the workspace selected by X-Api-Key. Get account
Request parameters
Headers
X-Api-KeyWorkspace API key. The workspace is resolved from this header.
Content-TypeUse application/json when sending a JSON request body.
Path parameters
account_idIdentifier used in the conversations route.
Request body
conversation_idTarget conversation identifier.
up_to_message_idValidated by the account channel; the field is always a string. Telegram requires a single ID of a message received by the current account in this conversation, such as data.message.id from message.received with data.message.direction=inbound. After trimming leading and trailing whitespace, only ASCII decimal digits are allowed, with a numeric value of 1–2147483647. Marks messages up to and including that message as read. Comma-separated lists, signs, decimals, exponents, internal whitespace and non-ASCII digits are not allowed; omitting the ID or using 0 to mark the entire conversation is not supported. For WhatsApp, optionally provide one message ID or multiple IDs from the same sender separated by ASCII commas, together with up_to_message_sender_id; both values must be non-empty. Omitting both fields, or leaving both empty after trimming, marks the entire conversation as read.
up_to_message_sender_idProvider-side sender identifier for WhatsApp message-level read receipts; provide a non-empty value together with a non-empty up_to_message_id. For group chats, use data.sender.id from the Webhook event. Multiple message IDs must belong to the same sender. Telegram does not support this parameter; a non-empty value returns invalid_request.
Understand the result
Read the documented response fields and HTTP status, then follow the related operations for your next step.
Response 200 OK
{
"request_id": "<REQUEST_ID>",
"data": {
"ok": true
}
}
Response body
okAlways true when the operation succeeded; failures return a non-2xx status instead.
Responses
200200 OK
Request succeeded. See the example response body.
400Bad Request
The request body, path, or parameters are invalid.
401Unauthorized
The X-Api-Key header is missing or invalid.
404Not Found
The requested resource was not found. Check error.code and the current operation.
409Conflict
The requested operation conflicts with an existing provider account or resource.
500Internal Server Error
The service encountered an unexpected error.
501Not Implemented
The selected provider does not implement this operation.
502Bad Gateway
The provider adapter or upstream provider could not complete the operation.
If the request fails
Inspect HTTP status and error.code/numeric_code, and keep request_id for diagnosis. Correct invalid parameters, complete required authorization or check runtime state as appropriate. Confirm the outcome before retrying a send or another write. Error reference
- invalid_request · 10000 · 400
- Check required fields, formats and channel conditions, then correct the request.
- missing_api_key · 11000 · 401
- Check X-Api-Key and whether the workspace is active.
- invalid_api_key · 11001 · 401
- Check X-Api-Key and whether the workspace is active.