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

# Create a new inbound agent



## OpenAPI

````yaml post /inbound-agents
openapi: 3.0.0
info:
  title: ClearTalk API
  description: The ClearTalk API Documentation
  version: '1.0'
  contact:
    name: Developer Support
    email: devsupport@cleartalk.ai
servers:
  - url: https://api.cleartalk.ai
    description: ClearTalk AI API Server
security: []
tags: []
paths:
  /inbound-agents:
    post:
      tags:
        - inbound-agents
      summary: Create a new inbound agent
      operationId: InboundAgentsController_createAgent
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInboundAgentDto'
      responses:
        '201':
          description: Agent created successfully
      security:
        - apiKey: []
components:
  schemas:
    CreateInboundAgentDto:
      type: object
      properties:
        phoneNumber:
          type: string
          example: '+1234567890'
          description: Phone number for the inbound agent
        agentName:
          type: string
          example: Agent Name
          description: Name of the agent
        task:
          type: string
          example: Task description
          description: Task or prompt for the agent
        selectedVoice:
          type: string
          example: en-US-Standard-A
          description: Voice for the agent
        background_track:
          type: string
          example: none
          description: Background track for the agent
        noise_cancellation:
          type: boolean
          example: false
          description: Whether to enable noise cancellation
        model:
          type: string
          example: gpt-4
          description: AI model to use
        max_duration:
          type: number
          example: 300
          description: Maximum duration in seconds
        interruptionThreshold:
          type: number
          example: 1000
          description: Interruption threshold
        firstSentence:
          type: string
          example: Hello!
          description: First sentence to say
        selectedLanguage:
          type: string
          example: en
          description: Language for the agent
        voice_settings:
          example:
            speed: 1
          description: Voice settings
          allOf:
            - $ref: '#/components/schemas/VoiceSettings'
        waitForGreeting:
          type: boolean
          example: true
          description: Whether to wait for greeting
        temperature:
          type: number
          example: 0.7
          description: Temperature for AI responses
        pathwayID:
          type: string
          example: pathway-123
          description: Pathway ID
        tools:
          example:
            - tool1
            - tool2
          description: Tools to use
          type: array
          items:
            type: string
        knowledgeName:
          type: string
          example: Knowledge base name
          description: Name of the knowledge base
        knowledgeBases:
          example:
            - name: kb1
              content: content1
          description: Knowledge base data
          type: array
          items:
            type: string
        metadata:
          type: object
          example:
            key: value
          description: Additional metadata
        transferPhoneNumber:
          example:
            - transfer_type: default
              transfer_number: '+1234567890'
          description: Transfer phone numbers
          type: array
          items:
            $ref: '#/components/schemas/TransferPhoneNumber'
        appointmentAgent:
          type: boolean
          example: true
          description: Whether this is an appointment agent
        calendarID:
          type: string
          example: cal-123
          description: Calendar ID
        calendarName:
          type: string
          example: My Calendar
          description: Calendar name
        questionsData:
          example:
            - question: How are you?
              questionType: greeting
          description: Questions for the agent
          type: array
          items:
            $ref: '#/components/schemas/QuestionData'
        customTool:
          example:
            - name: tool1
              description: Tool 1 description
          description: Custom tools
          type: array
          items:
            type: string
        inboundCustomTool:
          example:
            - name: tool1
              description: Tool 1 description
          description: Custom tools
          type: array
          items:
            type: string
        from:
          type: string
          example: '+1234567890'
          description: Phone number to call from
        block_interruptions:
          type: boolean
          example: false
          description: Whether to block interruptions
        keywords:
          example:
            - keyword1
            - keyword2
          description: Keywords to boost in transcription
          type: array
          items:
            type: string
        pronunciationGuide:
          example:
            - word: example
              pronunciation: ex-am-ple
              case_sensitive: false
              spaced: false
          description: Pronunciation guide for specific words
          type: array
          items:
            type: string
        timezone:
          type: string
          example: America/Los_Angeles
          description: Timezone for the call
        request_data:
          type: object
          example:
            name: John Doe
            age: 30
          description: Request data available to the AI agent during the call
        start_time:
          type: string
          example: '2024-03-20 12:00:00 -05:00'
          description: Scheduled start time for the call
        voicemail_message:
          type: string
          example: Please leave a message after the beep
          description: Message to leave on voicemail
        voicemail_action:
          type: string
          example: hangup
          description: Action to take when voicemail is detected
          enum:
            - hangup
            - leave_message
            - ignore
        retry:
          example:
            wait: 10
            voicemail_action: leave_message
            voicemail_message: Hello, this is a test message.
          description: Retry configuration for voicemail calls
          allOf:
            - $ref: '#/components/schemas/RetryConfig'
        record:
          type: boolean
          example: true
          description: Whether to record the call
        webhook_events:
          example:
            - queue
            - call
            - latency
          description: Events to stream to webhook
          type: array
          items:
            type: string
        citation_schema_id:
          type: string
          example: dcad76eb-57b6-4be6-922f-8a5a95e2ffrt
          description: Citation schema ID for post-call analysis
        analysis_preset:
          type: string
          example: a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7
          description: Analysis preset UUID
        answered_by_enabled:
          type: boolean
          example: true
          description: Whether to enable answered-by detection
        available_tags:
          example:
            - got_full_name_and_number
            - no_information_provided
          description: Available disposition tags
          type: array
          items:
            type: string
        geospatial_dialing:
          type: string
          example: bd039087-decb-435a-a6e3-ca1ffbf89974
          description: Geospatial dialing pool UUID
        precall_dtmf_sequence:
          type: string
          example: 1234567890*#w
          description: DTMF sequence to play before call starts
        pool_id:
          type: string
          example: '#1234-5678-9012-3456'
          description: Pool ID
        memory_id:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
          description: UUID of the memory to associate with this agent
        webhook_config:
          description: Webhook configuration
          allOf:
            - $ref: '#/components/schemas/WebhookDto'
        get_data:
          description: Get data configuration
          allOf:
            - $ref: '#/components/schemas/GetDataConfig'
      required:
        - phoneNumber
        - agentName
        - task
        - selectedVoice
        - background_track
        - noise_cancellation
        - model
        - max_duration
        - interruptionThreshold
        - firstSentence
        - selectedLanguage
        - voice_settings
        - waitForGreeting
        - temperature
        - pathwayID
        - tools
        - knowledgeName
        - knowledgeBases
        - metadata
        - transferPhoneNumber
        - appointmentAgent
        - calendarID
        - calendarName
        - questionsData
        - customTool
        - inboundCustomTool
        - from
        - block_interruptions
        - keywords
        - pronunciationGuide
        - timezone
        - request_data
        - start_time
        - voicemail_message
        - voicemail_action
        - retry
        - record
        - webhook_events
        - citation_schema_id
        - analysis_preset
        - answered_by_enabled
        - available_tags
        - geospatial_dialing
        - precall_dtmf_sequence
        - pool_id
    VoiceSettings:
      type: object
      properties:
        speed:
          type: number
          example: 1
          description: Voice speed
      required:
        - speed
    TransferPhoneNumber:
      type: object
      properties:
        transfer_type:
          type: string
          example: operator
          description: transfer to
        transfer_number:
          type: string
          example: '+1234567890'
          description: Phone number for transfer
      required:
        - transfer_type
        - transfer_number
    QuestionData:
      type: object
      properties:
        question:
          type: string
          example: How are you?
          description: Question text
        questionType:
          type: string
          example: greeting
          description: Type of question
      required:
        - question
        - questionType
    RetryConfig:
      type: object
      properties:
        wait:
          type: number
          example: 10
          description: Delay in seconds before retry
        voicemail_action:
          type: string
          example: leave_message
          description: Action to take on voicemail
          enum:
            - hangup
            - leave_message
            - ignore
        voicemail_message:
          type: string
          example: Hello, this is a test message.
          description: Message to leave on voicemail
      required:
        - wait
        - voicemail_action
        - voicemail_message
    WebhookDto:
      type: object
      properties:
        name:
          type: string
          example: WEBHOOK JSON TEMPLATES
          description: Webhook name
        description:
          type: string
          example: TEMPLATES
          description: Webhook description
        speech:
          type: string
          example: speech
          description: Speech text for the agent
        url:
          type: string
          example: https://templates.com
          description: Webhook URL
        method:
          type: string
          example: POST
          description: HTTP method
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
        headers:
          type: object
          example:
            Authorization: '########'
            Content-Type: application/json
          description: HTTP headers as key-value pairs
        body:
          type: object
          example:
            BODY1: LOREM
            BODY2: LOREM
          description: Request body as key-value pairs
        timeout:
          type: number
          example: 10000
          description: Timeout in milliseconds
      required:
        - name
        - description
        - speech
        - url
        - method
        - headers
        - body
        - timeout
    GetDataConfig:
      type: object
      properties:
        name:
          type: string
          example: name getdata
        description:
          type: string
          example: getdata description
        speech:
          type: string
          example: GETDATA SPEECH8
        url:
          type: string
          example: url get data
        method:
          type: string
          example: GET
          enum:
            - GET
            - POST
            - PUT
            - DELETE
        headers:
          type: object
          example:
            clave: valor
        body:
          type: object
          example: {}
        query:
          type: object
          example: {}
        input_schema:
          type: object
          example: {}
        response:
          type: object
          example:
            valor: clave
        timeout:
          type: number
          example: 10000
      required:
        - name
        - description
        - speech
        - url
        - method
        - headers
        - body
        - query
        - input_schema
        - response
        - timeout
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````