---
title: "POST /api/v1.0/flag/"
method: POST
path: "/api/v1.0/flag/"
tags: ["flags"]
---

# POST /api/v1.0/flag/

`POST /api/v1.0/flag/`

Change a specific flag (unread, starred, trashed, archived, spam) for multiple messages or all messages within multiple threads. Uses request body.

## Request body

- ChangeFlagRequestRequest
  - `flag` 'unread' | 'starred' | 'trashed' | 'archived' | 'spam', required — * `unread` - unread * `starred` - starred * `trashed` - trashed * `archived` - archived * `spam` - spam
  - `value` boolean, required
  - `message_ids` string[] — List of message UUIDs to apply the flag change to.
  - `thread_ids` string[] — List of thread UUIDs where all messages should have the flag change applied.
  - `mailbox_id` string, uuid — Mailbox UUID. Required when flag is 'unread' or 'starred'.
  - `read_at` string, date-time, nullable — Timestamp up to which messages are considered read. When provided with flag='unread', sets ThreadAccess.read_at directly. null means nothing has been read (all messages unread).
  - `starred_at` string, date-time, nullable — Timestamp when the thread was starred. When provided with flag='starred' and value=true, sets ThreadAccess.starred_at. null or value=false removes the starred flag.

## Response `200`

- object — Unspecified response body

## Other responses

- `400`
- `403`

---

[API](https://skmtc.net/betagouv/apis/messages-api.md) · [All operations](https://skmtc.net/betagouv/apis/messages-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/betagouv/messages-api/versions/5c64242ea839/schema)
