Skip to Content

Update a mailbox thread

Updates the fields you name and keeps the rest. Request: PATCH /v1/mailboxes/{id}/threads/{threadId}. Scope: mailboxes:update.

PATCH
/v1/mailboxes/{id}/threads/{threadId}

Updates the fields you name and keeps the rest. folder, priority, and closed are shared with everyone on the mailbox; done, read, starred, and snoozedUntil are the caller's own. The Done list includes the caller's Done and shared closed conversations; changing done does not reopen Close. Personal mailboxes refuse closed; archive them with folder: archived. Neither Done nor Close publishes webhook or event-stream events. A new live message clears Done for all readers and reopens Close. Labels are not updated here: use POST and DELETE on /v1/mailboxes/{id}/threads/{threadId}/labels. Returns where the thread stands, not its messages: read those with GET .../threads/{threadId}.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^mbx_[0-9a-hjkmnp-tv-z]{16,24}$
threadId*string
Match^thread_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
folder?|null
priority?|null
done?boolean|null
closed?boolean|null
read?boolean|null
starred?boolean|null
snoozedUntil?string|null|null

Response Body

MailboxThreadState

application/json
  1. response
id*MailboxThreadId
Match^thread_[0-9a-hjkmnp-tv-z]{16,24}$
folder*MailboxThreadFolder
Value in"inbox""assigned""pending""sent""archived""trash"
priority*MailboxThreadPriority
Value in"low""normal""high""urgent"
labels*array<>
read*boolean
starred*boolean
snoozedUntil*string|null
doneAt*string|null
closedAt*string|null
closedBy*|null
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.mailboxes.updateThread({
  "id": "example",
  "threadId": "example"
});
Example Response
{
  "id": "string",
  "folder": "inbox",
  "priority": "low",
  "labels": [
    "string"
  ],
  "read": true,
  "starred": true,
  "snoozedUntil": "string",
  "doneAt": "string",
  "closedAt": "string",
  "closedBy": {
    "kind": "user",
    "id": "string",
    "displayName": "string"
  }
}

Related documentation