Agents

Freeze the current draft into an immutable version and make it the live configuration for new sessions. Each new version gets the next version_number. If the draft already matches the live version, no version is created and the live version comes back with created: false.

The response describes what was published:

  • version_number and config_hash identify the version.
  • config is the configuration exactly as published. Check your read-back against it, not against the request you sent.
  • created tells whether this call made a new version.

Publishing copies the draft as it is stored. It does not change any field. Writes do normalize some values, see Update Draft Config.

The body is optional:

  • expected_config_hash publishes only while the draft still has that config_hash. Take it from Get Draft Config or Update Draft Config. On a mismatch the call returns 409 with reason: "draft_changed" and the draft's current config_hash. Nothing is written.
  • config applies draft changes first, in the same shape as Update Draft Config. The changes and the publish are one atomic step. If either fails, the draft stays as it was.
  • With both, expected_config_hash is checked against the draft before config is applied.
  • version_title and version_description label a new version.
post/v1/agent/agents/{agent_id}/publish

Request

  • Base URL
    https://api.fish.audio
  • URL
    https://api.fish.audio/v1/agent/agents/{agent_id}/publish
  • Auth
    HTTP bearer

Path parameters

agent_idstring required

Request body

version_titlestring

Optional label shown in the version history.

version_descriptionstring

Optional longer note for audit and rollback context.

expected_config_hashstring

Publish only while the draft has this config_hash. Otherwise 409 with reason draft_changed and nothing is written.

Response

Request fulfilled, document follows

version_numberinteger required
version_titlestring nullable
version_descriptionstring nullable
config_hashstring required
published_atstring date-time required
createdboolean required

Whether this call created a new version. False when the draft already matched the live version, which is returned unchanged.

Changes