cherami.
API referenceConversations

Delete a conversation

DELETE /v1/threads/{thread_id}

Read as Markdown ↗

DELETE /v1/threads/{thread_id}

Requires an API key: Authorization: Bearer YOUR_CREDENTIAL.

Moves every message currently in the conversation, with attachments, to the inbox's Trash. Trash lists them one by one: restore each within seven days to bring the conversation back; after that they are permanently deleted.

The counts say how many messages moved. A repeated request returns 202 or 404.

Parameters

ParameterLocationRequiredTypeMeaning
thread_idpathYesstringCherami resource ID returned by the API.

curl example

Supply CHERAMI_API_KEY privately.

curl --silent --show-error --include --request DELETE \
  "https://cherami.to/v1/threads/THREAD_ID" \
  --header "Authorization: Bearer $CHERAMI_API_KEY"

Responses

HTTP 202

Accepted.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

DeletedThread

{
  "id": "11111111-1111-4111-8111-111111111111",
  "inbox_id": "11111111-1111-4111-8111-111111111111",
  "message_count": 0,
  "received_count": 0,
  "sent_count": 0,
  "status": "deletion_pending",
  "message": "Example"
}

HTTP 401

unauthorized: Send a valid API key as Authorization: Bearer <key>. If the key stopped working, get a new one through recovery.

  • X-Request-ID: Identifies this request; include it when reporting a problem.
  • WWW-Authenticate: "Bearer"

Content type: application/json.

Error

HTTP 403

operation_not_allowed: Sending, or deletion and restore, is turned off for this account; the message says which. Contact hello@cherami.to.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

HTTP 404

not_found: The resource does not exist or does not belong to this account. A reply or forward source must also be in the sending inbox.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

HTTP 500

internal_error: The operation failed. Retry a read; after a write the change may have happened, so recover as retry by operation describes.

  • X-Request-ID: Identifies this request; include it when reporting a problem.

Content type: application/json.

Error

Schema: DeletedThread

FieldRequiredTypeMeaning and constraints
idYesstringCherami resource ID.
inbox_idYesstringCherami resource ID.
message_countYesintegerminimum: 0
received_countYesintegerminimum: 0
sent_countYesintegerminimum: 0
statusYes"deletion_pending"
messageYesstring

Schema: Error

FieldRequiredTypeMeaning and constraints
errorYesobject

error fields

FieldRequiredTypeMeaning and constraints
codeYesstringCode to handle. Handle a code you don't recognize by its HTTP status.
messageYesstringExplanation of this case; its wording can change.

Errors, limits and pagination · Download OpenAPI 3.1

On this page