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

# Create Bot

> Create a new bot with specified configuration.



## OpenAPI

````yaml post /v1/bots
openapi: 3.1.0
info:
  title: OpenMic v1 External API
  description: >-
    API specification for OpenMic v1 External API, providing endpoints for bot
    management, call handling, and phone number operations.
  version: 1.0.0
servers:
  - url: https://api.openmic.ai
    description: Production Environment
security:
  - api_key: []
tags:
  - name: Calls
    description: Endpoints related to phone call creation and management.
  - name: Bots
    description: Endpoints related to bot management and configuration.
  - name: Phone Numbers
    description: Endpoints related to phone number management and bot linking.
  - name: Knowledge Bases
  - name: FAQs
  - name: Campaigns
  - name: Tools
  - name: Contact Lists
  - name: Contacts
  - name: Voices
    description: >-
      Endpoints for browsing available text-to-speech voices. Voices are
      read-only and can be filtered by gender, provider, language, and accent.
  - name: SMS
    description: Endpoints for sending SMS messages.
paths:
  /v1/bots:
    post:
      tags:
        - Bots
      summary: Create Bot
      description: Create a new bot with specified configuration.
      requestBody:
        description: Bot configuration details
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBotRequest'
            example:
              name: Customer Support Bot
              prompt: >-
                You are a helpful customer support assistant. Be polite,
                professional, and always try to resolve customer issues.
              first_message: >-
                Hello! I'm here to help you with any questions or concerns you
                may have. How can I assist you today?
              knowledge_base_id: 123
              voice_provider: OpenAI
              voice: alloy
              voice_model: tts-1
              voice_speed: 1
              llm_model_name: gpt-4
              llm_model_temperature: 0.7
              stt_provider: Deepgram
              stt_model: nova-2
              call_settings:
                max_call_duration: 10
                silence_timeout: 15
                silence_timeout_max_retries: 3
                silence_timeout_message: I didn't hear anything. Are you still there?
                call_recording_enabled: true
                voicemail_detection_enabled: true
                voicemail_action: leave_message
                voicemail_message_type: static
                voicemail_message: >-
                  Hey, sorry we couldn't reach you directly. Please give us a
                  callback if you can.
                hipaa_compliance_enabled: false
                pci_compliance_enabled: false
              advanced_settings:
                agent_personality: friendly
                humanize_conversation: true
                background_noise_reduction: true
                allow_interruptions: true
                min_interruption_duration: 0.5
                agent_response_length: normal
                short_pause: 0.3
                long_pause: 1
              post_call_settings:
                summary_prompt: >-
                  Provide a brief summary of the customer interaction and any
                  action items.
                success_evaluation_prompt: >-
                  Rate the success of this call on a scale of 1-10 based on
                  customer satisfaction.
                success_evaluation_rubric_type: NUMERIC_SCALE
      responses:
        '201':
          description: Bot created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotResponse'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid request format, please check API reference.
        '401':
          description: Unauthorized - missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Unauthorized
                message: Invalid or expired API key
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: An unexpected error occurred. Please try again later.
components:
  schemas:
    CreateBotRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the bot (max 255 characters)
          maxLength: 255
        prompt:
          type: string
          description: System prompt for the bot
        first_message:
          type: string
          description: Initial message the bot will send
        knowledge_base_id:
          type: integer
          description: ID of the knowledge base to use
        voice_provider:
          type: string
          enum:
            - OpenAI
            - ElevenLabs
            - Deepgram
          description: Voice synthesis provider
        voice:
          type: string
          description: Voice ID or name
        voice_model:
          type: string
          description: Voice model to use
        voice_speed:
          type: number
          description: Speech speed multiplier
        llm_model_name:
          type: string
          description: Large language model to use
        llm_model_temperature:
          type: number
          description: Temperature setting for the LLM
        stt_provider:
          type: string
          enum:
            - Deepgram
          description: Speech-to-text provider
        stt_model:
          type: string
          description: Speech-to-text model
        call_settings:
          $ref: '#/components/schemas/CallSettings'
        advanced_settings:
          $ref: '#/components/schemas/AdvancedSettings'
        post_call_settings:
          $ref: '#/components/schemas/PostCallSettings'
      required:
        - name
        - prompt
    BotResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the bot
        name:
          type: string
          description: Name of the bot
        prompt:
          type: string
          description: System prompt for the bot
        first_message:
          type: string
          description: Initial message the bot will send
        knowledge_base_id:
          type: integer
          description: ID of the knowledge base
        voice_provider:
          type: string
          enum:
            - OpenAI
            - ElevenLabs
            - Deepgram
          description: Voice synthesis provider
        voice:
          type: string
          description: Voice ID or name
        voice_model:
          type: string
          description: Voice model being used
        voice_speed:
          type: number
          description: Speech speed multiplier
        llm_model_name:
          type: string
          description: Large language model being used
        llm_model_temperature:
          type: number
          description: Temperature setting for the LLM
        stt_provider:
          type: string
          enum:
            - Deepgram
          description: Speech-to-text provider
        stt_model:
          type: string
          description: Speech-to-text model
        call_settings:
          $ref: '#/components/schemas/CallSettings'
        advanced_settings:
          $ref: '#/components/schemas/AdvancedSettings'
        post_call_settings:
          $ref: '#/components/schemas/PostCallSettings'
        created_at:
          type: string
          format: date-time
          description: Bot creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Bot last update timestamp
      required:
        - id
        - name
        - prompt
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        message:
          type: string
          description: Additional error message (for certain error types)
      required:
        - error
    CallSettings:
      type: object
      properties:
        max_call_duration:
          type: integer
          minimum: 2
          maximum: 30
          description: Maximum call duration in minutes (2-30)
        silence_timeout:
          type: integer
          minimum: 5
          maximum: 45
          description: Silence timeout in seconds (5-45)
        silence_timeout_max_retries:
          type: integer
          minimum: 1
          maximum: 5
          description: Maximum retries for silence timeout (1-5)
        silence_timeout_message:
          type: string
          description: Message to play when silence timeout occurs
        call_recording_enabled:
          type: boolean
          description: Whether to record calls
        voicemail_detection_enabled:
          type: boolean
          description: Whether to detect voicemail
        voicemail_action:
          type: string
          enum:
            - leave_message
            - hangup
          description: >-
            Action to take when voicemail is detected. 'leave_message' will
            deliver a custom voicemail message, 'hangup' will end the call
            immediately.
        voicemail_message_type:
          type: string
          enum:
            - static
            - prompt
          description: >-
            Type of voicemail message. 'static' uses a fixed pre-written
            message, 'prompt' uses AI-generated messages based on conversation
            context.
        voicemail_message:
          type: string
          description: >-
            The voicemail message content. Required when voicemail_action is
            'leave_message'. For 'static' type, this is the exact message to be
            delivered. For 'prompt' type, this provides instructions to the AI.
        hipaa_compliance_enabled:
          type: boolean
          description: Whether HIPAA compliance is enabled
        pci_compliance_enabled:
          type: boolean
          description: Whether PCI compliance is enabled
    AdvancedSettings:
      type: object
      properties:
        agent_personality:
          type: string
          enum:
            - casual
            - humorous
            - direct
            - formal
            - persuasive
            - friendly
          description: Personality type for the agent
        humanize_conversation:
          type: boolean
          description: Whether to humanize the conversation
        background_noise_reduction:
          type: boolean
          description: Whether to reduce background noise
        allow_interruptions:
          type: boolean
          description: Whether to allow user interruptions
        min_interruption_duration:
          type: number
          minimum: 0.2
          maximum: 5
          multipleOf: 0.1
          description: Minimum interruption duration in seconds (0.2-5, step 0.1)
        background_sound:
          type: string
          description: Background sound to play
        agent_response_length:
          type: string
          enum:
            - normal
            - short
            - concise
            - long
          description: Preferred response length
        short_pause:
          type: number
          minimum: 0.2
          maximum: 2
          multipleOf: 0.1
          description: Short pause duration in seconds (0.2-2, step 0.1)
        long_pause:
          type: number
          minimum: 0.5
          maximum: 6
          multipleOf: 0.1
          description: Long pause duration in seconds (0.5-6, step 0.1)
        filter_phrases:
          type: string
          description: Phrases to filter from speech
    PostCallSettings:
      type: object
      properties:
        summary_prompt:
          type: string
          description: Prompt for generating call summary
        success_evaluation_prompt:
          type: string
          description: Prompt for evaluating call success
        success_evaluation_rubric_type:
          type: string
          enum:
            - NUMERIC_SCALE
            - DESCRIPTIVE_SCALE
            - PERCENTAGE_SCALE
            - LIKERT_SCALE
            - PASS_FAIL
            - SENTIMENT
          description: Type of success evaluation rubric
        structured_extraction_prompt:
          type: string
          description: Prompt for structured data extraction
        structured_extraction_json_schema:
          type: object
          description: JSON schema for structured extraction
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key authentication. Include your API key in the Authorization header
        as: `Authorization: Bearer <your-api-key>`

````