Skip to main content

Apply a desired-state config document

POST 

/api/v1/chatbots/:chatbotId/apply

Declarative config-as-code apply. Diffs a desired-state document against the chatbot's CURRENT config and either returns the PLAN (dry-run) or executes it via the shared reconcile services. prune defaults to true: array sections (mcpServers, skills, domains) are AUTHORITATIVE — resources present on the chatbot but absent from the document are DELETED. Every delete is surfaced in the dry-run plan before any apply. prune:false = merge-only (create/update, never delete). Only sections present in spec are reconciled; absent sections are left untouched (never pruned). Scope model (least-privilege, per present section): dry-run requires the READ scope, apply the WRITE scope, of every section present, PLUS baseline chatbots:read (dry-run) / chatbots:write (apply). Section→scope: core/scopes→chatbots, mcpServers→mcp, skills→skills, accessProtection/externalApi/accessLists/telemetry→security, domains→domains. Execution stops on the FIRST failing op (apply is idempotent, so a stopped apply is recoverable after fixing the offending section); a partial failure returns HTTP 422 with the ops applied so far plus the offending op.

Request

Responses

Dry-run: the computed plan ({ dryRun:true, plan }). Apply (all ops succeeded): { dryRun:false, plan, applied, failed:null, config }.