---
title: "Publish an agent"
method: POST
path: "/api/v1/agent-definitions/{definition_id}/publish"
tags: ["authed"]
---

# Publish an agent

`POST /api/v1/agent-definitions/{definition_id}/publish`

## 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}/publish`
- Auth: none declared

Publish a draft revision of an agent: it becomes the configuration
live conversations run. Owners only. Publish only a revision you have
just read; one that isn't a draft is refused, and the configuration
is checked again, a refused one described problem by problem.

## Path parameters

- `definition_id` string, uuid, required: The agent's id, as list_agent_definitions returns it.

## Request body

- PublishAgentDefinitionRequest
  - `revision_id` string, uuid, required: The draft revision to publish, as get_agent_definition returns it.

## Response `200`

Successful Response

- AgentDefinitionResponse
  - `id` string, uuid, required: The agent's id.
  - `organization_id` string, uuid, required: The organization it belongs to.
  - `slug` string, required: The agent's unique short name.
  - `name` string, required: The agent's display name.
  - `kind` 'web' | 'slack', required: Where an agent answers; chosen at creation and never switched.
  - `published_revision_id` string, uuid, nullable, required: The revision live conversations run; null until the agent is first published.
  - `created_at` string, date-time, required: When the agent was created.
  - `updated_at` string, date-time, required: When the agent last changed.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `422`: Validation error
- `500`: Internal server error

## Changes

- **2026-11-03** `c6ac9fd6657f`: 6 info
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `401`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `403`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `404`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `405`
  - …2 more

[Operation history](https://skmtc.dev/teaflask/apis/teaflask-api/changes/api/v1/agent-definitions/:definition_id/publish/post.md)

---

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