---
title: "Update a message"
method: PATCH
path: "/v1/inboxes/{id}/messages/{messageId}"
tags: ["Messages"]
---

# Update a message

`PATCH /v1/inboxes/{id}/messages/{messageId}`

## Request

- Base URL: `https://anjal.app`
- URL: `https://anjal.app/v1/inboxes/{id}/messages/{messageId}`
- Auth: API key in header `X-API-Key`

Change labels (replace with `labels`, or change with `addLabels` /
`removeLabels`) and state (read, starred, archived, spam). Returns the
message's labels after the change.

## Request body

- object
  - `labels` union: Labels as an array or a comma-separated string. Stored lowercase and deduplicated; at most 32 labels of at most 64 characters, no commas.
    - string[]
    - string
  - `addLabels` union: Labels as an array or a comma-separated string. Stored lowercase and deduplicated; at most 32 labels of at most 64 characters, no commas.
    - string[]
    - string
  - `removeLabels` union: Labels as an array or a comma-separated string. Stored lowercase and deduplicated; at most 32 labels of at most 64 characters, no commas.
    - string[]
    - string
  - `isRead` boolean
  - `isStarred` boolean
  - `isArchived` boolean
  - `isSpam` boolean: true moves it to Spam; false recovers it.

## Response `200`

Updated

- object
  - `updated` boolean
  - `id` string
  - `labels` string[]
  - `isRead` boolean
  - `isStarred` boolean
  - `isArchived` boolean
  - `isSpam` boolean

## Other responses

- `400`: Request body failed schema validation
- `404`: Resource not found

---

[API](https://skmtc.dev/anjal/apis/anjal-api.md) · [All operations](https://skmtc.dev/anjal/apis/anjal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anjal/apis/anjal-api/revisions/a4044778e294?raw)
