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

# Create Agent

> This endpoint allows the creation of a new agent that can be utilized in the `POST /agents/{id}/v1/message:send` endpoint.




## OpenAPI

````yaml /agentic/auto-generated-openapi.yml post /agents
openapi: 3.1.1
info:
  title: Corti Agent API
  version: 0.1.0
  description: >
    The Corti Agent API allows users to interact with the Corti Agent, enabling
    the creation and management of threads, sending messages, and receiving
    responses.
servers: []
security: []
paths:
  /agents:
    post:
      tags:
        - Agents
      summary: Create Agent
      description: >
        This endpoint allows the creation of a new agent that can be utilized in
        the `POST /agents/{id}/v1/message:send` endpoint.
      operationId: agents_create
      parameters:
        - $ref: '#/components/parameters/Tenant-Name'
        - name: ephemeral
          in: query
          required: false
          description: >
            If set to true, the agent will be created as ephemeral, it won't be
            listed in the agents_list but can still be fetched by ID. Ephemeral
            agents will be deleted periodically.
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentsCreateAgent'
      responses:
        '201':
          description: Agent created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsAgent'
        '400':
          description: >
            The request could not be processed, possibly due to missing required
            fields or invalid data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
        '401':
          description: |
            Authentication is required to access this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
        '422':
          description: |
            The request body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsValidationErrorResponse'
      x-codeSamples:
        - lang: csharp
          label: C# .NET SDK
          source: |
            using Corti;

            var client = new CortiClient(
                "TENANT_NAME",
                CortiClientEnvironment.Eu,
                new CortiClientAuth.ClientCredentials("client_id", "client_secret")
            );
            await client.Agents.CreateAsync(
                new AgentsCreateAgent { Name = "name", Description = "description" }
            );
        - lang: javascript
          label: JavaScript SDK
          source: |
            import { CortiClient, CortiEnvironment } from "@corti/sdk";

            const client = new CortiClient({
                environment: CortiEnvironment.Eu,
                auth: {
                    clientId: "YOUR_CLIENT_ID",
                    clientSecret: "YOUR_CLIENT_SECRET"
                },
                tenantName: "YOUR_TENANT_NAME"
            });
            await client.agents.create({
                name: "name",
                description: "description"
            });
components:
  parameters:
    Tenant-Name:
      name: Tenant-Name
      in: header
      description: >-
        Identifies a distinct entity within Corti's multi-tenant system. Ensures
        correct routing and authentication of the request.
      required: true
      example: base
      schema:
        type: string
        description: >-
          Identifies a distinct entity within Corti's multi-tenant system.
          Ensures correct routing and authentication of the request.
        example: base
  schemas:
    AgentsCreateAgent:
      type: object
      required:
        - name
        - description
      properties:
        name:
          type: string
          description: The name of the agent.
        agentType:
          type: string
          description: Optional type of agent.
          enum:
            - expert
            - orchestrator
            - interviewing-expert
        systemPrompt:
          type: string
          description: >
            The system prompt that defines the overall agents behavior and
            expectations. This field is optional as there is a default system
            orchestrator.
        description:
          type: string
          description: A brief description of the agent's capabilities.
        experts:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/AgentsCreateExpert'
              - $ref: '#/components/schemas/AgentsCreateExpertReference'
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the agent can call. If omitted, the agent
            can't call any MCP servers.
          items:
            $ref: '#/components/schemas/AgentsCreateMCPServer'
    AgentsAgent:
      type: object
      required:
        - id
        - name
        - description
        - systemPrompt
      properties:
        id:
          type: string
          description: The unique identifier of the agent.
        name:
          type: string
          description: The name of the agent.
        description:
          type: string
          description: A brief description of the agent's capabilities.
        systemPrompt:
          type: string
          description: >-
            The system prompt that defines the overall agents behavior and
            expectations.
        experts:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/AgentsExpert'
              - $ref: '#/components/schemas/AgentsExpertReference'
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the agent can call. If omitted, the agent
            can't call any MCP servers.
          items:
            $ref: '#/components/schemas/AgentsMCPServer'
    AgentsErrorResponse:
      type: object
      required:
        - code
        - description
      properties:
        code:
          type: string
          description: |
            A machine-readable error code that identifies the type of error.
        description:
          type: string
          description: >
            A human-readable description of the error, providing more context
            about what went wrong.
        howToFix:
          type: string
          description: |
            A human-readable message describing how to fix the issue.
        details:
          type: object
          description: |
            An optional object containing additional details about the error.
          additionalProperties: true
        cause:
          type: object
          description: >
            An optional object containing the cause of the error, following the
            same structure as the parent error response.
          additionalProperties: true
    AgentsValidationErrorResponse:
      allOf:
        - $ref: '#/components/schemas/AgentsErrorResponse'
        - type: object
          properties:
            detail:
              type: array
              title: Detail
              items:
                $ref: '#/components/schemas/AgentsValidationError'
    AgentsCreateExpert:
      type: object
      required:
        - type
        - name
        - description
      properties:
        type:
          type: string
          enum:
            - new
        name:
          type: string
          description: The name of the expert. Must be unique.
          pattern: ^[a-zA-Z0-9_\.-]+$
        description:
          type: string
          description: A brief description of the expert's capabilities.
        systemPrompt:
          type: string
          description: >
            Optional system prompt that defines the expert's behavior and
            expectations.
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the expert can call. If omitted, the
            expert can't call any MCP Servers.
          items:
            $ref: '#/components/schemas/AgentsCreateMCPServer'
    AgentsCreateExpertReference:
      type: object
      required:
        - type
      description: >
        A reference to a registry expert when creating an agent, either id or
        name must be provided. If both are passed, the id will be used.
      properties:
        type:
          type: string
          enum:
            - reference
        id:
          type: string
          description: The unique identifier of the expert.
        name:
          type: string
          description: The name of the expert.
          pattern: ^[a-zA-Z0-9_\.-]+$
        systemPrompt:
          type: string
          description: >
            Optional. Additional system instructions appended to the default
            system prompt when creating an expert from the registry, extending
            the expert's behavior.
        config:
          type: object
          description: >
            Optional configuration override for the registry expert. Values
            provided here are deep-merged with the schema defaults declared on
            the registry expert and validated against its `configSchema`.
            Ignored when the registry expert has no schema.
          additionalProperties: true
    AgentsCreateMCPServer:
      type: object
      required:
        - name
        - transportType
        - authorizationType
        - url
      properties:
        name:
          type: string
          description: Name of the MCP server.
        description:
          type: string
          description: A brief description of the MCP server's capabilities.
        transportType:
          type: string
          description: Type of transport used by the MCP server.
          enum:
            - stdio
            - streamable_http
            - sse
        authorizationType:
          type: string
          description: Type of authorization used by the MCP server.
          enum:
            - none
            - bearer
            - inherit
            - oauth2.0
        authorizationScope:
          type: string
          description: OAuth2.0 authorization scope to request.
        url:
          type: string
          format: uri
          description: URL of the MCP server.
        redirectUrl:
          type: string
          format: uri
          description: Redirect URI for OAuth2.0 authorization.
        token:
          type: string
          description: Bearer token to be used in MCP client.
    AgentsExpert:
      type: object
      required:
        - id
        - type
        - name
        - description
        - systemPrompt
      properties:
        type:
          type: string
          enum:
            - expert
        id:
          type: string
          description: The unique identifier of the expert.
        name:
          type: string
          description: The name of the expert. Must be unique.
          pattern: ^[a-zA-Z0-9_\.-]+$
        description:
          type: string
          description: A brief description of the expert's capabilities.
        systemPrompt:
          type: string
          description: >
            The system prompt that defines the expert's behavior and
            expectations.
        mcpServers:
          type: array
          description: >
            A list of MCP servers that the expert can call. If omitted, the
            expert can't call any MCP Servers.
          items:
            $ref: '#/components/schemas/AgentsMCPServer'
    AgentsExpertReference:
      type: object
      required:
        - type
        - id
        - name
      description: >
        A reference to an expert returned by the API. The expert's id and name
        are always provided. systemPrompt is included only when a registry
        expert was created with a custom system prompt.
      properties:
        type:
          type: string
          enum:
            - reference
        id:
          type: string
          description: The unique identifier of the expert.
        name:
          type: string
          description: The name of the expert.
          pattern: ^[a-zA-Z0-9_\.-]+$
        systemPrompt:
          type: string
          description: >
            Optional. Additional system instructions appended to the default
            system prompt when creating an expert from the registry, extending
            the expert's behavior.
        resolvedConfig:
          type: object
          description: >
            The fully resolved configuration for this expert: schema defaults
            from the registry expert deep-merged with any `config` override
            supplied at creation. Present only when the source registry expert
            defined a `configSchema`.
          additionalProperties: true
    AgentsMCPServer:
      type: object
      required:
        - id
        - name
        - transportType
        - authorizationType
        - url
      properties:
        id:
          type: string
          description: Unique identifier for the MCP server.
        name:
          type: string
          description: Name of the MCP server.
        transportType:
          type: string
          description: Type of transport used by the MCP server.
          enum:
            - stdio
            - streamable_http
            - sse
        authorizationType:
          type: string
          description: Type of authorization used by the MCP server.
          enum:
            - none
            - bearer
            - inherit
            - oauth2.0
        authorizationScope:
          type: string
          description: OAuth2.0 authorization scope to request.
        url:
          type: string
          format: uri
          description: URL of the MCP server.
        redirectUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Redirect URI for OAuth2.0 authorization.
    AgentsValidationError:
      properties:
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        reason:
          type: string
          title: Reason
        howToFix:
          type: string
          title: How to Fix
        errors:
          type: array
          items:
            type: object
            properties:
              location:
                type: string
                title: Location
              reason:
                type: string
                title: Reason
          title: Errors
      type: object
      required:
        - msg
        - type
        - reason
        - howToFix
      title: AgentsValidationError

````