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

# Create an agent

> Creates a supervisor or react agent for this tenant — a knowledge-base Q&A agent included, as `react` with `graphId: qna_agent` — answering the same passthrough shape getAssistant returns. Build `config` in the shape listAssistants and getAssistant return for an existing agent of the same `deployment` — read one first and follow it. `metadata` is server-owned here: anything you send in it is IGNORED, and the created agent carries only the draft markers this endpoint stamps. The agent is created as a draft; a human reviews and publishes it in the ClaudIA app — it does not answer customers until then. This surface has no opt-out: there is no way to create an already-published agent here, and no way to attach the draft to an agent already in production.



## OpenAPI

````yaml api-reference/specs/claudia/v1.json POST /v1/tenants/{tenant}/assistants
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:
    post:
      tags:
        - Agents
      summary: Create an agent
      description: >-
        Creates a supervisor or react agent for this tenant — a knowledge-base
        Q&A agent included, as `react` with `graphId: qna_agent` — answering the
        same passthrough shape getAssistant returns. Build `config` in the shape
        listAssistants and getAssistant return for an existing agent of the same
        `deployment` — read one first and follow it. `metadata` is server-owned
        here: anything you send in it is IGNORED, and the created agent carries
        only the draft markers this endpoint stamps. The agent is created as a
        draft; a human reviews and publishes it in the ClaudIA app — it does not
        answer customers until then. This surface has no opt-out: there is no
        way to create an already-published agent here, and no way to attach the
        draft to an agent already in production.
      operationId: createAssistant
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAssistantRequest'
        required: true
      responses:
        '201':
          description: >-
            The agent as created — a draft, in the same passthrough shape
            getAssistant returns. A free-form object: read the keys rather than
            assuming a shape.
          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: >-
            The request names something that cannot be created: a missing
            `config.project`, a deployment that is not `supervisor`/`react`, or
            a config the live schema rejects. Nothing was created.
          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: >-
            A supervisor referencing this agent is being edited right now — a
            concurrent publish is holding the internal write lock. Nothing was
            created; retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            The config references something that does not exist on this tenant —
            a tool ref, an MCP server id, or a sub-agent. The body names which.
            Nothing was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit applied by the API gateway. Back off and retry.
components:
  schemas:
    CreateAssistantRequest:
      type: object
      required:
        - deployment
        - name
        - graphId
        - config
      properties:
        deployment:
          type: string
          enum:
            - supervisor
            - react
          description: >-
            Target deployment role: `supervisor` for an orchestrator agent,
            `react` for a specialist one. Any other value answers 400. There is
            no `qna` deployment to send: a knowledge-base Q&A agent is created
            as `react` with `graphId` set to `qna_agent`, and the platform
            derives its `deployment_role: qna` from that graph.
        name:
          type: string
          description: Human-readable agent name.
        description:
          type: string
          description: >-
            This assistant's own routing description. For a sub-agent it is what
            supervisors use to decide when to route to it, so make it rich and
            specific.
        config:
          type: object
          additionalProperties: true
          description: >-
            The config.configurable object. Build it in the shape
            listAssistants/getAssistant return for an existing agent of the same
            `deployment` — read one first and follow it. Send it as a JSON
            OBJECT, never as a JSON-encoded string, and always carrying
            `config.project` — a create without it is rejected with 400.
        graphId:
          type: string
          description: >-
            LangGraph graph id. `agent` is the graph both the supervisor and
            react deployments host, for orchestrators and regular specialists —
            the `deployment` field selects the target. `qna_agent`, together
            with `deployment: react`, creates a knowledge-base Q&A agent: its
            `config` carries `knowledge_base_ids` — ids from
            listMyKnowledgeBases, copied verbatim — instead of tool whitelists,
            and the platform reports it back with `deployment_role: qna`.
            Routing caveat: the supervisor's judge never offers a `qna_agent` as
            a routing option — a Q&A agent listed in a supervisor's `agents[]`
            is reached only through the start-with-agentic bypass on the
            customer's first message, not by regular routing on later turns.
        metadata:
          type: object
          additionalProperties: true
          description: >-
            Optional passthrough metadata. On this public surface it is
            server-owned: whatever you send here is dropped entirely, including
            `productionAssistantId` — the created agent carries only the draft
            markers this endpoint stamps.
      description: The agent to create.
    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

````