Skip to main content
POST
Publishes one exact prompt draft version and makes its three prompt arrays the agent’s active configuration. Before calling this route, fetch the version with Get prompt draft version, compare it with Get prompts, and obtain explicit confirmation for that agent and version.
Publishing changes live agent behavior. A draft becomes stale when the published prompt changes after the draft was created. Fini rejects stale drafts instead of overwriting the newer configuration.

Headers

string
required
Bearer token containing your Fini workspace API key. Format: Bearer fini_... The key needs write scope.

Path parameters

string
required
Agent ID that owns the draft.
string
required
Exact reviewed draft version ID to publish.

Response

Returns the published lifecycle version.
string
Published lifecycle version ID. This matches versionId.
string
New active prompt record ID created from the draft.
string
Agent ID that now uses the published prompt.
number
Published lifecycle version number.
string
Returns PUBLISHED.
datetime
Publication timestamp.

Errors

The draft is stale because a different prompt version became published after this draft was created.
The API key is missing, malformed, revoked, or invalid.
The API key does not include write scope.
The version does not exist for this agent or is not a draft.
The agent belongs to a different workspace.