Skip to main content
Publishes the current draft of an agent as a new version. This mirrors the Update button in the agent editor: a published version is a frozen snapshot of the draft that becomes the active version users see.

Before You Start

  • Legacy Assistants API: This is the new Agents API with native Vercel AI SDK compatibility. If you’re using the legacy Assistants API, see the migration guide.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Draft vs. Published Version

Configuration changes made via /agent/v1/update only affect the draft. Until you call publish, those changes are not visible to workspace members. Access changes take effect immediately and do not require publishing.

Use Cases

  • Promote draft edits made via the Update API into a new active version
  • Roll out changes programmatically as part of a CI/CD pipeline
  • Release a new revision with an optional change description shown in version history

Parameters

Example

Response Format

Success Response (200 OK)

Validation Rules

  • Agent access — A personal key can publish when its owner can edit the agent, including through a group or the workspace, or when the key has an editor or owner grant. A workspace key needs an editor or owner grant on the key.
  • Workspace match — The agent must belong to the same workspace as the API key.
  • Agents only — Projects (type=PROJECT) are not supported and will return 403.
  • Has draft changes — The draft must differ from the latest published version. Publishing with no pending changes returns 409 Conflict, mirroring the disabled “Update” button in the UI.

Error Handling

Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.