# Update Message

`PATCH https://api.inboxjot.com/v1/messages/{message_id}`

Adds and removes tags. A tag is 1 to 64 letters, digits, `-`, `_`, `.` or `:`, saved in lowercase. A message has at most 20 tags. Needs a Full key. A key limited to one domain answers 403. Send an optional `Idempotency-Key` header to retry safely. See Idempotency.

Filter a list by one tag with `tag` on List Messages.

## Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `message_id` | string | Yes | The message id. |

## Body Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `add_tags` | string[] | No | Tags to add. A tag is 1 to 64 letters, digits, `-`, `_`, `.` or `:`. It is saved in lowercase. |
| `remove_tags` | string[] | No | Tags to remove. A tag in both lists is removed. |

## Response

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | No | The message id. |
| `inbox_id` | string \| null | No | The inbox that matched the recipient, or `null`. |
| `inbox_name` | string \| null | No | The inbox name, or `null`. |
| `recipient` | string | No | The envelope recipient that reached this workspace. |
| `from` | object | No | The sender. |
| `from.email` | string | No | The sender address. |
| `from.name` | string \| null | No | The sender name. |
| `subject` | string | No | The subject. |
| `preview` | string | No | The start of the reply text. |
| `status` | string | No | One of `stored`, `delivered`, `retrying`, `failed`, `held` or `rejected`. |
| `status_reason` | string \| null | No | Why it was held, rejected or failed: `spam`, `virus`, `too_large`, `too_many_attachments`, a forward reason, or `endpoint_removed` when its webhook endpoint was deleted or turned off. |
| `tags` | string[] | No | The tags on the message, in the order they were added. |
| `thread_id` | string \| null | No | The thread of the message, or `null` for a message received before threads. |
| `attachment_count` | integer | No | How many files are attached. |
| `size` | integer | No | The raw size in bytes. |
| `received_at` | string | No | When it arrived. |
| `to` | string[] | No | The To header addresses. |
| `cc` | string[] | No | The Cc header addresses. |
| `reply_to` | string[] | No | The Reply-To header addresses. |
| `message_id` | string \| null | No | The Message-ID header. |
| `in_reply_to` | string \| null | No | The In-Reply-To header. |
| `references` | string[] | No | The References header, oldest first. |
| `text` | string \| null | No | The plain text body. |
| `html` | string \| null | No | The HTML body. |
| `reply_text` | string \| null | No | The text body without the quoted history. |
| `headers` | object[] | No | Every header, in order. |
| `headers[].name` | string | No | The header name. |
| `headers[].value` | string | No | The header value. |
| `authentication` | object | No | The SPF, DKIM and DMARC verdicts. |
| `authentication.spf` | string \| null | No | The SPF verdict. |
| `authentication.dkim` | string \| null | No | The DKIM verdict. |
| `authentication.dmarc` | string \| null | No | The DMARC verdict. |
| `spam` | string \| null | No | The spam verdict. |
| `virus` | string \| null | No | The virus verdict. |
| `attachments` | object[] | No | The attached files. |
| `attachments[].id` | string | No | The attachment id. |
| `attachments[].filename` | string | No | The file name. |
| `attachments[].content_type` | string | No | The MIME type. |
| `attachments[].size` | integer | No | The size in bytes. |
| `attachments[].content_id` | string \| null | No | The Content-ID of an inline image. |
| `attachments[].disposition` | string \| null | No | `attachment` or `inline`. |
| `attachments[].blocked` | boolean | No | True when the virus scan failed. A blocked file cannot be downloaded. |
| `deliveries` | object[] | No | The webhook deliveries of this message. |
| `deliveries[].endpoint_id` | string | No | The webhook id. |
| `deliveries[].endpoint_name` | string \| null | No | The webhook name, or `null` when it was deleted or the token cannot read webhooks. |
| `deliveries[].url` | string \| null | No | The webhook URL, or `null` when it was deleted or the token cannot read webhooks. |
| `deliveries[].status` | string | No | `succeeded`, `retrying` or `failed`. |
| `deliveries[].response_status` | integer \| null | No | The HTTP status the webhook answered, or `null` when it did not answer. |
| `deliveries[].duration_ms` | integer \| null | No | How long the last try took. |
| `deliveries[].attempts` | integer | No | How many times it was tried. |
| `deliveries[].next_attempt_at` | string \| null | No | When it is tried again. |
| `deliveries[].last_attempt_at` | string \| null | No | When it was last tried. |
| `forward` | object \| null | No | The email Inboxjot sent when the inbox forwarded this message, or `null`. |
| `forward.email_id` | string | No | The id of the sent email. |
| `forward.to` | string \| null | No | The address it went to, or `null` once the email is gone. |
| `forward.sent_at` | string \| null | No | When it was forwarded. |
| `previous_id` | string \| null | No | The newer message next to it, or `null`. |
| `next_id` | string \| null | No | The older message next to it, or `null`. |

## Request

cURL:

```bash
curl -X PATCH https://api.inboxjot.com/v1/messages/msg_06d2mfk8r4tq9xv2bnc7s \
  -H "Authorization: Bearer $INBOXJOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "add_tags": [
      "billing",
      "plan-change"
    ],
    "remove_tags": [
      "urgent"
    ]
  }'
```

## Responses

| Status | Description |
| --- | --- |
| 200 | Returns the message with its new tags. |
| 400 | A tag is invalid, or the message would have over 20 tags. |
| 401 | The API key is missing, revoked or expired. |
| 403 | The key is a Sending key, or the request comes from outside its IP allowlist. |
| 404 | The message does not exist in this workspace. |
| 409 | A request with the same Idempotency-Key is still running. Retry after one second. |
| 413 | The body is larger than 2 MB. |
| 415 | The Content-Type header is not application/json. |
| 422 | The Idempotency-Key was already used with a different request. |
| 429 | Too many requests for this key. Wait for the seconds in the Retry-After header. |
| 500 | Something failed on our side. Retry later. |

200:

```json
{
  "id": "msg_06d2mfk8r4tq9xv2bnc7s",
  "inbox_id": "inb_06d2mfk8r6pn2tc8yw3hd",
  "inbox_name": "Support",
  "thread_id": "thr_06d2mfk8r5xc3vb7nq2kd",
  "recipient": "support@inbound.acme.dev",
  "from": {
    "email": "riti@example.com",
    "name": "Riti Shah"
  },
  "subject": "Can I change my plan?",
  "preview": "Hi! Can I move from yearly to monthly?",
  "status": "delivered",
  "status_reason": null,
  "tags": [
    "billing",
    "plan-change"
  ],
  "attachment_count": 0,
  "size": 4213,
  "received_at": "2026-11-20T09:14:02.000Z"
}
```

400:

```json
{
  "name": "validation_error",
  "status": 400,
  "message": "A message can have at most 20 tags",
  "errors": [
    {
      "message": "A message can have at most 20 tags",
      "location": "add_tags"
    }
  ],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

401:

```json
{
  "name": "unauthorized",
  "status": 401,
  "message": "Unauthorized",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

403:

```json
{
  "name": "forbidden",
  "status": 403,
  "message": "This key cannot be used from 203.0.113.7",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

404:

```json
{
  "name": "not_found",
  "status": 404,
  "message": "Message not found",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

409:

```json
{
  "name": "concurrent_idempotent_requests",
  "status": 409,
  "message": "A request with this idempotency key is still in progress. Try again later.",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

413:

```json
{
  "name": "payload_too_large",
  "status": 413,
  "message": "The request body is too large",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

415:

```json
{
  "name": "unsupported_media_type",
  "status": 415,
  "message": "The Content-Type must be application/json",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

422:

```json
{
  "name": "invalid_idempotent_request",
  "status": 422,
  "message": "This idempotency key was already used with a different request",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

429:

```json
{
  "name": "rate_limit_exceeded",
  "status": 429,
  "message": "Too many attempts. Try again later.",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

500:

```json
{
  "name": "unknown_error",
  "status": 500,
  "message": "Something went wrong. Please try again later.",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```
