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

# Create Agent

> Create a new AI voice agent for telephony.

Sets up a new AI phone agent with a custom system prompt, voice,
and greeting. Once created, buy a phone number and attach it to
this agent so it can make and receive calls autonomously.

Fields:
  - name: Display name for the agent
  - system_prompt: Instructions that define the agent's personality and behavior on calls
  - initial_greeting: What the AI agent says when the call connects
  - voice_id: TTS voice preset (e.g. "female-1") or Cartesia UUID
  - transfer_number: Phone number to transfer calls to (e.g. a human operator)
  - voicemail_message: Message the agent leaves if the call goes to voicemail



## OpenAPI

````yaml /openapi.json post /v1/agents
openapi: 3.1.0
info:
  title: AgentLine
  description: >-
    AgentLine gives every AI agent a real phone number, a human-like voice, and
    the ability to make and receive calls and SMS autonomously. This SDK covers
    the core developer surface: agents, numbers, calls, messages, events,
    webhooks, billing, and voice.
  version: 0.3.0
  summary: Phone numbers, voice, and SMS for AI agents.
  contact:
    name: AgentLine
    url: https://agentline.cloud
  license:
    name: MIT
    url: https://opensource.org/license/mit
servers:
  - url: https://api.agentline.cloud
    description: Production
security:
  - API Key or OAuth: []
paths:
  /v1/agents:
    post:
      tags:
        - Agents
      summary: Create Agent
      description: |-
        Create a new AI voice agent for telephony.

        Sets up a new AI phone agent with a custom system prompt, voice,
        and greeting. Once created, buy a phone number and attach it to
        this agent so it can make and receive calls autonomously.

        Fields:
          - name: Display name for the agent
          - system_prompt: Instructions that define the agent's personality and behavior on calls
          - initial_greeting: What the AI agent says when the call connects
          - voice_id: TTS voice preset (e.g. "female-1") or Cartesia UUID
          - transfer_number: Phone number to transfer calls to (e.g. a human operator)
          - voicemail_message: Message the agent leaves if the call goes to voicemail
      operationId: create_agent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - API Key or OAuth: []
components:
  schemas:
    AgentCreate:
      properties:
        name:
          type: string
          title: Name
          description: Display name for the AI voice agent
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
          description: >-
            Default instructions for the agent's personality and behavior on ALL
            calls (inbound and outbound). Can be overridden per-call via POST
            /v1/calls.
        initial_greeting:
          anyOf:
            - type: string
            - type: 'null'
          title: Initial Greeting
          description: >-
            Default opening line spoken on ALL calls (inbound and outbound),
            e.g. 'Hello, how can I help you today?'. Can be overridden per-call
            via POST /v1/calls.
        voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Voice Id
          description: >-
            TTS voice preset name (e.g. 'female-1', 'male-1') or Cartesia voice
            UUID; defaults to system voice if not set
        transfer_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Transfer Number
          description: >-
            Phone number in E.164 format to transfer calls to (e.g. a human
            operator fallback)
        voicemail_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Voicemail Message
          description: Message the AI agent leaves if the call goes to voicemail
        owner_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Phone
          description: >-
            Owner's phone number in E.164 format (e.g. '+12125551234'). Calls
            from this number enter task mode — the agent treats speech as
            executable instructions.
      additionalProperties: false
      type: object
      required:
        - name
      title: AgentCreate
    AgentOut:
      properties:
        id:
          type: string
          title: Id
          description: Unique agent identifier (e.g. 'agt_abc123')
        account_id:
          type: string
          title: Account Id
          description: Account that owns this agent
        name:
          type: string
          title: Name
          description: Display name of the AI voice agent
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
          description: Default system prompt for all calls (can be overridden per-call)
        initial_greeting:
          anyOf:
            - type: string
            - type: 'null'
          title: Initial Greeting
          description: Default greeting for all calls (can be overridden per-call)
        voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Voice Id
          description: TTS voice preset or Cartesia UUID
        transfer_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Transfer Number
          description: Phone number for call transfers
        voicemail_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Voicemail Message
          description: Message left on voicemail
        owner_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Phone
          description: Owner's phone number for task mode
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the agent was created
      type: object
      required:
        - id
        - account_id
        - name
        - created_at
      title: AgentOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    API Key or OAuth:
      type: http
      description: >-
        AgentLine API key. Get one via the email OTP flow (POST /v1/auth/otp
        then POST /v1/auth/verify). Pass as: Authorization: Bearer sk_live_...
      scheme: bearer
      bearerFormat: API key (sk_live_...)
      x-fern-bearer:
        name: apiKey
        env: AGENTLINE_API_KEY

````