ai
POST /v1/ai/proposals/{proposalId}/decision
Approve or reject one proposal.
Упълномощаване
Изпратете API ключ като носител (bearer token). Тази точка за достъп не указва конкретно разрешение в спецификацията, затова дайте на ключа си най-малкото необходимо и проверете отговора, вместо да правите предположения.
Този ендпойнт не изисква идентификатор на организация. Вашият ключ вече идентифицира организацията, към която принадлежи, и отговорът е ограничен до нея.
Опитайте
Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.
curl -X POST https://api.zinndigital.com/v1/ai/proposals/{proposalId}/decision \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "decision": <string<approve, reject>> }'Влязохте ли в профила си? API конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата
Детайли
Approving APPLIES the action, **under the approver's own permissions**. The caller must hold the permission the action itself requires, in the proposal's own organization — so approving can never reach further than the approver could reach by hand. A caller without it gets a `404`, never a `403`: answering "forbidden" would confirm the proposal exists. ⛔ Not idempotent and not retryable. A second approval of an already-decided proposal is a `422`, which is the correct answer — a retry that applied the change twice would be a second cache purge or a second policy write nobody asked for.
Параметри
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
proposalId (path) | Uuid | Да | — |
Тяло на заявката
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
decision | string<approve, reject> | Да | — |
reason | string | Не | — |
Отговор
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
id | Uuid | Да | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
action | string | Да | — |
conversation_id | Uuid | Не | The AI conversation this came out of, or `null` for one raised by a scheduled review. ⭐ Lets a chat surface show its own suggestions without a second endpoint, and lets `/ai` sa… |
action_title | string | Да | — |
target_label | string | Не | — |
rationale | string | Не | Why, citing the measurement. This is what a person reads before approving. |
state | AgentProposalState | Да | — |
mode | AgentProposalMode | Да | How an approved proposal executes — decided by the authority ladder at the moment of approval, never frozen when the proposal was written. `attended` is a person clicking; `cana… |
reversibility | string<automatic, self_healing, manual> | Не | Whether this change can be put back, carried on the proposal itself so a client rendering an undo control does not have to join this list against the capability catalogue — a se… |
approval_means | string | Не | — |
outcome | string | Не | — |
proposed_by | string | Не | — |
created_at | string | Да | — |
decided_at | object | Не | — |
applied_at | object | Не | — |
reverted | boolean | Не | — |
Грешки, които този крайpoint може да върне
401 · 404 · 422 · 429