authed

Edit an agent as a draft

Save an edit to an agent's configuration as a draft revision; it isn't live until published with publish_agent_definition. Read the agent with get_agent_definition just before editing and pass its latest_revision.id as parent_revision_id and latest_revision.content_version as parent_content_version. If anyone changed the agent since that read, nothing is stored and you're told so: read it again, reapply your edit, and save again. The agent's configuration is checked the same way either way, and a refused configuration is described problem by problem.

post/api/v1/agent-definitions/{definition_id}/revisions

Request

  • Base URL
    https://api.teaflask.com (the document declares no server; this is the origin it was published from)
  • URL
    https://api.teaflask.com/api/v1/agent-definitions/{definition_id}/revisions
  • Auth
    none declared

Path parameters

definition_idstring uuid required

The agent's id, as list_agent_definitions returns it.

Request body

configobject required

The agent's whole configuration, "version": "agent/v1", shaped like get_agent_definition's latest_revision.config.

parent_revision_idstring uuid required

latest_revision.id from get_agent_definition, read just before editing.

parent_content_versioninteger required

latest_revision.content_version from the same read.

amend_working_draftboolean

Leave false unless re-saving a draft you just saved. When true and latest_revision is your own unpublished draft saved in the last 30 minutes and not yet run in the playground, that draft is updated in place and keeps its id; otherwise a new draft revision is added with a new id.

Response

The editor's open working draft was amended in place

idstring uuid required

The revision's id.

agent_definition_idstring uuid required

The agent it belongs to.

parent_revision_idstring uuid nullable required

The revision this one was edited from; null for the first.

configobject required

The agent's whole configuration: model (which model answers and how hard it thinks), routing (fallback models) and user_model_choice (whether visitors may pick the model); prompt (its system prompt); tools (what it may use: searching and reading docs, navigating, reading, highlighting and filling in pages of the organization's own app, calling the organization's API actions by slug, handing work to subagents, a code workspace, the page register); docs_scope and skills (which docs and skills it may read); memory (whether it remembers each signed-in visitor); suggestions (first questions offered to visitors); end_users (whether visitors must sign in or connect an AI subscription, and what they may spend before one is required); and steering and interventions (the checks that steer or stop its actions).

config_format'agent/v1' required

Versions of the agent config vocabulary; evolves additively, never in place.

status'draft' | 'published' | 'superseded' required
authored_by_user_idstring uuid required

The member who wrote it.

content_versioninteger required

Changes each time this revision is edited in place; send it back as parent_content_version.

created_atstring date-time required

When the revision was created.

updated_atstring date-time required

When the revision last changed: an edited draft or a status change.

Changes

No recorded changes to this operation across all 1 revision of this API.