# Messages

Read your conversations and project conversations, and post, edit or delete messages.

0 operation(s) for tokens, 21 app-only. The full schemas are in [openapi.json](https://docs.youniton.com/openapi.json) (search the operation ID).

## The Messages inbox

`GET /conversations`

- Operation ID: `listConversations`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `filter[kind]` | query | array of string | no |  |
| `filter[unread]` | query | boolean | no |  |
| `filter[state]` | query | string | no |  |
| `q` | query | string | no |  |
| `page[size]` | query | integer | no |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The member's conversations by last activity, with unread counts. | application/json | `ConversationPage` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Start a direct conversation (200 when the pair exists) or create a group

`POST /conversations`

- Operation ID: `startConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-02

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `ConversationStartRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The existing direct conversation of the pair. | application/json | `object` |
| 201 | The new conversation. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The sidebar badge — conversations with unread messages

`GET /conversations/unread-summary`

- Operation ID: `getUnreadSummary`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-07

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The number of conversations with unread messages, capped, split by kind. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## One conversation with its channel, roster and permissions

`GET /conversations/{conversationId}`

- Operation ID: `getConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-01

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The conversation document; the ETag carries the version. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Rename a group

`PATCH /conversations/{conversationId}`

- Operation ID: `renameConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/merge-patch+json, required): `ConversationPatch`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The renamed group. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Archive a group — read-only from now on

`POST /conversations/{conversationId}/archive`

- Operation ID: `archiveConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The archived group. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Leave a group

`POST /conversations/{conversationId}/leave`

- Operation ID: `leaveConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Left; the group is gone from the caller's inbox. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## A page of messages by sequence (latest page without parameters)

`GET /conversations/{conversationId}/messages`

- Operation ID: `listConversationMessages`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |
| `after` | query | integer | no |  |
| `before` | query | integer | no |  |
| `limit` | query | integer | no |  |
| `period` | query | integer | no | A client period number of a project conversation, internal readers only. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Messages ascending by sequence with tombstones and attachment statuses. | application/json | `MessagePage` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Post a message in a conversation

`POST /conversations/{conversationId}/messages`

- Operation ID: `postConversationMessage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-05

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `MessagePostRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The posted message. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Mute or unmute a conversation for the caller

`PUT /conversations/{conversationId}/mute`

- Operation ID: `muteConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-07

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |

Request body (application/json, required): `MuteRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The caller's read state for the conversation. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Add members to a group

`POST /conversations/{conversationId}/participants`

- Operation ID: `addConversationParticipants`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `ParticipantAddRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The group with its new roster. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Remove a participant from a group — access ends at once

`DELETE /conversations/{conversationId}/participants/{memberId}`

- Operation ID: `removeConversationParticipant`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |
| `memberId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Removed. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Move the caller's read marker (monotonic)

`PUT /conversations/{conversationId}/read`

- Operation ID: `markConversationRead`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-07

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `conversationId` | path | string (uuid) | yes |  |

Request body (application/json, required): `ReadMarkRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The caller's read state for the conversation. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Search the caller's visible messages

`GET /messages/search`

- Operation ID: `searchMessages`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-10

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `q` | query | string | yes |  |
| `filter[conversationId]` | query | string (uuid) | no |  |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Up to 20 hits, newest first, with excerpts. | application/json | `MessageSearchPage` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Delete a message — the author, the rule's owner or a moderator

`DELETE /messages/{messageId}`

- Operation ID: `deleteMessage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-06

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `messageId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Deleted (or already deleted). |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Edit a message inside the edit window

`PATCH /messages/{messageId}`

- Operation ID: `editMessage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-06

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `messageId` | path | string (uuid) | yes |  |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/merge-patch+json, required): `MessagePatch`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The edited message. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 428 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's client conversation, created on first use, with its client periods

`GET /projects/{projectKey}/conversation`

- Operation ID: `getProjectConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The conversation document with periods, the banner fact and permissions; the ETag carries the version. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Share selected earlier messages with the current client — audited

`POST /projects/{projectKey}/conversation/history-shares`

- Operation ID: `shareConversationHistory`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `Idempotency-Key` | header | string | yes | Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent. |

Request body (application/json, required): `HistoryShareRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The share was recorded. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Dry run — the consequence of sharing earlier messages with the current client

`POST /projects/{projectKey}/conversation/history-shares/validate`

- Operation ID: `validateConversationHistoryShare`
- Call with: Session of the Youniton apps (app only)
- Feature: F-MSG-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |

Request body (application/json, required): `HistoryShareRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The consequence sentence, the counts and the project's current client version; nothing was written. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The tenant's allowed reaction emoji, for every person who may react (internal members and client guests)

`GET /reaction-emoji`

- Operation ID: `getReactionEmoji`
- Call with: Session of the Youniton apps (app only)
- Feature: F-WRK-38

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The mode, the list for only, the catalogue's versions and the per-comment bound; ETag is the Work settings epoch. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Set the tenant's allowed reaction emoji (the Admin; one Save of the mode and the list)

`PUT /reaction-emoji`

- Operation ID: `changeReactionEmoji`
- Call with: Session of the Youniton apps (app only)
- Feature: F-WRK-38

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Kanso-Tenant` | header | string (uuid) | yes | The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |

Request body (application/json, required): `ReactionEmojiSettingsRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The new state; ETag is the new Work settings epoch. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 412 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
