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

# Create agent



## OpenAPI

````yaml POST /v1/agents
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.3
  description: >-
    Build and deploy PolyAI agents programmatically. Create agents, manage
    branches, update behavior rules, configure knowledge bases, provision
    telephony, publish deployments, and update real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.eu.poly.ai
    description: EU region
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Create, list, duplicate, and delete agents.
  - name: Branches
    description: Create isolated branches for parallel development and merge back to main.
  - name: Agent Behavior
    description: >-
      Read and update an agent's behavior rules (system prompt, interaction
      style, edge cases).
  - name: Knowledge Base
    description: Manage knowledge base topics used for retrieval and tool invocation.
  - name: Variants
    description: Manage site-specific variations of an agent using attributes and variants.
  - name: Deployments
    description: Publish drafts, promote across environments, and roll back deployments.
  - name: Connectors
    description: >-
      Manage telephony connectors that bind phone numbers to voice
      infrastructure.
  - name: Phone Numbers
    description: Provision, reassign, and delete phone numbers on an agent's connectors.
  - name: Real-Time Configs
    description: Update runtime values (e.g. opening hours) outside the publish workflow.
paths:
  /v1/agents:
    post:
      tags:
        - Agents
      summary: Create agent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentBody'
      responses:
        '200':
          description: Created agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAgentResponse'
components:
  schemas:
    CreateAgentBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        agentId:
          type: string
          pattern: ^[a-zA-Z0-9-]+$
        responseSettings:
          type: object
          properties:
            greeting:
              type: string
              minLength: 1
            languageCode:
              type: string
              minLength: 1
              default: en-GB
          required:
            - greeting
          additionalProperties: false
        voiceSettings:
          type: object
          properties:
            voiceId:
              type: string
              minLength: 1
          required:
            - voiceId
          additionalProperties: false
        llmSettings:
          type: object
          properties:
            modelId:
              type: string
          additionalProperties: false
        experimentalConfig:
          type: object
          properties:
            configs:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  features:
                    type: object
                    additionalProperties: {}
                  createdAt:
                    type: string
                  createdBy:
                    type: string
                  updatedAt:
                    type: string
                  updatedBy:
                    type: string
                  active:
                    type: boolean
                required:
                  - id
                  - features
                  - createdAt
                  - createdBy
                  - updatedAt
                  - updatedBy
                  - active
                additionalProperties: false
          required:
            - configs
          additionalProperties: false
      required:
        - name
        - responseSettings
        - voiceSettings
      additionalProperties: false
      title: CreateAgentBody
    CreateAgentResponse:
      type: object
      properties:
        accountId:
          type: string
        agentId:
          type: string
        agentName:
          type: string
        createdAt:
          type: string
        updatedAt:
          type: string
        branchCount:
          type: number
      required:
        - accountId
        - agentId
        - agentName
        - createdAt
        - updatedAt
        - branchCount
      additionalProperties: false
      title: CreateAgentResponse
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````