> ## 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.

# Update Bot

> Update an existing bot's configuration.



## OpenAPI

````yaml patch /v1/bots/{uid}
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: []
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.
paths:
  /v1/bots/{uid}:
    patch:
      tags:
        - Bots
      summary: Update Bot
      description: Update an existing bot's configuration.
      parameters:
        - name: uid
          in: path
          description: The unique identifier of the bot
          required: true
          schema:
            type: string
      requestBody:
        description: Updated bot configuration
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBotRequest'
            example:
              name: Updated Customer Support Bot
              prompt: >-
                You are an advanced customer support assistant with expertise in
                technical issues.
              voice_speed: 1.1
              llm_model_temperature: 0.8
              call_settings:
                max_call_duration: 15
                silence_timeout: 20
                voicemail_detection_enabled: true
                voicemail_action: leave_message
                voicemail_message_type: prompt
                voicemail_message: >-
                  Generate a voicemail explaining why I called based on the
                  customer's recent support ticket.
      responses:
        '200':
          description: Bot updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotResponse'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Bot not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateBotRequest:
      allOf:
        - $ref: '#/components/schemas/CreateBotRequest'
        - type: object
          description: All fields are optional for updates
    BotResponse:
      type: object
      properties:
        uid:
          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
        auto_first_message:
          type: boolean
          description: Whether to automatically send the first message when the call starts
        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:
        - uid
        - 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
    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
        auto_first_message:
          type: boolean
          description: >-
            Whether to automatically send the first message when the call
            starts.
        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
    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:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication using API key. Find it at:
        `https://chat.openmic.ai/api-key`

````