Skip to main content
Updates an existing agent in your workspace. Only the fields you provide will be updated, allowing for partial updates without affecting other configuration.

Before You Start

  • API key scope: Requires an API key with the Agent API scope and edit access to the agent you want to update.
  • 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.
  • Draft settings: Configuration changes apply to the agent’s draft. Access changes take effect immediately and do not require publishing.

Base URL

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

Update Behavior

The update endpoint uses partial update semantics with specific behavior for different field types:
  • Partial updates - Only fields provided in the request are updated; omitted fields remain unchanged
  • Array fields replace - actions, inputFields, conversationStarters, attachments, knowledgeFolderIds, skillIds, subAgents, and workflowIds completely replace existing values when provided
  • Empty arrays - Send [] to remove all actions, fields, or attachments. For skillIds, [] detaches every Skill and leaves file template attachments in place. For subAgents and workflowIds, [] detaches every subagent or workflow
  • Null handling - Send null for emoji to clear it, and null for icon to remove the uploaded image. Omit icon to keep the current image. Setting icon does not clear emoji. For description and instruction, send an empty string "" to clear them
  • Unchanged fields - Fields not included in the request retain their current values

Parameters

Set any of the parameters below to overwrite the agent’s current settings. Fields you omit stay unchanged. Only agentId is required.
The dataAnalyst parameter is deprecated and has no effect. Requests that include it still succeed for backward compatibility, but Langdock ignores the value and does not enable file or code execution. Omit this parameter from new integrations.
Array fields (actions, inputFields, conversationStarters, attachments, knowledgeFolderIds, skillIds, subAgents, workflowIds) are replaced entirely, not merged. Always provide the complete desired array, including any existing items you want to keep.

Access Configuration

Use the access fields to add, change, or revoke individual grants. Omitted targets and empty arrays leave existing access unchanged. Revoking a direct grant does not remove access inherited through a group or the workspace; grants to inactive or former users can also be revoked. Access changes require an explicit editor or owner grant on the API key. A personal key owner’s edit access does not count for these changes. The key owner’s workspace sharing permissions also apply. Access changes are rejected when sharingManagedByAdmin is true.
New user and group grants send in-app notifications after saving. Repeated grants, role changes, and revocations do not send notifications. No email is sent.

Actions Configuration

Each action in the actions array should contain:
  • actionId (required) - UUID of the action
  • requiresConfirmation (optional) - Whether to require user confirmation before executing (default: true)
New ids must belong to an integration enabled in your workspace. Ids already on the draft follow the validation rules below.

Input Fields Configuration

For inputFields array structure, see the Create Agent API documentation.

Examples

Updating Basic Properties

Validation Rules

The API enforces several validation rules:
  • Agent access - A personal key can update configuration 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 that grant on the key. The User role and workspace admin status do not grant configuration updates.
  • Workspace match - Agent must belong to the same workspace as your API key
  • Model - If provided, must be in your workspace’s active models list
  • Actions - If provided, the array replaces the draft list. Omit an id to remove it.
  • Draft action ids - Missing or soft-deleted ids already on the draft are dropped. Unavailable ids already on the draft stay.
  • New action ids - Must exist and belong to integrations enabled in your workspace. Otherwise the request returns 400 with missingActionIds or unavailableActionIds.
  • Attachments - If provided, must exist in your workspace and not be deleted
  • Folders - If provided, must exist in your workspace and not be deleted
  • Skills - If provided, each ID must be a Skill the key owner can attach. File templates are rejected. A missing Skill returns 400 with missingSkillIds. A Skill the owner cannot attach returns 400 with inaccessibleSkillIds
  • Draft subagent and workflow ids - Ids already on the draft are kept without a new check. Workflows does not need to be enabled for those ids.
  • New subagents - Each new agentId must be an agent in your workspace that the key owner can use. Direct only, attaching the agent to itself, and cycles are rejected. A missing agent returns 400 with missingSubAgentIds. An agent the owner cannot use, or one set to Direct only, returns 400 with inaccessibleSubAgentIds. A cycle or attaching the agent to itself returns 400 with cyclicSubAgentIds
  • New workflows - Each new ID must be an active workflow the key owner can use. The key owner needs Workflows enabled. When it is not, new ids return 400 with inaccessibleWorkflowIds. Otherwise a missing workflow, including a template, returns 400 with missingWorkflowIds, and an inactive workflow returns 400 with inactiveWorkflowIds. A workflow the owner cannot use returns 400 with inaccessibleWorkflowIds
  • Sharing - Sharing permissions and targets are validated before any changes are saved
  • Name - If provided, must be between 1-80 characters
  • Description - If provided, maximum 800 characters
  • Instruction - If provided, maximum 50000 characters
  • Creativity - If provided, must be between 0 and 1

Response Format

agent.access is included only when the API key has an explicit editor or owner grant on the agent. It lists direct user, group, and workspace grants, excluding owner and API-key grants. sharingManagedByAdmin is read-only; when true, sharing cannot be changed through this API.

Success Response (200 OK)

preservedUnavailableActionIds is included only when the request kept unavailable ids that were already on the draft.

Error Handling

Best Practices

Preserving existing values: When updating array fields like actions or attachments, always include existing items you want to keep, as the entire array is replaced.
  1. Fetch before update - If you need to preserve existing array values, fetch the editable draft first with version=draft. Default GET returns the published version when one exists, otherwise the draft.
  2. Incremental updates - Update only the fields that need to change
  3. Validate attachments - Ensure attachment UUIDs are valid before including them
  4. Keep draft actions - Resubmit every action id you want to keep. Missing ids already on the draft are dropped. Unavailable ids already on the draft stay.
  5. Handle errors gracefully - Implement proper error handling for validation failures
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.