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

# Create agent

> The model is set automatically to gpt-4o-mini.



## OpenAPI

````yaml /api-reference/openapi.json post /agents
openapi: 3.1.0
info:
  title: Weav API
  version: 1.0.0
  description: |
    Public API for Weav workspace integrations.
    Base URL is versioned under /v1 and requires bearer token authentication.
    Token abilities are enforced:
    - `external-api:read` for read endpoints
    - `external-api:write` for write endpoints
    - `external-api:write` also grants read access
servers:
  - url: https://api.weav.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Agents
  - name: Companies
  - name: Conversations
  - name: Customers
  - name: Messages
  - name: Training Data
  - name: Webhooks
paths:
  /agents:
    post:
      tags:
        - Agents
      summary: Create agent
      description: The model is set automatically to gpt-4o-mini.
      operationId: createAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCreateRequest'
      responses:
        '201':
          description: Agent created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    AgentCreateRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
        avatar_url:
          type: string
          format: uri
          nullable: true
          maxLength: 500
        max_messages_per_session:
          type: integer
          minimum: 1
          maximum: 1000
          nullable: true
        tone:
          type: string
          nullable: true
          maxLength: 255
        response_length:
          type: string
          nullable: true
          maxLength: 255
        is_active:
          type: boolean
          nullable: true
    Agent:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          nullable: true
        avatar_url:
          type: string
          format: uri
          nullable: true
        max_messages_per_session:
          type: integer
          nullable: true
        tone:
          type: string
          nullable: true
        response_length:
          type: string
          nullable: true
        is_active:
          type: boolean
        is_copilot:
          type: boolean
        prohibited_phrases:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              phrase:
                type: string
              created_at:
                type: string
                format: date-time
                nullable: true
              updated_at:
                type: string
                format: date-time
                nullable: true
        escalation_rules:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              channel:
                type: string
                nullable: true
              rule:
                type: string
                nullable: true
              escalate_to:
                type: string
                format: uuid
                nullable: true
              created_at:
                type: string
                format: date-time
                nullable: true
              updated_at:
                type: string
                format: date-time
                nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error message
        code:
          type: string
          nullable: true
          example: UNAUTHENTICATED
        errors:
          type: object
          additionalProperties: true
          nullable: true
    ValidationError:
      type: object
      properties:
        message:
          type: string
          example: The given data was invalid.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Token
      description: |
        Workspace API token.
        Include abilities `external-api:read` and/or `external-api:write`.

````