ai
POST /v1/ai/recipes/{recipeId}/run
Queue an AI posting recipe to run now.
Аутентификация
Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение links.edit; ключ без него отклоняется с кодом 403, а не 404.
Этот эндпоинт не принимает идентификатор организации. Ваш ключ уже определяет организацию, к которой он принадлежит, и ответ ограничивается ее рамками.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X POST https://api.zinndigital.com/v1/ai/recipes/{recipeId}/run \
-H "Authorization: Bearer zdk_live_…"Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
Returns as soon as the run is recorded — it does not wait for the article. Writing takes longer than an HTTP request may live: the dashboard aborts at 20s and the engine's own worker timeout is 30s, so a synchronous run was killed mid-call every time. The response carries a run whose state is queued; poll GET /v1/ai/recipes/{recipeId}/runs until it reaches succeeded, partial or failed. A queued run normally starts within two minutes. The work then happens on the customer's own key when they have one, on Zinn® AI credits otherwise — one meter either way (owner directive D4). What happens after the drafts exist is the recipe's publish_mode, which defaults to draft: nothing is scheduled or published unless the customer turned that on for that recipe. A 422 means nothing was queued and nothing was charged — funding is checked before the run is recorded, so an unaffordable run is refused here rather than failing later. Requires links.edit.
Параметры
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
recipeId (path) | Uuid | Да | — |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
id | Uuid | Да | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
recipe_id | Uuid | Да | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
trigger | string<manual, schedule> | Да | — |
state | string<queued, running, succeeded, partial, failed> | Да | ⛔ partial is a real state, not a rounding of failure: some posts were written and a later step failed. Telling the customer the run failed would make them run it again and pay… |
started_at | object | Нет | — |
finished_at | object | Нет | — |
posts_created | integer | Нет | — |
post_ids | string[] | Нет | — |
anchor_warnings | string[] | Нет | Anchors the model did not place verbatim, aggregated across the run so the customer sees it once instead of opening ten drafts to find out. |
funding | string | Нет | Who paid. byo means the article was written on the customer's own key and we charged nothing. |
model | string | Нет | — |
workflow_id | string | Нет | The durable execution, when there is one. |
error_code | string | Нет | A stable machine code for what went wrong, empty on a clean run. ⛔ Set on a partial run as well as a failed one — no_target_sites (the recipe schedules but names no site)… |
error | string | Нет | The engine's own English sentence, for a code a client does not recognise. ⛔ A client SHOULD render its own translated copy from error_code and fall back to this only for an… |
created_at | string | Да | — |
Ошибки, которые может возвращать этот эндпоинт
401 · 403 · 404 · 422 · 429