Delete message metadata
Delete metadata from a sent message in a direct or group channel.
By default, metadata operations via the server API are not synced to the operator's client, which may cause inconsistency. Set syncToSender to 1 if needed.
Request
POST: https://[Base URL](/platform-chat-api/base-url)/v4/channel-type/message/metadata/delete
Rate limit: 100 requests per second. Of these, group channel metadata deletions are limited to 20 per second. See also known issues.
Authentication: All server API requests require signature verification. See API request signing.
Request body
Content type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
messageUID | String | Yes | Unique message ID. Obtainable via message routing. |
userId | String | Yes | Operator's user ID — the user deleting the metadata. |
channelType | Number | Yes | Channel type. 1 (direct) or 3 (group). |
channelId | String | Yes | Target channel ID (user ID for direct channels, group ID for group channels). |
keys | String[] | Yes | Keys of the metadata entries to delete. Up to 100 keys per request. |
syncToSender | Number | No | Whether to sync the metadata deletion to the operator's client. 1: sync. 0 (default): do not sync. See How to sync sent messages to the sender's client. |
Request example
HTTP
POST /v4/channel-type/message/metadata/delete HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Timestamp: 1585127132438
Nonce: 14314
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/json
{
"messageUID": "BRGM-DEN2-01E4-BN66",
"userId": "tjw3zbMrU",
"channelType": 1,
"channelId": "WNYZbMqpH",
"keys": ["11111"],
"syncToSender": 1
}
Response
| Property | Type | Description |
|---|---|---|
code | Number | Status code. 0 indicates success. |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"code":0}