Skip to Content

Add thread labels

Adds the given mailbox labels to the thread, keeping the labels it already has, and returns where the thread stands.

POST
/v1/mailboxes/{id}/threads/{threadId}/labels

Adds the given mailbox labels to the thread, keeping the labels it already has, and returns where the thread stands. Every id must be one of the mailbox's labels.

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
labels*array<>
Items1 <= items

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.addThreadLabels({
  "id": "example",
  "threadId": "example",
  "labels": [
    "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