> ## 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.

# Delete a draft agent

> Permanently deletes a DRAFT agent — only drafts can be removed through this API, published agents are managed in the ClaudIA app. Irreversible: there is no undo, and nothing previews the deletion first, so confirm the target with getAssistant before calling this. `id` is the `assistant_id` listAssistants returned; `role` is that row's `deployment_role` — the same pair getAssistant takes. Deleting a draft that a draft supervisor routes to ALSO removes that reference from the supervisor — the routing entry goes with the agent. A draft referenced by an agent this API cannot modify (a published supervisor, or one in a project outside your token) answers 409 instead: remove the reference in the ClaudIA app first. Deleting a draft anchored to a published agent (`metadata.productionAssistantId`) also discards any pending proposed edits it held — they live on the draft.

<Note>
  409 covers three distinct causes: the agent is not a draft (only drafts can
  be deleted); a draft supervisor referencing this agent is being edited right
  now and holds its lease (retry shortly); or this draft is referenced by an
  agent this API cannot modify — a published supervisor, or one in a project
  outside your token (remove the reference in the ClaudIA app first).
</Note>


## OpenAPI

````yaml api-reference/specs/claudia/v1.json DELETE /v1/tenants/{tenant}/assistants/{id}
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}:
    delete:
      tags:
        - Agents
      summary: Delete a draft agent
      description: >-
        Permanently deletes a DRAFT agent — only drafts can be removed through
        this API, published agents are managed in the ClaudIA app. Irreversible:
        there is no undo, and nothing previews the deletion first, so confirm
        the target with getAssistant before calling this. `id` is the
        `assistant_id` listAssistants returned; `role` is that row's
        `deployment_role` — the same pair getAssistant takes. Deleting a draft
        that a draft supervisor routes to ALSO removes that reference from the
        supervisor — the routing entry goes with the agent. A draft referenced
        by an agent this API cannot modify (a published supervisor, or one in a
        project outside your token) answers 409 instead: remove the reference in
        the ClaudIA app first. Deleting a draft anchored to a published agent
        (`metadata.productionAssistantId`) also discards any pending proposed
        edits it held — they live on the draft.
      operationId: deleteAssistant
      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: 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
      responses:
        '204':
          description: The draft was deleted.
        '400':
          description: The request could not be answered as written.
          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: >-
            No such resource, or none these credentials can reach — the two are
            deliberately indistinguishable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Either the assistant is not a draft — only drafts can be deleted
            through this API — or a supervisor referencing this agent is being
            edited right now and holds its lease; retry shortly in the second
            case.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            `id` is not a full assistant id — typically a truncated one echoed
            back from an earlier answer. Carries `error`
            (`invalid_assistant_id`) and `message`, which names the full
            candidates the prefix matches so you can retry with one of them.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: >-
                      Machine-readable cause — always `invalid_assistant_id` on
                      this response.
                  message:
                    type: string
                    description: >-
                      Names the full assistant ids the truncated one you sent
                      matches, with each candidate's deployment role.
                additionalProperties: true
                description: >-
                  Carries `error` (always `invalid_assistant_id`) and `message`,
                  which names the full assistant ids the truncated one you sent
                  matches, with each candidate's deployment role.
        '429':
          description: Rate limit applied by the API gateway. Back off and retry.
components:
  schemas:
    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

````