> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudhumans.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Confirm an agent edit

> Second step of a safe edit. Send ONLY the confirmationId returned by proposeAssistantEdits, plus If-Match=baseUpdatedAt as a header — the server replays the exact proposal it stored and writes it; any other body field is ignored. PROPOSAL_NOT_FOUND (404) means the proposal expired: re-run proposeAssistantEdits with the same body and confirm again with the confirmationId it returns. The echo returns the persisted STRUCTURE (version, updated_at, config); prompt bodies come back as a stub — you already have the text, and readAssistantText re-reads it.

<Note>
  Second step of the propose → confirm flow. See
  [Propose an agent edit](/api-reference/claudia/endpoints/propose-assistant-edits)
  for the full walkthrough, with a complete request/response example.
</Note>


## OpenAPI

````yaml api-reference/specs/claudia/v1.json POST /v1/tenants/{tenant}/assistants/{id}/confirm-edits
openapi: 3.0.1
info:
  title: Claudia API
  version: 1.0.0
servers:
  - url: https://api.cloudhumans.com/claudia
    description: Production
  - url: https://api.cloudhumans.com/claudia/staging
    description: Staging
security:
  - bearerAuth: []
tags:
  - name: MCP Servers
    description: >-
      The MCP servers your agents can call tools on. Registering one here is
      what makes its tools selectable in an agent; the credentials it needs are
      stored encrypted and never read back.
  - name: Knowledge Base Content
    description: Read, search and edit the content that answers your customers.
  - name: Content Quality
    description: Rewrites proposed for content that is answering your customers badly.
  - name: Playground
    description: >-
      Talk to one of your agents as if you were a customer, without touching a
      real conversation.
  - name: Project Settings
    description: >-
      Read and change how a ClaudIA project behaves — the settings screens of
      the ClaudIA app, as an API.
  - name: Content Improvements
    description: Answers Claudia proposes for questions your content does not cover yet.
  - name: Knowledge Bases
    description: The knowledge bases your account can manage.
  - name: Content Sources
    description: The sites Claudia crawls to keep a knowledge base in sync.
  - name: Agents
    description: >-
      The AI agents (assistants) configured for your tenant: the orchestrator
      (supervisor) and its specialists (react). Reads answer the same
      passthrough shape the platform stores; creates land as DRAFTS a human
      reviews and publishes in the app.
  - name: Agent Tools
    description: >-
      The tool catalog your agents can be given, aggregated across every MCP
      server registered for the tenant. This is the same catalog an assistant's
      mcp_servers[].tools whitelist is validated against.
  - name: Conversations
    description: >-
      Read access to a conversation's lean investigation summary — messages,
      status and resolution — and the execution trace behind one of its
      processed messages, without the internal processing state the hub UI's
      full read carries.
paths:
  /v1/tenants/{tenant}/assistants/{id}/confirm-edits:
    post:
      tags:
        - Agents
      summary: Confirm a proposed edit (apply it)
      description: >-
        Second step of a safe edit. Send ONLY the confirmationId returned by
        proposeAssistantEdits, plus If-Match=baseUpdatedAt as a header — the
        server replays the exact proposal it stored and writes it; any other
        body field is ignored. PROPOSAL_NOT_FOUND (404) means the proposal
        expired: re-run proposeAssistantEdits with the same body and confirm
        again with the confirmationId it returns. The echo returns the persisted
        STRUCTURE (version, updated_at, config); prompt bodies come back as a
        stub — you already have the text, and readAssistantText re-reads it.
      operationId: confirmAssistantEdits
      parameters:
        - name: tenant
          in: path
          description: >-
            Tenant whose agents you are managing. Discover the tenants your
            credentials cover with `listMyClaudiaProjects`. A tenant your
            credentials do not cover is indistinguishable from one that does not
            exist.
          required: true
          schema:
            type: string
        - name: If-Match
          in: header
          description: >-
            The baseUpdatedAt returned by proposeAssistantEdits (the assistant's
            `updated_at` the anchors resolved against). Required: omitting it
            answers 428 PRECONDITION_REQUIRED with the guidance to send the
            propose's baseUpdatedAt. 412 = stale: re-read the assistant and
            re-run proposeAssistantEdits.
          required: true
          schema:
            type: string
        - name: id
          in: path
          description: >-
            Assistant to operate on, as returned by listAssistants
            (`assistant_id` field).
          required: true
          schema:
            type: string
        - name: role
          in: query
          description: >-
            Deployment the assistant lives in: `supervisor` (orchestrator
            agents) or `react` (specialist agents), plus `qna` for
            knowledge-base Q&A agents. Read them with that role; they are
            CREATED through proposeAssistantCreate as `deployment: react` with
            `graphId: qna_agent`, and the platform derives the `qna` role from
            the graph. listAssistants returns it as `deployment_role` on each
            row — pass that value back here verbatim. A `qna` agent follows the
            same draft rule as any other: only a draft accepts writes, and a
            published one answers 409 naming its draft.
          required: true
          schema:
            type: string
            enum:
              - supervisor
              - react
              - qna
      requestBody:
        description: Just the confirmationId returned by proposeAssistantEdits.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmEditsBody'
        required: true
      responses:
        '200':
          description: >-
            The persisted agent, in the same stubbed passthrough shape
            getAssistant returns.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                description: >-
                  Free-form object: the agent's stored configuration, in
                  whatever shape the live config schema for its deployment
                  accepts. Read the keys you need; do not assume a fixed set.
        '400':
          description: >-
            A caller-fixable rejection of this confirm: confirmationId missing
            from the body, or the stored proposal rejected at write time (an
            unknown `deployment`, a malformed `config.agents`, a config the live
            schema rejects).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, expired or invalid credentials.
        '403':
          description: The credentials hold no account allowed to manage this content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Either PROPOSAL_NOT_FOUND (the confirmationId has no stored proposal
            — it may have expired) or the tenant/id/project this token cannot
            reach.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Either DRAFT_REQUIRED (this assistant is published and cannot be
            edited directly) or supervisor_locked (a supervisor that references
            this agent is being edited right now — retry shortly).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '412':
          description: >-
            STALE_PRECONDITION: If-Match no longer equals the assistant's
            current updated_at. Re-read the assistant and re-run
            proposeAssistantEdits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            CONFIRMATION_MISMATCH (this confirmationId was not minted for this
            exact target) or a policy violation on the stored proposal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '428':
          description: 'PRECONDITION_REQUIRED: the If-Match header is missing.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit applied by the API gateway. Back off and retry.
components:
  schemas:
    ConfirmEditsBody:
      type: object
      required:
        - confirmationId
      properties:
        confirmationId:
          type: string
          description: >-
            Confirmation token returned by propose-edits; required. The server
            re-applies the proposal it stored for this token (send
            If-Match=baseUpdatedAt as a header).
      description: >-
        The confirmationId returned by propose-edits — the only field this
        endpoint reads.
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
          description: What went wrong.
          example: 'Forbidden: token holds no claim for the requested account'
      description: Something the caller needs to fix.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````