Publishes a draft agent as a new version
Agents API
Agent Publish API
Publish a draft agent as a new version
POST
Publishes a draft agent as a new version
Documentation Index
Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
Use this file to discover all available pages before exploring further.
⚠️ Using our API via a dedicated deployment? Just replace
api.langdock.com with your deployment’s base URL: <deployment-url>/api/publicThis is the new Agents API with native Vercel AI SDK compatibility. If you’re using the legacy Assistants API, see the migration guide.
/agent/v1/update only affect the draft. Until you call publish, those changes are not visible to workspace members.
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
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | UUID of the agent to publish |
description | string | No | Short change description shown in version history (max 100 characters) |
Example
Response Format
Success Response (200 OK)
Validation Rules
- Agent access — The API key must have
owneroreditoraccess to the agent (same as Update). - Workspace match — The agent must belong to the same workspace as the API key.
- Agents only — Projects (
type=PROJECT) are not supported and will return403. - 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
| Status Code | Description |
|---|---|
| 400 | Invalid request body (missing or malformed agentId / description too long) |
| 401 | Invalid or missing API key |
| 403 | API key does not have edit access, the agent is in a different workspace, or the resource is a project |
| 409 | No draft changes to publish |
| 429 | Rate limit exceeded |
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.
Authorizations
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Body
application/json