---
title: "Publishes a draft agent as a new version"
method: POST
path: "/agent/v1/publish"
tags: ["Agent Build"]
---

# Publishes a draft agent as a new version

`POST /agent/v1/publish`

## Request

- Base URL: `https://api.langdock.com`
- URL: `https://api.langdock.com/agent/v1/publish`
- Auth: HTTP bearer

Publishes the current draft of an agent as a new version. Mirrors the "Update" button in the agent editor — only agents (not projects) are supported, and the draft must differ from the latest published version.

## Request body

- object
  - `agentId` string, uuid, required: UUID of the agent to publish
  - `description` string: Optional change description shown in version history

## Response `200`

Agent published successfully

- object
  - `status` string, required
  - `message` string, required
  - `version` object, required
    - `id` string, uuid
    - `version` integer
    - `createdAt` string, date-time

## Other responses

- `403`: Agent not found, API key lacks edit access, agent is in a different workspace, or the resource is a project
- `409`: No draft changes to publish

## Changes

- **2026-11-03** `c62bf90b4013`: 1 info
  - endpoint added

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

---

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