---
title: "Restore a thread from trash"
canonical: "https://bird.com/docs/api/reference/restore-email-thread"
---

# Restore a thread from trash

`POST /v1/email/threads/{thread_id}/restore`

Restores the conversation's unexpired trashed messages and updates its message and unread counts. Messages past their trash deadline or the mailbox retention period stay deleted. Folder, read state and custom labels are preserved. Repeating the operation leaves restored messages unchanged. Previously canceled scheduled sends are not resumed.

## Servers

- `https://{region}.platform.bird.com`: Regional API endpoint. Use the host for the region your organization is hosted in. Official Bird SDKs and the CLI select it automatically from your API key, so you rarely need to set it by hand.
  - `region`: `us1`, `eu1`. Default: `us1`. The region your organization's data is hosted in.
- `https://platform.bird.com`: Region-independent endpoint for authentication and account administration.
- `http://localhost:8080`: Local development.

## Authentication

Use one authentication option:

- `BearerAuth`: HTTP bearer authentication. Pass the API key as a bearer token in the `Authorization` header. Workspace
keys use `bk_{region}_*`; organization master keys use `bm_{region}_*`.
The prefix identifies the region and selects the
API endpoint. Official Bird SDKs and the CLI derive the region from the key.

- `CookieAuth`: Send `bird_session` in cookie. Session cookie set after signing in to the Bird dashboard. The cookie
value is an opaque session token; no session data is stored in the cookie
itself.

## Code samples

**TypeScript**

```ts
const thread = await bird.email.threads.restore("thr_01abc");
console.log(thread.id);
```

Examples: [TypeScript](/docs/api/reference/restore-email-thread.ts.md) · [Python](/docs/api/reference/restore-email-thread.py.md) · [Go](/docs/api/reference/restore-email-thread.go.md) · [PHP](/docs/api/reference/restore-email-thread.php.md) · [CLI](/docs/api/reference/restore-email-thread.cli.md) · [MCP](/docs/api/reference/restore-email-thread.mcp.md) · [cURL](/docs/api/reference/restore-email-thread.curl.md)

## Example response `200`

```json
{
  "id": "thr_01krdgeqcxet5s7t44vh8rt9mg",
  "mailbox_id": "mbx_01krdgeqcxet5s7t44vh8rt9mg",
  "channel": "email",
  "contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg",
  "subject": "Re: Your order",
  "last_direction": "inbound",
  "folder": "inbox",
  "labels": [
    "urgent"
  ],
  "highlights": {
    "subject": [
      "Re: your **order** **4821**"
    ],
    "text": [
      "confirming your **order** **4821** shipped"
    ]
  }
}
```

## Path parameters

- `thread_id` (string, required): Thread identifier. Starts with `thr_`.

## Header parameters

- `Idempotency-Key` (string, optional)

  Client-supplied key. On operations supporting request deduplication, a retained
  response is replayed for duplicate requests with the same key within the
  idempotency window (3 hours by default). This protection requires a workspace,
  organization, or staff-account scope. User-only and unscoped unauthenticated operations,
  streams, and operations with a separate replay contract do not use this
  response replay.

  On a supported operation, if idempotency protection is unavailable before execution, the API returns
  `503 IdempotencyUnavailable` (E01033) without executing this attempt. Retry with
  backoff using the same key and request. An operation that takes effect before
  its response is retained can still execute again on retry.

  Two distinct 409 errors signal misuse:

  - `request_in_progress` (E01004): The same key is currently being
    processed by a concurrent request. Wait briefly and retry. The lock expires within 30 seconds.
  - `idempotency_key_reuse` (E01005): The same key has already completed
    against a different request body or method. Generate a new key.

  Recommended key format is `<event-type>/<entity-id>` (for example `welcome-user/usr_abc123`).
- `X-Workspace-Id` (string, optional): Workspace context for the request. Required for dashboard authentication and master keys. Workspace keys and access tokens already identify their workspace; send that workspace or omit the header. A different one is rejected.
- `X-Organization-Id` (string, optional): Organization context for the request. Required for dashboard authentication. An API key or access token carries its own organization, so send either that organization or no header at all; a different one is rejected.

## Response body

- `id` (string, required): Thread ID.
- `mailbox_id` (string, required): Mailbox this conversation belongs to.
- `channel` (string, required): Channel this conversation lives on. Always `email`.
- `contact_id` (nullable string, required): Contact linked to this conversation, or null when none is linked.
- `subject` (nullable string, required): Subject of the conversation, taken from its first message. Null when that message had no subject.
- `participants` (array of string, required): Addresses that appear on the retained messages in this conversation, including the mailbox's own address.
- `message_count` (integer, required): Number of retained messages in this conversation, both directions.
- `unread_count` (integer, required): Number of retained received messages that are still unread. Spam and blocked mail is not counted.
- `last_message_at` (string, required): When the most recent retained message in this conversation was received or sent.
- `last_direction` (string, required)

  Direction of the most recent message: `inbound` for a received message, `outbound` for a sent one.

  Possible values: `inbound`, `outbound`
- `folder` (string, required)

  Primary conversation folder. The supported folders are inbox, archive, spam, blocked, sent, and trash. Blocked and sent are assigned automatically. The sent filter also includes sent conversations that received replies and still sit in the inbox; moving them with PATCH removes them from the sent filter.

  Possible values: `inbox`, `archive`, `spam`, `blocked`, `sent`, `trash`
- `read` (boolean, required): Whether every retained received message is read, including trash, spam and blocked messages. Outbound messages do not affect this state.
- `labels` (array of string, required): Custom labels applied to this conversation. Folder and read state are separate fields.
- `created_at` (string, required): When the thread was created.
- `updated_at` (string, required): When the thread last changed.
- `highlights` (object): Matched search fragments, keyed by the field that matched. Returned only by thread search. Omitted when listing threads.
- `highlights.subject` (array of string): Matched fragments from the conversation's subject.
- `highlights.text` (array of string): Matched fragments from a message's body text.
- `scheduled_count` (integer): Scheduled or dispatching sends targeting this conversation. Returned by conversation get and list, including zero when none remain. Omitted by search.
- `next_scheduled_at` (string): Earliest due time among scheduled or dispatching sends. Returned by conversation get and list only when scheduled_count is positive. Omitted by search and when no sends remain.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
