Delete several of your messages at once
const url = 'https://api.vexarn.dev/api/messages/delete';const options = { method: 'POST', headers: { cookie: '__Host-vexarn.session_token=<__Host-vexarn.session_token>', 'Content-Type': 'application/json' }, body: '{"items":[{"direction":"in","id":"0b1c2d3e-4f50-6172-8394-a5b6c7d8e9f0"},{"direction":"out","id":"1c2d3e4f-5061-7283-94a5-b6c7d8e9f0a1"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vexarn.dev/api/messages/delete \ --header 'Content-Type: application/json' \ --cookie __Host-vexarn.session_token=<__Host-vexarn.session_token> \ --data '{ "items": [ { "direction": "in", "id": "0b1c2d3e-4f50-6172-8394-a5b6c7d8e9f0" }, { "direction": "out", "id": "1c2d3e4f-5061-7283-94a5-b6c7d8e9f0a1" } ] }'Deletes only your copies, each as deleting one by one does. Ones already deleted, not yours or unknown are skipped; the answer says how many were deleted. Each item counts against your rate limit as one request.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”1 to 100 of your messages: in with InboxMessage.id, out with SentMessage.id.
object
object
Example
{ "items": [ { "direction": "in", "id": "0b1c2d3e-4f50-6172-8394-a5b6c7d8e9f0" }, { "direction": "out", "id": "1c2d3e4f-5061-7283-94a5-b6c7d8e9f0a1" } ]}Responses
Section titled “Responses”Deleted
object
How many were deleted; ones already deleted or not yours are skipped.
Example
{ "deleted": 2}No items, more than 100, or an item without direction in/out and an id (validation_error)
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}No session
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}Too many requests from this user or client address
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}Headers
Section titled “Headers”Seconds until the rate limit window resets