---
title: "Publish the current draft as a new immutable workflow version"
method: POST
path: "/v1/agents/{agent_id}/workflow/publish"
---

# Publish the current draft as a new immutable workflow version

`POST /v1/agents/{agent_id}/workflow/publish`

## Request

- Base URL: `https://api.skysay.ai`
- URL: `https://api.skysay.ai/v1/agents/{agent_id}/workflow/publish`
- Auth: none declared

Blocks with 400 if the compiled draft has validation errors, or if it has warnings the caller has not acknowledged -- warnings never block by themselves, but publishing an immutable version is where the author has to have seen them. The rejection lists the outstanding codes; send them back in acknowledged_warning_codes to proceed. Version numbering is monotonic per workflow; a call always pins the exact published version it started with.

## Path parameters

- `agent_id` string, required

## Request body

- object
  - `acknowledged_warning_codes` string[]: Warning codes the author has reviewed and accepted. Codes that are not currently raised are ignored.
  - `base_revision` integer: The draft revision this publish was reviewed against. The 409 body carries the current draft under 'current'. Omit to publish whatever the draft currently is.

## Response `201`

New published version

## Other responses

- `400`: Draft has validation errors, or unacknowledged warnings
- `404`: Agent has no workflow yet
- `409`: The draft was changed by someone else since base_revision; body carries the current draft under 'current'

---

[API](https://skmtc.dev/skysay/apis/skysay-api.md) · [All operations](https://skmtc.dev/skysay/apis/skysay-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skysay/apis/skysay-api/revisions/95b8c66f99aa?raw)
