# Assistant & AI

Assistant runs, AI policy, budgets and project AI settings.

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

## The tenant's AI pool, usage, reset, remaining and allocation for the current period (read-only)

`GET /ai/budget`

- Operation ID: `getAiTenantBudget`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The tenant budget; meta.warnings may hold ai.allocation_above_budget. | 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` |

## The tenant AI policy with its version

`GET /ai/policy`

- Operation ID: `getAiTenantPolicy`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-08

| 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 policy; 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` |

## Replace the tenant AI policy (all keys) — the write path of the assist policy keys

`PUT /ai/policy`

- Operation ID: `putAiTenantPolicy`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-08

| 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): `AiTenantPolicyUpdate`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The saved policy with its new 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` |
| 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 per-project AI table — enabled, limit, effective limit, used, derived sources, repository index states

`GET /ai/project-settings`

- Operation ID: `listAiProjectSettings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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. |
| `q` | query | string | no |  |
| `sort` | query | string | no |  |
| `page[number]` | query | integer | no |  |
| `page[size]` | query | integer | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A page of projects; meta.warnings may hold ai.allocation_above_budget or ai.limit_below_minimum_answer. | 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` |

## The caller's AI proposals across projects — waiting (pending) or decided — no access to the initiator's conversation follows from it

`GET /assist/approvals`

- Operation ID: `listAssistApprovals`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-13

| 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[view]` | query | string | no | R16 (XM-1085): waiting = the pending proposals the caller may decide, soonest expiry first; decided = the proposals that are no longer pending and name the caller as a reviewer, the newest state change first. The cursor is bound to the view. |
| `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 rows of the view, 25 per page, with the counts of both views (R16). | 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` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The person's assistant tokens of the current month

`GET /assist/budget/me`

- Operation ID: `getMyAssistantBudget`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-21

| 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 | Used, reserved and the limit (never above the tenant pool), and when the month resets. | 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` |

## The person's current workspace conversation with the assistant, or null

`GET /assist/conversation`

- Operation ID: `getMyAssistantConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-21

| 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. |
| `before` | query | string | no | The cursor of older turns (from links.older). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The newest 50 turns, oldest first; data is null when the person has no current 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` |

## Start a new workspace conversation ("New conversation")

`POST /assist/conversations`

- Operation ID: `startAssistantConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-21

| 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. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new, empty conversation; it is the person's current one. | 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` |

## Send a message to the assistant; the answer arrives through the run's events

`POST /assist/conversations/{conversationId}/messages`

- Operation ID: `sendAssistantMessage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-21

| 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. |
| `conversationId` | path | string (uuid) | yes |  |

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

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The run that answers; messageId is the person's message, replyId the assistant's answer. | 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` |
| 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` |

## Edit a person message — the conversation from it on is replaced, and the assistant answers again (G256, F-AST-21.R12)

`POST /assist/conversations/{conversationId}/messages/{messageId}/edit`

- Operation ID: `editAssistantMessage`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-21

| 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. |
| `If-Match` | header | string | yes | The resource version in quotes (05-api §7.1); missing answers 428, different answers 412. |
| `conversationId` | path | string (uuid) | yes |  |
| `messageId` | path | string (uuid) | yes | The person message to edit (a turn with editable true). |

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

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The run that answers the new message; messageId is the new person message, replyId the new answer. | application/json | `object` |
| 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` |
| 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` |
| 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` |

## Retry the answer — a new run for the same person message (G188, F-AST-21.R10)

`POST /assist/conversations/{conversationId}/messages/{messageId}/retry`

- Operation ID: `retryAssistantAnswer`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-21

| 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. |
| `conversationId` | path | string (uuid) | yes |  |
| `messageId` | path | string (uuid) | yes | The assistant answer to retry (the conversation's newest answer). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The new run; messageId is the same person message, replyId the new answer. | 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` |
| 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` |

## The caller's current conversation with one tenant or team space

`GET /assist/doc-spaces/{spaceId}/conversation`

- Operation ID: `getDocSpaceAssistConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-23

| 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. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The conversation, its messages re-authorised. | 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` |

## Start a new, empty conversation with one tenant or team space

`POST /assist/doc-spaces/{spaceId}/conversations`

- Operation ID: `startDocSpaceAssistConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-23

| 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. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.not_found. |
| `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 |
|---|---|---|---|
| 201 | The new conversation with no messages. | 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` |

## Ask one tenant or team space — a run whose answer arrives through the run's events

`POST /assist/doc-spaces/{spaceId}/messages`

- Operation ID: `askDocSpaceQuestion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-DOC-23

| 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. |
| `spaceId` | path | string (uuid) | yes | A space id; a hidden, foreign or purged space answers 404 doc_space.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): `AssistQuestionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The run, its answer message and its events URL. | 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` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The Youniton pages that the caller can open and that match a question — for the assistant's navigation answers

`GET /assist/pages`

- Operation ID: `findAssistPages`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-24

| 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 | What the person looks for, in their words. |
| `projectKey` | query | string | no | The project of the panel's page context — a hint only; used only when the caller can see it and the page's gate holds. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | At most 5 pages, best match first; an empty list when no page that the caller can open matches. | application/json | `object` |
| 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` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's AI budget line for the current period — the same counters as AI limits

`GET /assist/projects/{projectKey}/budget`

- Operation ID: `getAssistBudgetLine`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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 | Used, reserved, limit, the reset instant and whether the project is in cache-only mode. | 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` |

## The caller's current conversation in the project — messages re-authorised, the derived scope

`GET /assist/projects/{projectKey}/conversation`

- Operation ID: `getAssistConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `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 newest 50 messages (older ones by cursor); text only where released or not required and still valid. | 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` |

## Start a new, empty current conversation in the project (D-100)

`POST /assist/projects/{projectKey}/conversations`

- Operation ID: `startAssistConversation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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. |
| `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): `AssistConversationStart`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The new conversation with no messages. | 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` |

## The project-chat facade — start a project_question run in the conversation; the answer arrives through the run's events

`POST /assist/projects/{projectKey}/messages`

- Operation ID: `askProjectQuestion`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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. |
| `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): `AssistQuestionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The run, its answer message and its events URL. | 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` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The project's run history for the caller — their own runs; every run's summary for an Admin

`GET /assist/projects/{projectKey}/runs`

- Operation ID: `listAssistRuns`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-12

| 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. |
| `page[cursor]` | query | string | no | The opaque cursor of the previous page's links.next (05-api §5). |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | 25 runs per page, newest first. | 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` |

## The suggestion chips the caller may use in this project now

`GET /assist/projects/{projectKey}/suggestions`

- Operation ID: `listAssistSuggestions`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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. |
| `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 | 0–3 chips; disabled in cache-only mode; empty for client askers. | 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` |

## The workflows the caller may start in this project, with their parameters, intended outcome and proposed actions

`GET /assist/projects/{projectKey}/workflows`

- Operation ID: `listAssistWorkflows`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-11

| 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 catalogue entries for this caller; unavailable ones carry the reason. | 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` |

## The reviewer's projection of one proposal by its id alone — the notification deep link (R17)

`GET /assist/proposals/{proposal}`

- Operation ID: `getAssistProposalById`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-13

| 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. |
| `proposal` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The same projection as getAssistProposal; a superseded proposal names its newer version (supersededBy). | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Create a durable run of a workflow; 202 only after the run and its dispatch intent committed

`POST /assist/runs`

- Operation ID: `createAssistRun`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-11

| 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): `AssistRunRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The run exists; Location is /api/v1/assist/runs/{run}; follow eventsUrl. | 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` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The authorised snapshot of a run — status, progress, pending proposal, receipts, outcome; text only for its actor

`GET /assist/runs/{run}`

- Operation ID: `getAssistRun`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-12

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The snapshot; sequence is the cursor to continue the stream from. | 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` |

## Persist the cancel intent, fence new effects and answer 202 with the run's status; safe to repeat

`POST /assist/runs/{run}/cancel`

- Operation ID: `cancelAssistRun`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-14

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The cancel intent is recorded (CG-26) — the run's status and status version after it (cancelling, cancelled, or its terminal status if it had already ended); the run's events and snapshot report the end. | 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` |

## Request the catalogue's compensating action for one committed receipt, as a linked run that needs its own approval

`POST /assist/runs/{run}/compensations`

- Operation ID: `requestAssistCompensation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-15

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible 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): `AssistCompensationRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The compensation run; it proposes the inverse for approval. | 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` |
| 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` |

## The run's events after a cursor — text/event-stream, or paged JSON with Accept application/json

`GET /assist/runs/{run}/events`

- Operation ID: `streamAssistRunEvents`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-12

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |
| `after` | query | integer | no | The last event sequence the client holds; SSE's Last-Event-ID carries the same value. |
| `Last-Event-ID` | header | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | SSE (Cache-Control no-store, X-Accel-Buffering no) — run.status first, stored events in order, unavailable markers on replay, resync for a lost cursor, ping every 15 s; or a JSON page. | text/event-stream | `string` |
| 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` |

## The reviewer's projection of one exact proposal — items, targets with versions, before/after, recipients, expiry, state

`GET /assist/runs/{run}/proposals/{proposal}`

- Operation ID: `getAssistProposal`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-13

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |
| `proposal` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The proposal as this reviewer may see it; can tells whether they may approve or reject and which step-up is needed. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The confirmation card of the assistant's write, from its record

`GET /assist/runs/{run}/proposals/{proposal}/card`

- Operation ID: `getAssistantProposalCard`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-23

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |
| `proposal` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The proposal's state and the card; only the initiator reads it. | 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` |

## Approve or reject the exact proposal version and digest; a rejection always records

`POST /assist/runs/{run}/proposals/{proposal}/decision`

- Operation ID: `decideAssistProposal`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-13

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |
| `proposal` | 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): `AssistDecisionRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The recorded decision; for an approval the run is queued to resume (it may wait for a slot or a budget). | application/json | `object` |
| 401 | 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` |
| 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` |

## Prepare a fresh proposal for an expired or stale one — the run resumes and re-plans from current evidence

`POST /assist/runs/{run}/proposals/{proposal}/renew`

- Operation ID: `renewAssistProposal`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-15

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |
| `proposal` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The run's snapshot, queued to prepare the new 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` |
| 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` |

## Start a linked run again after a rejected proposal; nothing of the rejected proposal executes (R18)

`POST /assist/runs/{run}/proposals/{proposal}/start-again`

- Operation ID: `startAssistProposalAgain`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-13

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible are one 404. |
| `proposal` | 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 |
|---|---|---|---|
| 202 | The linked run (restart_of); follow its events URL. | 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` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Start a linked run of a failed, retryable run; committed receipts of the chain are never repeated

`POST /assist/runs/{run}/retry`

- Operation ID: `retryAssistRun`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-14

| 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. |
| `run` | path | string (uuid) | yes | The run id; unknown and not visible 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. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The linked run; follow its events URL. | 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` |
| 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` |

## Four starting points of the assistant panel

`GET /assist/suggestions`

- Operation ID: `listAssistantSuggestions`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-21

| 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 | Words only; a suggestion grants nothing. | 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` |

## Switch a project's AI (its Project chat module) and set its monthly limit

`PATCH /projects/{projectKey}/ai-settings`

- Operation ID: `updateAiProjectSettings`
- Call with: Session of the Youniton apps (app only)
- Feature: F-AST-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. |
| `projectKey` | path | string | yes | A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404. |
| `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): `AiProjectSettingsPatch`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The project's row after the change. | 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` |
