openapi: 3.0.3
info:
  title: Rapida Assistant API
  version: 0.1.0
  description: REST endpoints for creating assistants, managing assistant deployments, and starting outbound assistant phone calls.
servers:
  - url: https://assistant-01.in.rapida.ai
    description: Rapida managed assistant API
  - url: https://assistant-01.us.rapida.ai
    description: Local assistant API
tags:
  - name: assistants
    x-group: Assistants
    description: Assistant management APIs.
  - name: assistant-deployments
    x-group: Assistant deployments
    description: Assistant deployment management APIs.
  - name: calls
    x-group: Calls
    description: Outbound call APIs.
security:
  - ProjectApiKeyHeader: []
  - ProjectApiKeyQuery: []
  - AuthenticationHeader: []
paths:
  /v1/assistant/create-assistant:
    post:
      tags:
        - assistants
      operationId: createAssistant
      summary: create-assistant
      description: Creates an assistant with one provider configuration and optional tools, knowledge, and tags.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAssistantRequest"
            examples:
              model:
                summary: Create a model-backed assistant
                value:
                  name: "Support assistant"
                  description: "Answers customer support questions."
                  visibility: "private"
                  language: "en"
                  tags:
                    - support
                    - production
                  assistantProvider:
                    model:
                      modelProviderName: "openai"
                      template:
                        prompt:
                          - role: "system"
                            content: "You are a helpful support assistant."
                        promptVariables:
                          - name: "customerName"
                            type: "string"
                            defaultValue: "there"
                      assistantModelOptions:
                        - key: "model"
                          value: "gpt-4o-mini"
                  assistantTools:
                    - name: "handoff"
                      description: "Escalate the conversation to a human."
                      executionMethod: "end-of-conversation"
                  assistantKnowledges:
                    - knowledgeId: "2230142097179373568"
                      topK: 5
                      scoreThreshold: 0.5
                      retrievalMethod: "semantic"
              agentkit:
                summary: Create an AgentKit assistant
                value:
                  name: "AgentKit support assistant"
                  description: "Routes live conversations to a custom AgentKit backend."
                  visibility: "private"
                  language: "en"
                  assistantProvider:
                    description: "AgentKit production backend"
                    agentkit:
                      agentKitUrl: "agent.your-domain.com:50051"
                      metadata:
                        authorization: "shared-token"
                        tenant: "acme"
                      transportSecurity: "TLS"
                      tlsVerification: "VERIFY"
                      tlsServerName: "agent.your-domain.com"
                      connectTimeoutMs: 10000
                      keepaliveTimeMs: 30000
                      keepaliveTimeoutMs: 10000
                      maxRecvMessageBytes: 16777216
                      maxSendMessageBytes: 16777216
      responses:
        "200":
          description: Assistant created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantResponse"
              examples:
                created:
                  summary: Assistant created
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      name: "Support assistant"
                      status: "active"
                      visibility: "private"
                      assistantProvider: "model"
                      assistantProviderModel:
                        modelProviderName: "openai"
                        status: "active"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingName:
                  summary: Missing name
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1001004"
                      errorMessage: "missing name parameter"
                      humanMessage: "Please provide the required name parameter."
                invalidProvider:
                  summary: Invalid assistant provider
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1001006"
                      errorMessage: "invalid assistant_provider parameter"
                      humanMessage: "Please provide exactly one assistant provider."
        "403":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid API key
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1001002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to create assistant.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                createFailed:
                  summary: Assistant creation failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1001011"
                      errorMessage: "unable to create assistant"
                      humanMessage: "Unable to create assistant, please try again later."
  /v1/assistant-deployment/create-debugger-deployment:
    post:
      tags:
        - assistant-deployments
      operationId: createAssistantDebuggerDeployment
      summary: create-debugger-deployment
      description: Creates a debugger deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAssistantDebuggerDeploymentRequest"
            examples:
              basic:
                summary: Create a debugger deployment
                value:
                  assistantId: "2227823180112723968"
                  greeting: "Hi, how can I help you today?"
                  greetingInterruptible: false
                  mistake: "Sorry, I did not understand that."
                  unclearInputTimeout: 0.5
                  unclearInputMessage: "I didn't catch that. Could you repeat that?"
                  idealTimeout: 30
                  idealTimeoutBackoff: 2
                  idealTimeoutMessage: "Are you still there?"
                  maxSessionDuration: 300
                  inputAudio:
                    audioProvider: "deepgram"
                    audioType: "stt"
                    audioOptions:
                      - key: "model"
                        value: "nova-3"
                  outputAudio:
                    audioProvider: "elevenlabs"
                    audioType: "tts"
                    audioOptions:
                      - key: "voiceId"
                        value: "VOICE_ID_PLACEHOLDER"
      responses:
        "200":
          description: Assistant debugger deployment created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantDebuggerDeploymentResponse"
              examples:
                created:
                  summary: Debugger deployment created
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greeting: "Hi, how can I help you today?"
                      greetingInterruptible: false
                      mistake: "Sorry, I did not understand that."
                      unclearInputTimeout: 0.5
                      unclearInputMessage: "I didn't catch that. Could you repeat that?"
                      idealTimeout: 30
                      idealTimeoutBackoff: 2
                      idealTimeoutMessage: "Are you still there?"
                      maxSessionDuration: 300
                      status: "active"
                      inputAudio:
                        audioProvider: "deepgram"
                        audioType: "stt"
                        status: "active"
                      outputAudio:
                        audioProvider: "elevenlabs"
                        audioType: "tts"
                        status: "active"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1004004"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidAudioProvider:
                  summary: Invalid audio provider
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1004006"
                      errorMessage: "invalid audio provider parameter"
                      humanMessage: "Please provide a valid audioProvider parameter."
                invalidIdealTimeout:
                  summary: Invalid ideal timeout
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1004007"
                      errorMessage: "invalid ideal_timeout parameter"
                      humanMessage: "Please provide idealTimeout between 5 and 120 seconds."
                invalidTimeoutBackoff:
                  summary: Invalid timeout backoff
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1004008"
                      errorMessage: "invalid ideal_timeout_backoff parameter"
                      humanMessage: "Please provide idealTimeoutBackoff between 0 and 5 times."
                invalidSessionDuration:
                  summary: Invalid max session duration
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1004009"
                      errorMessage: "invalid max_session_duration parameter"
                      humanMessage: "Please provide maxSessionDuration between 180 and 600 seconds."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1004002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1004003"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to create assistant debugger deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                createFailed:
                  summary: Debugger deployment creation failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1004005"
                      errorMessage: "unable to create assistant debugger deployment"
                      humanMessage: "Unable to create assistant debugger deployment, please try again later."
  /v1/assistant-deployment/create-phone-deployment:
    post:
      tags:
        - assistant-deployments
      operationId: createAssistantPhoneDeployment
      summary: create-phone-deployment
      description: Creates a phone deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAssistantPhoneDeploymentRequest"
            examples:
              basic:
                summary: Create a phone deployment
                value:
                  assistantId: "2227823180112723968"
                  greeting: "Hi, how can I help you today?"
                  greetingInterruptible: false
                  mistake: "Sorry, I did not understand that."
                  unclearInputTimeout: 0.5
                  unclearInputMessage: "I didn't catch that. Could you repeat that?"
                  idealTimeout: 30
                  idealTimeoutBackoff: 2
                  idealTimeoutMessage: "Are you still there?"
                  maxSessionDuration: 300
                  phoneProviderName: "twilio"
                  phoneOptions:
                    - key: "phoneNumber"
                      value: "+14155550100"
                  inputAudio:
                    audioProvider: "deepgram"
                    audioType: "stt"
                    audioOptions:
                      - key: "model"
                        value: "nova-3"
                  outputAudio:
                    audioProvider: "elevenlabs"
                    audioType: "tts"
                    audioOptions:
                      - key: "voiceId"
                        value: "VOICE_ID_PLACEHOLDER"
      responses:
        "200":
          description: Assistant phone deployment created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantPhoneDeploymentResponse"
              examples:
                created:
                  summary: Phone deployment created
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greeting: "Hi, how can I help you today?"
                      greetingInterruptible: false
                      mistake: "Sorry, I did not understand that."
                      unclearInputTimeout: 0.5
                      unclearInputMessage: "I didn't catch that. Could you repeat that?"
                      idealTimeout: 30
                      idealTimeoutBackoff: 2
                      idealTimeoutMessage: "Are you still there?"
                      maxSessionDuration: 300
                      phoneProviderName: "twilio"
                      phoneOptions:
                        - key: "phoneNumber"
                          value: "+14155550100"
                      status: "active"
                      inputAudio:
                        audioProvider: "deepgram"
                        audioType: "stt"
                        status: "active"
                      outputAudio:
                        audioProvider: "elevenlabs"
                        audioType: "tts"
                        status: "active"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1005004"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                missingPhoneProvider:
                  summary: Missing phone provider
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1005010"
                      errorMessage: "missing phone_provider_name parameter"
                      humanMessage: "Please provide the required phoneProviderName parameter."
                invalidAudioProvider:
                  summary: Invalid audio provider
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1005006"
                      errorMessage: "invalid audio provider parameter"
                      humanMessage: "Please provide a valid audioProvider parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1005002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1005003"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to create assistant phone deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                createFailed:
                  summary: Phone deployment creation failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1005005"
                      errorMessage: "unable to create assistant phone deployment"
                      humanMessage: "Unable to create assistant phone deployment, please try again later."
  /v1/assistant-deployment/create-api-deployment:
    post:
      tags:
        - assistant-deployments
      operationId: createAssistantApiDeployment
      summary: create-api-deployment
      description: Creates an API deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAssistantApiDeploymentRequest"
            examples:
              basic:
                summary: Create an API deployment
                value:
                  assistantId: "2227823180112723968"
                  greeting: "Hi, how can I help you today?"
                  greetingInterruptible: false
                  mistake: "Sorry, I did not understand that."
                  unclearInputTimeout: 0.5
                  unclearInputMessage: "I didn't catch that. Could you repeat that?"
                  idealTimeout: 30
                  idealTimeoutBackoff: 2
                  idealTimeoutMessage: "Are you still there?"
                  maxSessionDuration: 300
                  inputAudio:
                    audioProvider: "deepgram"
                    audioType: "stt"
                    audioOptions:
                      - key: "model"
                        value: "nova-3"
                  outputAudio:
                    audioProvider: "elevenlabs"
                    audioType: "tts"
                    audioOptions:
                      - key: "voiceId"
                        value: "VOICE_ID_PLACEHOLDER"
      responses:
        "200":
          description: Assistant API deployment created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantApiDeploymentResponse"
              examples:
                created:
                  summary: API deployment created
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greeting: "Hi, how can I help you today?"
                      greetingInterruptible: false
                      mistake: "Sorry, I did not understand that."
                      unclearInputTimeout: 0.5
                      unclearInputMessage: "I didn't catch that. Could you repeat that?"
                      idealTimeout: 30
                      idealTimeoutBackoff: 2
                      idealTimeoutMessage: "Are you still there?"
                      maxSessionDuration: 300
                      status: "active"
                      inputAudio:
                        audioProvider: "deepgram"
                        audioType: "stt"
                        status: "active"
                      outputAudio:
                        audioProvider: "elevenlabs"
                        audioType: "tts"
                        status: "active"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1006004"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidAudioProvider:
                  summary: Invalid audio provider
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1006006"
                      errorMessage: "invalid audio provider parameter"
                      humanMessage: "Please provide a valid audioProvider parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1006002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1006003"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to create assistant API deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                createFailed:
                  summary: API deployment creation failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1006005"
                      errorMessage: "unable to create assistant api deployment"
                      humanMessage: "Unable to create assistant api deployment, please try again later."
  /v1/assistant-deployment/create-webplugin-deployment:
    post:
      tags:
        - assistant-deployments
      operationId: createAssistantWebpluginDeployment
      summary: create-webplugin-deployment
      description: Creates a web plugin deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAssistantWebpluginDeploymentRequest"
            examples:
              basic:
                summary: Create a web plugin deployment
                value:
                  assistantId: "2227823180112723968"
                  greeting: "Hi, how can I help you today?"
                  greetingInterruptible: false
                  mistake: "Sorry, I did not understand that."
                  unclearInputTimeout: 0.5
                  unclearInputMessage: "I didn't catch that. Could you repeat that?"
                  idealTimeout: 30
                  idealTimeoutBackoff: 2
                  idealTimeoutMessage: "Are you still there?"
                  maxSessionDuration: 300
                  suggestion:
                    - "Book a demo"
                    - "Talk to support"
                  inputAudio:
                    audioProvider: "deepgram"
                    audioType: "stt"
                    audioOptions:
                      - key: "model"
                        value: "nova-3"
                  outputAudio:
                    audioProvider: "elevenlabs"
                    audioType: "tts"
                    audioOptions:
                      - key: "voiceId"
                        value: "VOICE_ID_PLACEHOLDER"
      responses:
        "200":
          description: Assistant web plugin deployment created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantWebpluginDeploymentResponse"
              examples:
                created:
                  summary: Web plugin deployment created
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greeting: "Hi, how can I help you today?"
                      greetingInterruptible: false
                      mistake: "Sorry, I did not understand that."
                      unclearInputTimeout: 0.5
                      unclearInputMessage: "I didn't catch that. Could you repeat that?"
                      idealTimeout: 30
                      idealTimeoutBackoff: 2
                      idealTimeoutMessage: "Are you still there?"
                      maxSessionDuration: 300
                      suggestion:
                        - "Book a demo"
                        - "Talk to support"
                      status: "active"
                      inputAudio:
                        audioProvider: "deepgram"
                        audioType: "stt"
                        status: "active"
                      outputAudio:
                        audioProvider: "elevenlabs"
                        audioType: "tts"
                        status: "active"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1007004"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidAudioProvider:
                  summary: Invalid audio provider
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1007006"
                      errorMessage: "invalid audio provider parameter"
                      humanMessage: "Please provide a valid audioProvider parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1007002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1007003"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to create assistant web plugin deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                createFailed:
                  summary: Webplugin deployment creation failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1007005"
                      errorMessage: "unable to create assistant web plugin deployment"
                      humanMessage: "Unable to create assistant web plugin deployment, please try again later."
  /v1/assistant-deployment/create-whatsapp-deployment:
    post:
      tags:
        - assistant-deployments
      operationId: createAssistantWhatsappDeployment
      summary: create-whatsapp-deployment
      description: Creates a WhatsApp deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAssistantWhatsappDeploymentRequest"
            examples:
              basic:
                summary: Create a WhatsApp deployment
                value:
                  assistantId: "2227823180112723968"
                  greeting: "Hi, how can I help you today?"
                  greetingInterruptible: false
                  mistake: "Sorry, I did not understand that."
                  unclearInputTimeout: 0.5
                  unclearInputMessage: "I didn't catch that. Could you repeat that?"
                  idealTimeout: 30
                  idealTimeoutBackoff: 2
                  idealTimeoutMessage: "Are you still there?"
                  maxSessionDuration: 300
                  whatsappProviderName: "gupshup"
                  whatsappOptions:
                    - key: "template"
                      value: "welcome"
      responses:
        "200":
          description: Assistant WhatsApp deployment created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantWhatsappDeploymentResponse"
              examples:
                created:
                  summary: WhatsApp deployment created
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greeting: "Hi, how can I help you today?"
                      greetingInterruptible: false
                      mistake: "Sorry, I did not understand that."
                      unclearInputTimeout: 0.5
                      unclearInputMessage: "I didn't catch that. Could you repeat that?"
                      idealTimeout: 30
                      idealTimeoutBackoff: 2
                      idealTimeoutMessage: "Are you still there?"
                      maxSessionDuration: 300
                      whatsappProviderName: "gupshup"
                      whatsappOptions:
                        - key: "template"
                          value: "welcome"
                      status: "active"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1008004"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                missingWhatsappProvider:
                  summary: Missing WhatsApp provider
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1008009"
                      errorMessage: "missing whatsapp_provider_name parameter"
                      humanMessage: "Please provide the required whatsappProviderName parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1008002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1008003"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to create assistant WhatsApp deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                createFailed:
                  summary: WhatsApp deployment creation failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1008005"
                      errorMessage: "unable to create assistant whatsapp deployment"
                      humanMessage: "Unable to create assistant whatsapp deployment, please try again later."

  /v1/assistant-deployment/get-api-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAssistantApiDeployment
      summary: get-api-deployment
      description: Gets the latest API deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployment.
      responses:
        "200":
          description: Assistant API deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantApiDeploymentResponse"
              examples:
                found:
                  summary: Deployment found
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greetingInterruptible: false
                      status: "active"
                notFound:
                  summary: No deployment exists
                  value:
                    code: 200
                    success: true
                    data: null
        "400":
          description: Invalid assistantId.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1011003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1011001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1011002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant API deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1011004"
                      errorMessage: "unable to get assistant api deployment"
                      humanMessage: "Unable to get assistant api deployment, please try again later."
  /v1/assistant-deployment/get-debugger-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAssistantDebuggerDeployment
      summary: get-debugger-deployment
      description: Gets the latest debugger deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployment.
      responses:
        "200":
          description: Assistant debugger deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantDebuggerDeploymentResponse"
              examples:
                found:
                  summary: Deployment found
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greetingInterruptible: false
                      status: "active"
                notFound:
                  summary: No deployment exists
                  value:
                    code: 200
                    success: true
                    data: null
        "400":
          description: Invalid assistantId.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1009003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1009001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1009002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant debugger deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1009004"
                      errorMessage: "unable to get assistant debugger deployment"
                      humanMessage: "Unable to get assistant debugger deployment, please try again later."
  /v1/assistant-deployment/get-phone-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAssistantPhoneDeployment
      summary: get-phone-deployment
      description: Gets the latest phone deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployment.
      responses:
        "200":
          description: Assistant phone deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantPhoneDeploymentResponse"
              examples:
                found:
                  summary: Deployment found
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greetingInterruptible: false
                      status: "active"
                notFound:
                  summary: No deployment exists
                  value:
                    code: 200
                    success: true
                    data: null
        "400":
          description: Invalid assistantId.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1010003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1010001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1010002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant phone deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1010004"
                      errorMessage: "unable to get assistant phone deployment"
                      humanMessage: "Unable to get assistant phone deployment, please try again later."
  /v1/assistant-deployment/get-webplugin-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAssistantWebpluginDeployment
      summary: get-webplugin-deployment
      description: Gets the latest web plugin deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployment.
      responses:
        "200":
          description: Assistant web plugin deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantWebpluginDeploymentResponse"
              examples:
                found:
                  summary: Deployment found
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greetingInterruptible: false
                      status: "active"
                notFound:
                  summary: No deployment exists
                  value:
                    code: 200
                    success: true
                    data: null
        "400":
          description: Invalid assistantId.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1012003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1012001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1012002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant web plugin deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1012004"
                      errorMessage: "unable to get assistant webplugin deployment"
                      humanMessage: "Unable to get assistant webplugin deployment, please try again later."
  /v1/assistant-deployment/get-whatsapp-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAssistantWhatsappDeployment
      summary: get-whatsapp-deployment
      description: Gets the latest WhatsApp deployment for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployment.
      responses:
        "200":
          description: Assistant WhatsApp deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAssistantWhatsappDeploymentResponse"
              examples:
                found:
                  summary: Deployment found
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
                      assistantId: "2227823180112723968"
                      greetingInterruptible: false
                      status: "active"
                notFound:
                  summary: No deployment exists
                  value:
                    code: 200
                    success: true
                    data: null
        "400":
          description: Invalid assistantId.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1013003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1013001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1013002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant WhatsApp deployment.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1013004"
                      errorMessage: "unable to get assistant whatsapp deployment"
                      humanMessage: "Unable to get assistant whatsapp deployment, please try again later."
  /v1/assistant-deployment/get-all-api-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAllAssistantApiDeployment
      summary: get-all-api-deployment
      description: Gets API deployments for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployments.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 1
          description: Page number to retrieve.
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 20
          description: Number of deployments to return per page.
        - name: criterias
          in: query
          required: false
          description: JSON encoded array of Criteria objects.
          schema:
            type: string
          example: '[{"key":"status","value":"active","logic":"must"}]'
      responses:
        "200":
          description: Assistant API deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAllAssistantApiDeploymentResponse"
              examples:
                found:
                  summary: Deployments found
                  value:
                    code: 200
                    success: true
                    data:
                      - id: "2230142097179373568"
                        assistantId: "2227823180112723968"
                        greetingInterruptible: false
                        status: "active"
                    paginated:
                      currentPage: 1
                      totalItem: 1
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1016003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidRequest:
                  summary: Invalid pagination or criteria
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1016004"
                      errorMessage: "invalid request"
                      humanMessage: "Invalid request."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1016001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1016002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant API deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1016005"
                      errorMessage: "unable to get assistant api deployments"
                      humanMessage: "Unable to get assistant api deployments, please try again later."
  /v1/assistant-deployment/get-all-debugger-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAllAssistantDebuggerDeployment
      summary: get-all-debugger-deployment
      description: Gets debugger deployments for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployments.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 1
          description: Page number to retrieve.
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 20
          description: Number of deployments to return per page.
        - name: criterias
          in: query
          required: false
          description: JSON encoded array of Criteria objects.
          schema:
            type: string
          example: '[{"key":"status","value":"active","logic":"must"}]'
      responses:
        "200":
          description: Assistant debugger deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAllAssistantDebuggerDeploymentResponse"
              examples:
                found:
                  summary: Deployments found
                  value:
                    code: 200
                    success: true
                    data:
                      - id: "2230142097179373568"
                        assistantId: "2227823180112723968"
                        greetingInterruptible: false
                        status: "active"
                    paginated:
                      currentPage: 1
                      totalItem: 1
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1014003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidRequest:
                  summary: Invalid pagination or criteria
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1014004"
                      errorMessage: "invalid request"
                      humanMessage: "Invalid request."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1014001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1014002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant debugger deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1014005"
                      errorMessage: "unable to get assistant debugger deployments"
                      humanMessage: "Unable to get assistant debugger deployments, please try again later."
  /v1/assistant-deployment/get-all-phone-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAllAssistantPhoneDeployment
      summary: get-all-phone-deployment
      description: Gets phone deployments for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployments.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 1
          description: Page number to retrieve.
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 20
          description: Number of deployments to return per page.
        - name: criterias
          in: query
          required: false
          description: JSON encoded array of Criteria objects.
          schema:
            type: string
          example: '[{"key":"status","value":"active","logic":"must"}]'
      responses:
        "200":
          description: Assistant phone deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAllAssistantPhoneDeploymentResponse"
              examples:
                found:
                  summary: Deployments found
                  value:
                    code: 200
                    success: true
                    data:
                      - id: "2230142097179373568"
                        assistantId: "2227823180112723968"
                        greetingInterruptible: false
                        status: "active"
                    paginated:
                      currentPage: 1
                      totalItem: 1
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1015003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidRequest:
                  summary: Invalid pagination or criteria
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1015004"
                      errorMessage: "invalid request"
                      humanMessage: "Invalid request."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1015001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1015002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant phone deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1015005"
                      errorMessage: "unable to get assistant phone deployments"
                      humanMessage: "Unable to get assistant phone deployments, please try again later."
  /v1/assistant-deployment/get-all-webplugin-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAllAssistantWebpluginDeployment
      summary: get-all-webplugin-deployment
      description: Gets web plugin deployments for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployments.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 1
          description: Page number to retrieve.
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 20
          description: Number of deployments to return per page.
        - name: criterias
          in: query
          required: false
          description: JSON encoded array of Criteria objects.
          schema:
            type: string
          example: '[{"key":"status","value":"active","logic":"must"}]'
      responses:
        "200":
          description: Assistant web plugin deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAllAssistantWebpluginDeploymentResponse"
              examples:
                found:
                  summary: Deployments found
                  value:
                    code: 200
                    success: true
                    data:
                      - id: "2230142097179373568"
                        assistantId: "2227823180112723968"
                        greetingInterruptible: false
                        status: "active"
                    paginated:
                      currentPage: 1
                      totalItem: 1
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1017003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidRequest:
                  summary: Invalid pagination or criteria
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1017004"
                      errorMessage: "invalid request"
                      humanMessage: "Invalid request."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1017001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1017002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant web plugin deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1017005"
                      errorMessage: "unable to get assistant webplugin deployments"
                      humanMessage: "Unable to get assistant webplugin deployments, please try again later."
  /v1/assistant-deployment/get-all-whatsapp-deployment/{assistantId}:
    get:
      tags:
        - assistant-deployments
      operationId: getAllAssistantWhatsappDeployment
      summary: get-all-whatsapp-deployment
      description: Gets WhatsApp deployments for an assistant. This endpoint requires user authentication with organization and project scope.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
        - name: assistantId
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the deployments.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 1
          description: Page number to retrieve.
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            format: uint32
            default: 20
          description: Number of deployments to return per page.
        - name: criterias
          in: query
          required: false
          description: JSON encoded array of Criteria objects.
          schema:
            type: string
          example: '[{"key":"status","value":"active","logic":"must"}]'
      responses:
        "200":
          description: Assistant WhatsApp deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetAllAssistantWhatsappDeploymentResponse"
              examples:
                found:
                  summary: Deployments found
                  value:
                    code: 200
                    success: true
                    data:
                      - id: "2230142097179373568"
                        assistantId: "2227823180112723968"
                        greetingInterruptible: false
                        status: "active"
                    paginated:
                      currentPage: 1
                      totalItem: 1
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                invalidAssistantId:
                  summary: Invalid assistant ID
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1018003"
                      errorMessage: "invalid assistant_id parameter"
                      humanMessage: "Please provide a valid assistantId parameter."
                invalidRequest:
                  summary: Invalid pagination or criteria
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1018004"
                      errorMessage: "invalid request"
                      humanMessage: "Invalid request."
        "401":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid user token
                  value:
                    code: 401
                    success: false
                    error:
                      errorCode: "1018001"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "403":
          description: Missing authentication scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingScope:
                  summary: Missing organization or project scope
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1018002"
                      errorMessage: "missing authentication scope"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to get assistant WhatsApp deployments.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                getFailed:
                  summary: Deployment lookup failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1018005"
                      errorMessage: "unable to get assistant whatsapp deployments"
                      humanMessage: "Unable to get assistant whatsapp deployments, please try again later."

  /v1/talk/create-phone-call:
    post:
      tags:
        - calls
      operationId: createPhoneCall
      summary: create-phone-call
      description: Starts one outbound phone call using the configured assistant and returns the created conversation identifier.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreatePhoneCallRequest"
            examples:
              basic:
                summary: Start a phone call
                value:
                  assistant:
                    assistantId: "2227823180112723968"
                    version: latest
                  toNumber: "+14155550123"
                  fromNumber: "+14155550100"
                  metadata:
                    customerId: "cust_123"
                  args:
                    customerName: "Jane"
                  options:
                    experience.greeting: "Hi {{customerName}}, this is Rapida calling about your appointment."
                    experience.greeting_interruptible: false
                    listen.language: "en"
                    listen.model: "nova-3"
                    speak.voice.id: "VOICE_ID_PLACEHOLDER"
                    speak.language: "en"
                    model.name: "gpt-4o-mini"
      responses:
        "200":
          description: Outbound phone call request accepted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreatePhoneCallResponse"
              examples:
                accepted:
                  summary: Call accepted
                  value:
                    code: 200
                    success: true
                    data:
                      id: "2230142097179373568"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingToNumber:
                  summary: Missing destination number
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1002003"
                      errorMessage: "missing toNumber parameter"
                      humanMessage: "Please provide the required toNumber parameter."
                invalidAssistant:
                  summary: Invalid assistant
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1002004"
                      errorMessage: "invalid assistant parameter"
                      humanMessage: "Please provide a valid assistant."
        "403":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid API key
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1002002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to initiate outbound call.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                callFailed:
                  summary: Outbound call failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1002008"
                      errorMessage: "unable to initiate outbound call"
                      humanMessage: "Unable to initiate outbound call, please try again later."
  /v1/talk/create-bulk-phone-call:
    post:
      tags:
        - calls
      operationId: createBulkPhoneCall
      summary: create-bulk-phone-call
      description: Starts multiple outbound phone calls using configured assistants and returns the created conversation identifiers.
      parameters:
        - $ref: "#/components/parameters/ClientSourceHeader"
        - $ref: "#/components/parameters/AuthIdHeader"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateBulkPhoneCallRequest"
            examples:
              basic:
                summary: Start multiple phone calls
                value:
                  phoneCalls:
                    - assistant:
                        assistantId: "2227823180112723968"
                        version: latest
                      toNumber: "+14155550123"
                      fromNumber: "+14155550100"
                      metadata:
                        customerId: "cust_123"
                      args:
                        customerName: "Jane"
                      options:
                        experience.greeting: "Hi {{customerName}}, this is Rapida calling about your appointment."
                        listen.language: "en"
                        speak.voice.id: "VOICE_ID_PLACEHOLDER"
                    - assistant:
                        assistantId: "2227823180112723968"
                        version: latest
                      toNumber: "+14155550124"
                      metadata:
                        customerId: "cust_124"
                      args:
                        customerName: "Sam"
                      options:
                        experience.greeting: "Hi {{customerName}}, this is Rapida calling with an update."
      responses:
        "200":
          description: Bulk outbound phone call request accepted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateBulkPhoneCallResponse"
              examples:
                accepted:
                  summary: Calls accepted
                  value:
                    code: 200
                    success: true
                    data:
                      - id: "2230142097179373568"
                      - id: "2230142097179373569"
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingPhoneCalls:
                  summary: Missing phone calls
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1003003"
                      errorMessage: "missing phone_calls parameter"
                      humanMessage: "Please provide at least one phone call."
                missingToNumber:
                  summary: Missing destination number
                  value:
                    code: 400
                    success: false
                    error:
                      errorCode: "1003004"
                      errorMessage: "missing toNumber parameter"
                      humanMessage: "Please provide the required toNumber parameter."
        "403":
          description: Unauthenticated request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                unauthenticated:
                  summary: Missing or invalid API key
                  value:
                    code: 403
                    success: false
                    error:
                      errorCode: "1003002"
                      errorMessage: "unauthenticated request"
                      humanMessage: "Unauthenticated request, please try again with valid authentication."
        "500":
          description: Failed to initiate outbound calls.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                callFailed:
                  summary: Outbound calls failed
                  value:
                    code: 500
                    success: false
                    error:
                      errorCode: "1003009"
                      errorMessage: "unable to initiate outbound call"
                      humanMessage: "Unable to initiate outbound call, please try again later."
components:
  securitySchemes:
    ProjectApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: API key from Rapida credentials.
    ProjectApiKeyQuery:
      type: apiKey
      in: query
      name: x-api-key
      description: API key from Rapida credentials.
    AuthenticationHeader:
      type: apiKey
      in: header
      name: Authentication
      description: API key from Rapida credentials.
  parameters:
    ClientSourceHeader:
      name: x-client-source
      in: header
      required: false
      schema:
        type: string
        default: sdk
        enum:
          - sdk
      description: Client source identifier. SDK clients send this automatically.
    AuthIdHeader:
      name: x-auth-id
      in: header
      required: false
      schema:
        type: string
      description: Optional user identifier to propagate with the request.
  schemas:
    Uint64String:
      type: string
      pattern: "^[0-9]+$"
      example: "2227823180112723968"
    PlatformErrorCode:
      type: string
      pattern: "^[0-9]+$"
      description: |
        Stable platform error code.

        Create Assistant:
        - `1001001`: invalid request - Invalid request.
        - `1001002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1001003`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1001004`: missing name parameter - Please provide the required name parameter.
        - `1001005`: missing assistant_provider parameter - Please provide the required assistantProvider parameter.
        - `1001006`: invalid assistant_provider parameter - Please provide exactly one assistant provider.
        - `1001007`: missing model_provider_name parameter - Please provide the required modelProviderName parameter.
        - `1001008`: missing agent_kit_url parameter - Please provide the required agentKitUrl parameter.
        - `1001009`: missing websocket_url parameter - Please provide the required websocketUrl parameter.
        - `1001010`: invalid source_identifier parameter - Please provide a valid sourceIdentifier parameter.
        - `1001011`: unable to create assistant - Unable to create assistant, please try again later.
        - `1001012`: invalid assistant provider template - Invalid assistant provider template.
        - `1001013`: unable to create assistant provider model - Unable to create assistant provider model, please try again later.
        - `1001014`: unable to attach assistant provider model - Unable to attach assistant provider model, please try again later.
        - `1001015`: unable to create assistant provider agentkit - Unable to create assistant provider agentkit, please try again later.
        - `1001016`: unable to attach assistant provider agentkit - Unable to attach assistant provider agentkit, please try again later.
        - `1001017`: unable to create assistant provider websocket - Unable to create assistant provider websocket, please try again later.
        - `1001018`: unable to attach assistant provider websocket - Unable to attach assistant provider websocket, please try again later.
        - `1001019`: invalid knowledge_id parameter - Please provide a valid knowledgeId parameter.
        - `1001020`: invalid reranker_model_provider_id parameter - Please provide a valid rerankerModelProviderId parameter.
        - `1001021`: unable to create assistant tools - Unable to create assistant tools, please try again later.
        - `1001022`: unable to create assistant knowledge - Unable to create assistant knowledge, please try again later.
        - `1001023`: unable to create assistant tags - Unable to create assistant tags, please try again.

        Create Phone Call:
        - `1002001`: invalid request - Invalid request.
        - `1002002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1002003`: missing toNumber parameter - Please provide the required toNumber parameter.
        - `1002004`: invalid assistant parameter - Please provide a valid assistant.
        - `1002005`: invalid metadata parameter - Please provide valid metadata.
        - `1002006`: invalid arguments parameter - Please provide valid arguments.
        - `1002007`: invalid options parameter - Please provide valid options.
        - `1002008`: unable to initiate outbound call - Unable to initiate outbound call, please try again later.

        Create Bulk Phone Call:
        - `1003001`: invalid request - Invalid request.
        - `1003002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1003003`: missing phone_calls parameter - Please provide at least one phone call.
        - `1003004`: missing toNumber parameter - Please provide the required toNumber parameter.
        - `1003005`: invalid assistant parameter - Please provide a valid assistant.
        - `1003006`: invalid metadata parameter - Please provide valid metadata.
        - `1003007`: invalid arguments parameter - Please provide valid arguments.
        - `1003008`: invalid options parameter - Please provide valid options.
        - `1003009`: unable to initiate outbound call - Unable to initiate outbound call, please try again later.

        Create Assistant Debugger Deployment:
        - `1004001`: invalid request - Invalid request.
        - `1004002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1004003`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1004004`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1004005`: unable to create assistant debugger deployment - Unable to create assistant debugger deployment, please try again later.
        - `1004006`: invalid audio provider parameter - Please provide a valid audioProvider parameter.
        - `1004007`: invalid ideal_timeout parameter - Please provide idealTimeout between 5 and 120 seconds.
        - `1004008`: invalid ideal_timeout_backoff parameter - Please provide idealTimeoutBackoff between 0 and 5 times.
        - `1004009`: invalid max_session_duration parameter - Please provide maxSessionDuration between 180 and 600 seconds.

        Create Assistant Phone Deployment:
        - `1005001`: invalid request - Invalid request.
        - `1005002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1005003`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1005004`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1005005`: unable to create assistant phone deployment - Unable to create assistant phone deployment, please try again later.
        - `1005006`: invalid audio provider parameter - Please provide a valid audioProvider parameter.
        - `1005007`: invalid ideal_timeout parameter - Please provide idealTimeout between 5 and 120 seconds.
        - `1005008`: invalid ideal_timeout_backoff parameter - Please provide idealTimeoutBackoff between 0 and 5 times.
        - `1005009`: invalid max_session_duration parameter - Please provide maxSessionDuration between 180 and 600 seconds.
        - `1005010`: missing phone_provider_name parameter - Please provide the required phoneProviderName parameter.

        Create Assistant API Deployment:
        - `1006001`: invalid request - Invalid request.
        - `1006002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1006003`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1006004`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1006005`: unable to create assistant api deployment - Unable to create assistant api deployment, please try again later.
        - `1006006`: invalid audio provider parameter - Please provide a valid audioProvider parameter.
        - `1006007`: invalid ideal_timeout parameter - Please provide idealTimeout between 5 and 120 seconds.
        - `1006008`: invalid ideal_timeout_backoff parameter - Please provide idealTimeoutBackoff between 0 and 5 times.
        - `1006009`: invalid max_session_duration parameter - Please provide maxSessionDuration between 180 and 600 seconds.

        Create Assistant Webplugin Deployment:
        - `1007001`: invalid request - Invalid request.
        - `1007002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1007003`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1007004`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1007005`: unable to create assistant web plugin deployment - Unable to create assistant web plugin deployment, please try again later.
        - `1007006`: invalid audio provider parameter - Please provide a valid audioProvider parameter.
        - `1007007`: invalid ideal_timeout parameter - Please provide idealTimeout between 5 and 120 seconds.
        - `1007008`: invalid ideal_timeout_backoff parameter - Please provide idealTimeoutBackoff between 0 and 5 times.
        - `1007009`: invalid max_session_duration parameter - Please provide maxSessionDuration between 180 and 600 seconds.

        Create Assistant WhatsApp Deployment:
        - `1008001`: invalid request - Invalid request.
        - `1008002`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1008003`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1008004`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1008005`: unable to create assistant whatsapp deployment - Unable to create assistant whatsapp deployment, please try again later.
        - `1008006`: invalid ideal_timeout parameter - Please provide idealTimeout between 5 and 120 seconds.
        - `1008007`: invalid ideal_timeout_backoff parameter - Please provide idealTimeoutBackoff between 0 and 5 times.
        - `1008008`: invalid max_session_duration parameter - Please provide maxSessionDuration between 180 and 600 seconds.
        - `1008009`: missing whatsapp_provider_name parameter - Please provide the required whatsappProviderName parameter.

        Get Assistant Debugger Deployment:
        - `1009001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1009002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1009003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1009004`: unable to get assistant debugger deployment - Unable to get assistant debugger deployment, please try again later.

        Get Assistant Phone Deployment:
        - `1010001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1010002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1010003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1010004`: unable to get assistant phone deployment - Unable to get assistant phone deployment, please try again later.

        Get Assistant API Deployment:
        - `1011001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1011002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1011003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1011004`: unable to get assistant api deployment - Unable to get assistant api deployment, please try again later.

        Get Assistant Webplugin Deployment:
        - `1012001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1012002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1012003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1012004`: unable to get assistant webplugin deployment - Unable to get assistant webplugin deployment, please try again later.

        Get Assistant WhatsApp Deployment:
        - `1013001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1013002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1013003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1013004`: unable to get assistant whatsapp deployment - Unable to get assistant whatsapp deployment, please try again later.

        Get All Assistant Debugger Deployments:
        - `1014001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1014002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1014003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1014004`: invalid request - Invalid request.
        - `1014005`: unable to get assistant debugger deployments - Unable to get assistant debugger deployments, please try again later.

        Get All Assistant Phone Deployments:
        - `1015001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1015002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1015003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1015004`: invalid request - Invalid request.
        - `1015005`: unable to get assistant phone deployments - Unable to get assistant phone deployments, please try again later.

        Get All Assistant API Deployments:
        - `1016001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1016002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1016003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1016004`: invalid request - Invalid request.
        - `1016005`: unable to get assistant api deployments - Unable to get assistant api deployments, please try again later.

        Get All Assistant Webplugin Deployments:
        - `1017001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1017002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1017003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1017004`: invalid request - Invalid request.
        - `1017005`: unable to get assistant webplugin deployments - Unable to get assistant webplugin deployments, please try again later.

        Get All Assistant WhatsApp Deployments:
        - `1018001`: unauthenticated request - Unauthenticated request, please try again with valid authentication.
        - `1018002`: missing authentication scope - Unauthenticated request, please try again with valid authentication.
        - `1018003`: invalid assistant_id parameter - Please provide a valid assistantId parameter.
        - `1018004`: invalid request - Invalid request.
        - `1018005`: unable to get assistant whatsapp deployments - Unable to get assistant whatsapp deployments, please try again later.
      example: "1002003"
    AssistantDefinition:
      type: object
      required:
        - assistantId
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
          description: Assistant ID to use for the call.
        version:
          type: string
          description: Assistant version. Use latest to run the latest published version.
          example: latest
    CreateAssistantRequest:
      type: object
      required:
        - assistantProvider
        - name
      properties:
        assistantProvider:
          $ref: "#/components/schemas/CreateAssistantProviderRequest"
        assistantKnowledges:
          type: array
          items:
            $ref: "#/components/schemas/CreateAssistantKnowledgeRequest"
        assistantTools:
          type: array
          items:
            $ref: "#/components/schemas/CreateAssistantToolRequest"
        description:
          type: string
          description: Assistant description.
          example: "Answers customer support questions."
        visibility:
          type: string
          description: Assistant visibility.
          example: private
        language:
          type: string
          description: Assistant language code.
          example: en
        source:
          type: string
          description: Optional source system for imported assistants.
        sourceIdentifier:
          $ref: "#/components/schemas/Uint64String"
          description: Optional source-system identifier.
        tags:
          type: array
          items:
            type: string
          example:
            - support
            - production
        name:
          type: string
          description: Assistant name.
          example: "Support assistant"
    CreateAssistantDebuggerDeploymentRequest:
      type: object
      required:
        - assistantId
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the debugger deployment.
        greeting:
          type: string
          description: First message the assistant sends when the debugger session starts.
          example: "Hi, how can I help you today?"
        greetingInterruptible:
          type: boolean
          description: Controls whether users can interrupt the opening greeting in audio sessions.
          example: true
        mistake:
          type: string
          description: Message to use when the assistant cannot understand or handle the input.
          example: "Sorry, I did not understand that."
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
          description: Seconds to wait after interrupted or unclear input before asking the user to repeat.
          example: 0.5
        unclearInputMessage:
          type: string
          maxLength: 500
          description: Message sent when the assistant could not understand the user input.
          example: "I didn't catch that. Could you repeat that?"
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
          description: Idle timeout in seconds before the assistant sends the timeout message.
          example: 30
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
          description: Number of idle-timeout retries before the session can end.
          example: 2
        idealTimeoutMessage:
          type: string
          description: Message sent when the debugger session reaches the idle timeout.
          example: "Are you still there?"
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
          description: Maximum debugger session duration in seconds.
          example: 300
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
    CreateAssistantPhoneDeploymentRequest:
      type: object
      required:
        - assistantId
        - phoneProviderName
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the phone deployment.
        greeting:
          type: string
          description: First message the assistant sends when the phone session starts.
          example: "Hi, how can I help you today?"
        greetingInterruptible:
          type: boolean
          description: Controls whether users can interrupt the opening greeting in audio sessions.
          example: true
        mistake:
          type: string
          description: Message to use when the assistant cannot understand or handle the input.
          example: "Sorry, I did not understand that."
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
          description: Seconds to wait after interrupted or unclear input before asking the user to repeat.
          example: 0.5
        unclearInputMessage:
          type: string
          maxLength: 500
          description: Message sent when the assistant could not understand the user input.
          example: "I didn't catch that. Could you repeat that?"
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
          description: Idle timeout in seconds before the assistant sends the timeout message.
          example: 30
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
          description: Number of idle-timeout retries before the session can end.
          example: 2
        idealTimeoutMessage:
          type: string
          description: Message sent when the phone session reaches the idle timeout.
          example: "Are you still there?"
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
          description: Maximum phone session duration in seconds.
          example: 300
        phoneProviderName:
          type: string
          description: Telephony provider name.
          example: twilio
        phoneOptions:
          type: array
          description: Provider-specific phone options.
          items:
            $ref: "#/components/schemas/Metadata"
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
    CreateAssistantApiDeploymentRequest:
      type: object
      required:
        - assistantId
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the API deployment.
        greeting:
          type: string
          description: First message the assistant sends when the API session starts.
          example: "Hi, how can I help you today?"
        greetingInterruptible:
          type: boolean
          description: Controls whether users can interrupt the opening greeting in audio sessions.
          example: true
        mistake:
          type: string
          description: Message to use when the assistant cannot understand or handle the input.
          example: "Sorry, I did not understand that."
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
          description: Seconds to wait after interrupted or unclear input before asking the user to repeat.
          example: 0.5
        unclearInputMessage:
          type: string
          maxLength: 500
          description: Message sent when the assistant could not understand the user input.
          example: "I didn't catch that. Could you repeat that?"
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
          description: Idle timeout in seconds before the assistant sends the timeout message.
          example: 30
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
          description: Number of idle-timeout retries before the session can end.
          example: 2
        idealTimeoutMessage:
          type: string
          description: Message sent when the API session reaches the idle timeout.
          example: "Are you still there?"
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
          description: Maximum API session duration in seconds.
          example: 300
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
    CreateAssistantWebpluginDeploymentRequest:
      type: object
      required:
        - assistantId
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the web plugin deployment.
        greeting:
          type: string
          description: First message the assistant sends when the web plugin session starts.
          example: "Hi, how can I help you today?"
        greetingInterruptible:
          type: boolean
          description: Controls whether users can interrupt the opening greeting in audio sessions.
          example: true
        mistake:
          type: string
          description: Message to use when the assistant cannot understand or handle the input.
          example: "Sorry, I did not understand that."
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
          description: Seconds to wait after interrupted or unclear input before asking the user to repeat.
          example: 0.5
        unclearInputMessage:
          type: string
          maxLength: 500
          description: Message sent when the assistant could not understand the user input.
          example: "I didn't catch that. Could you repeat that?"
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
          description: Idle timeout in seconds before the assistant sends the timeout message.
          example: 30
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
          description: Number of idle-timeout retries before the session can end.
          example: 2
        idealTimeoutMessage:
          type: string
          description: Message sent when the web plugin session reaches the idle timeout.
          example: "Are you still there?"
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
          description: Maximum web plugin session duration in seconds.
          example: 300
        suggestion:
          type: array
          description: Suggested starter prompts shown in the web widget.
          items:
            type: string
          example:
            - "Book a demo"
            - "Talk to support"
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProviderRequest"
    CreateAssistantWhatsappDeploymentRequest:
      type: object
      required:
        - assistantId
        - whatsappProviderName
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
          description: Assistant ID for the WhatsApp deployment.
        greeting:
          type: string
          description: First message the assistant sends when the WhatsApp session starts.
          example: "Hi, how can I help you today?"
        greetingInterruptible:
          type: boolean
          description: Controls whether users can interrupt the opening greeting in audio sessions.
          example: true
        mistake:
          type: string
          description: Message to use when the assistant cannot understand or handle the input.
          example: "Sorry, I did not understand that."
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
          description: Seconds to wait after interrupted or unclear input before asking the user to repeat.
          example: 0.5
        unclearInputMessage:
          type: string
          maxLength: 500
          description: Message sent when the assistant could not understand the user input.
          example: "I didn't catch that. Could you repeat that?"
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
          description: Idle timeout in seconds before the assistant sends the timeout message.
          example: 30
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
          description: Number of idle-timeout retries before the session can end.
          example: 2
        idealTimeoutMessage:
          type: string
          description: Message sent when the WhatsApp session reaches the idle timeout.
          example: "Are you still there?"
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
          description: Maximum WhatsApp session duration in seconds.
          example: 300
        whatsappProviderName:
          type: string
          description: WhatsApp provider name.
          example: gupshup
        whatsappOptions:
          type: array
          description: Provider-specific WhatsApp options.
          items:
            $ref: "#/components/schemas/Metadata"

    DeploymentAudioProviderRequest:
      type: object
      required:
        - audioProvider
      properties:
        audioProvider:
          type: string
          description: Audio provider name.
          example: deepgram
        audioOptions:
          type: array
          description: Provider-specific audio options.
          items:
            $ref: "#/components/schemas/Metadata"
        status:
          type: string
          description: Optional provider status.
          example: active
        audioType:
          type: string
          description: Audio direction or role, such as `stt` or `tts`.
          example: stt
    CreateAssistantProviderRequest:
      type: object
      description: Provider configuration for the assistant. Provide exactly one of `model`, `agentkit`, or `websocket`.
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        description:
          type: string
        model:
          $ref: "#/components/schemas/CreateAssistantProviderModel"
        agentkit:
          $ref: "#/components/schemas/CreateAssistantProviderAgentkit"
        websocket:
          $ref: "#/components/schemas/CreateAssistantProviderWebsocket"
    CreateAssistantProviderModel:
      type: object
      required:
        - modelProviderName
      properties:
        template:
          $ref: "#/components/schemas/TextChatCompletePrompt"
        modelProviderName:
          type: string
          description: Model provider name.
          example: openai
        assistantModelOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
    CreateAssistantProviderAgentkit:
      type: object
      required:
        - agentKitUrl
      properties:
        agentKitUrl:
          type: string
          description: AgentKit gRPC endpoint in `host` or `host:port` format.
          example: "agent.your-domain.com:50051"
        certificate:
          type: string
          description: Optional PEM CA certificate for private or self-signed TLS.
        metadata:
          type: object
          description: gRPC metadata sent to the AgentKit backend.
          additionalProperties:
            type: string
        transportSecurity:
          type: string
          description: AgentKit transport security mode.
          enum:
            - TLS
            - PLAINTEXT
          default: TLS
        tlsVerification:
          type: string
          description: AgentKit TLS verification mode.
          enum:
            - VERIFY
            - SKIP_VERIFY
          default: VERIFY
        tlsServerName:
          type: string
          description: TLS server name override for certificate verification.
          example: "agent.your-domain.com"
        connectTimeoutMs:
          type: integer
          format: uint32
          minimum: 1
          maximum: 300000
          description: Connection timeout in milliseconds.
          default: 10000
        keepaliveTimeMs:
          type: integer
          format: uint32
          minimum: 10000
          maximum: 3600000
          description: Keepalive ping interval in milliseconds.
          default: 30000
        keepaliveTimeoutMs:
          type: integer
          format: uint32
          minimum: 1000
          maximum: 300000
          description: Keepalive response timeout in milliseconds.
          default: 10000
        maxRecvMessageBytes:
          type: integer
          format: uint32
          minimum: 1024
          maximum: 104857600
          description: Maximum inbound gRPC message size.
          default: 16777216
        maxSendMessageBytes:
          type: integer
          format: uint32
          minimum: 1024
          maximum: 104857600
          description: Maximum outbound gRPC message size.
          default: 16777216
    CreateAssistantProviderWebsocket:
      type: object
      required:
        - websocketUrl
      properties:
        websocketUrl:
          type: string
          description: WebSocket provider URL.
          example: "wss://agent.example.com/ws"
        headers:
          type: object
          additionalProperties:
            type: string
        connectionParameters:
          type: object
          additionalProperties:
            type: string
    CreateAssistantKnowledgeRequest:
      type: object
      properties:
        knowledgeId:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        rerankerModelProviderId:
          $ref: "#/components/schemas/Uint64String"
        rerankerModelProviderName:
          type: string
        assistantKnowledgeRerankerOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        topK:
          type: integer
          format: uint32
          example: 5
        scoreThreshold:
          type: number
          format: float
          example: 0.5
        retrievalMethod:
          type: string
          example: semantic
        rerankerEnable:
          type: boolean
    CreateAssistantToolRequest:
      type: object
      properties:
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        name:
          type: string
          example: handoff
        description:
          type: string
        fields:
          type: object
          additionalProperties: true
        executionMethod:
          type: string
        executionOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
    TextChatCompletePrompt:
      type: object
      properties:
        prompt:
          type: array
          items:
            $ref: "#/components/schemas/TextPrompt"
        promptVariables:
          type: array
          items:
            $ref: "#/components/schemas/Variable"
    TextPrompt:
      type: object
      properties:
        role:
          type: string
          example: system
        content:
          type: string
          example: "You are a helpful support assistant."
    Variable:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        name:
          type: string
        type:
          type: string
        defaultValue:
          type: string
    GetAssistantResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: "#/components/schemas/Assistant"
        error:
          $ref: "#/components/schemas/Error"
    GetAssistantDebuggerDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: "#/components/schemas/AssistantDebuggerDeployment"
        error:
          $ref: "#/components/schemas/Error"
    GetAssistantPhoneDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: "#/components/schemas/AssistantPhoneDeployment"
        error:
          $ref: "#/components/schemas/Error"
    GetAssistantApiDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: "#/components/schemas/AssistantApiDeployment"
        error:
          $ref: "#/components/schemas/Error"
    GetAssistantWebpluginDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: "#/components/schemas/AssistantWebpluginDeployment"
        error:
          $ref: "#/components/schemas/Error"
    GetAssistantWhatsappDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: "#/components/schemas/AssistantWhatsappDeployment"
        error:
          $ref: "#/components/schemas/Error"
    GetAllAssistantApiDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/AssistantApiDeployment"
        error:
          $ref: "#/components/schemas/Error"
        paginated:
          $ref: "#/components/schemas/Paginated"
    GetAllAssistantDebuggerDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/AssistantDebuggerDeployment"
        error:
          $ref: "#/components/schemas/Error"
        paginated:
          $ref: "#/components/schemas/Paginated"
    GetAllAssistantPhoneDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/AssistantPhoneDeployment"
        error:
          $ref: "#/components/schemas/Error"
        paginated:
          $ref: "#/components/schemas/Paginated"
    GetAllAssistantWebpluginDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/AssistantWebpluginDeployment"
        error:
          $ref: "#/components/schemas/Error"
        paginated:
          $ref: "#/components/schemas/Paginated"
    GetAllAssistantWhatsappDeploymentResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/AssistantWhatsappDeployment"
        error:
          $ref: "#/components/schemas/Error"
        paginated:
          $ref: "#/components/schemas/Paginated"

    AssistantDebuggerDeployment:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        greeting:
          type: string
        greetingInterruptible:
          type: boolean
        mistake:
          type: string
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
        unclearInputMessage:
          type: string
          maxLength: 500
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        status:
          type: string
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
        idealTimeoutMessage:
          type: string
    AssistantPhoneDeployment:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        greeting:
          type: string
        greetingInterruptible:
          type: boolean
        mistake:
          type: string
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
        unclearInputMessage:
          type: string
          maxLength: 500
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        phoneProviderName:
          type: string
        phoneOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        status:
          type: string
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
        idealTimeoutMessage:
          type: string
    AssistantApiDeployment:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        greeting:
          type: string
        greetingInterruptible:
          type: boolean
        mistake:
          type: string
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
        unclearInputMessage:
          type: string
          maxLength: 500
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        status:
          type: string
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
        idealTimeoutMessage:
          type: string
    AssistantWebpluginDeployment:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        greeting:
          type: string
        greetingInterruptible:
          type: boolean
        mistake:
          type: string
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
        unclearInputMessage:
          type: string
          maxLength: 500
        inputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        outputAudio:
          $ref: "#/components/schemas/DeploymentAudioProvider"
        suggestion:
          type: array
          items:
            type: string
        status:
          type: string
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
        idealTimeoutMessage:
          type: string
    AssistantWhatsappDeployment:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        greeting:
          type: string
        greetingInterruptible:
          type: boolean
        mistake:
          type: string
        unclearInputTimeout:
          type: number
          format: double
          minimum: 0.5
          maximum: 5
        unclearInputMessage:
          type: string
          maxLength: 500
        whatsappProviderName:
          type: string
        whatsappOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        status:
          type: string
        maxSessionDuration:
          type: integer
          format: uint64
          minimum: 180
          maximum: 600
        idealTimeout:
          type: integer
          format: uint64
          minimum: 5
          maximum: 120
        idealTimeoutBackoff:
          type: integer
          format: uint64
          minimum: 0
          maximum: 5
        idealTimeoutMessage:
          type: string

    DeploymentAudioProvider:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        audioType:
          type: string
        audioProvider:
          type: string
        audioOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        status:
          type: string
    Assistant:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        status:
          type: string
        visibility:
          type: string
        source:
          type: string
        sourceIdentifier:
          $ref: "#/components/schemas/Uint64String"
        projectId:
          $ref: "#/components/schemas/Uint64String"
        organizationId:
          $ref: "#/components/schemas/Uint64String"
        assistantProvider:
          type: string
        assistantProviderId:
          $ref: "#/components/schemas/Uint64String"
        name:
          type: string
        description:
          type: string
        assistantProviderModel:
          $ref: "#/components/schemas/AssistantProviderModel"
        assistantProviderAgentkit:
          $ref: "#/components/schemas/AssistantProviderAgentkit"
        assistantProviderWebsocket:
          $ref: "#/components/schemas/AssistantProviderWebsocket"
        assistantTag:
          $ref: "#/components/schemas/AssistantTag"
        createdBy:
          $ref: "#/components/schemas/Uint64String"
        updatedBy:
          $ref: "#/components/schemas/Uint64String"
        createdDate:
          type: string
          format: date-time
        updatedDate:
          type: string
          format: date-time
        assistantTools:
          type: array
          items:
            $ref: "#/components/schemas/AssistantTool"
        assistantKnowledges:
          type: array
          items:
            $ref: "#/components/schemas/AssistantKnowledge"
    AssistantProviderModel:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        template:
          $ref: "#/components/schemas/TextChatCompletePrompt"
        description:
          type: string
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        modelProviderName:
          type: string
        assistantModelOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        status:
          type: string
    AssistantProviderAgentkit:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        description:
          type: string
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        status:
          type: string
        url:
          type: string
        certificate:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        transportSecurity:
          type: string
        tlsVerification:
          type: string
        tlsServerName:
          type: string
        connectTimeoutMs:
          type: integer
          format: uint32
        keepaliveTimeMs:
          type: integer
          format: uint32
        keepaliveTimeoutMs:
          type: integer
          format: uint32
        maxRecvMessageBytes:
          type: integer
          format: uint32
        maxSendMessageBytes:
          type: integer
          format: uint32
    AssistantProviderWebsocket:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        description:
          type: string
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        url:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
        parameters:
          type: object
          additionalProperties:
            type: string
        status:
          type: string
    AssistantTag:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        tag:
          type: array
          items:
            type: string
    AssistantTool:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        name:
          type: string
        description:
          type: string
        fields:
          type: object
          additionalProperties: true
        executionMethod:
          type: string
        executionOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        status:
          type: string
    AssistantKnowledge:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        knowledgeId:
          $ref: "#/components/schemas/Uint64String"
        rerankerEnable:
          type: boolean
        topK:
          type: integer
          format: uint32
        scoreThreshold:
          type: number
          format: float
        retrievalMethod:
          type: string
        rerankerModelProviderId:
          $ref: "#/components/schemas/Uint64String"
        rerankerModelProviderName:
          type: string
        assistantKnowledgeRerankerOptions:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        status:
          type: string
    CreatePhoneCallRequest:
      type: object
      required:
        - assistant
        - toNumber
      properties:
        assistant:
          $ref: "#/components/schemas/AssistantDefinition"
        metadata:
          type: object
          additionalProperties: true
          description: Arbitrary metadata stored with the conversation for tracking and analytics.
          example:
            customerId: "cust_123"
        args:
          type: object
          additionalProperties: true
          description: Runtime arguments made available to the assistant.
          example:
            customerName: "Jane"
        options:
          type: object
          additionalProperties: true
          description: |
            Runtime overrides for this call. Supported option groups include `experience.*` for session behavior, `listen.*` for speech-to-text and voice input, `speak.*` and `speaker.*` for text-to-speech and spoken output, `model.*` for model provider options, and `agentkit.*` for AgentKit connection settings.
          example:
            experience.greeting: "Hi {{customerName}}, this is Rapida calling about your appointment."
            experience.greeting_interruptible: false
            listen.language: "en"
            listen.model: "nova-3"
            speak.voice.id: "VOICE_ID_PLACEHOLDER"
            speak.language: "en"
            model.name: "gpt-4o-mini"
        fromNumber:
          type: string
          description: Caller ID phone number in E.164 format. If omitted, Rapida uses the configured default.
          example: "+14155550100"
        toNumber:
          type: string
          description: Destination phone number in E.164 format.
          example: "+14155550123"
    CreatePhoneCallResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          $ref: "#/components/schemas/AssistantConversation"
        error:
          $ref: "#/components/schemas/Error"
    CreateBulkPhoneCallRequest:
      type: object
      required:
        - phoneCalls
      properties:
        phoneCalls:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/CreatePhoneCallRequest"
    CreateBulkPhoneCallResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 200
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/AssistantConversation"
        error:
          $ref: "#/components/schemas/Error"
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 400
        success:
          type: boolean
          example: false
        error:
          $ref: "#/components/schemas/Error"
    Error:
      type: object
      description: |
        Platform error response details. `errorCode` is a stable platform error code.
        See `PlatformErrorCode` for documented code/message mappings.
      properties:
        errorCode:
          $ref: "#/components/schemas/PlatformErrorCode"
          description: Stable platform error code.
        errorMessage:
          type: string
          description: Stable client-safe error message.
          example: missing toNumber parameter
        humanMessage:
          type: string
          description: Client-safe human-readable message.
          example: Please provide the required toNumber parameter.
    User:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        name:
          type: string
        email:
          type: string
          format: email
        role:
          type: string
        status:
          type: string
        createdDate:
          type: string
          format: date-time
    Metric:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
        description:
          type: string
    Metadata:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        key:
          type: string
        value:
          type: string
    Criteria:
      type: object
      properties:
        key:
          type: string
          description: Field name to filter by.
        value:
          type: string
          description: Value to match against the field.
        logic:
          type: string
          description: Criteria logic, such as should or must.
    Paginate:
      type: object
      properties:
        page:
          type: integer
          format: uint32
          example: 1
        pageSize:
          type: integer
          format: uint32
          example: 20
    Paginated:
      type: object
      properties:
        currentPage:
          type: integer
          format: uint32
          example: 1
        totalItem:
          type: integer
          format: uint32
          example: 1
    Argument:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        name:
          type: string
        value:
          type: string
    AssistantConversationMessage:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantConversationId:
          $ref: "#/components/schemas/Uint64String"
        role:
          type: string
        content:
          type: string
        createdDate:
          type: string
          format: date-time
        updatedDate:
          type: string
          format: date-time
    AssistantConversationContext:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantConversationId:
          $ref: "#/components/schemas/Uint64String"
        key:
          type: string
        value:
          type: string
        createdDate:
          type: string
          format: date-time
        updatedDate:
          type: string
          format: date-time
    AssistantConversationRecording:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantRecordingUrl:
          type: string
          format: uri
        userRecordingUrl:
          type: string
          format: uri
        conversationRecordingUrl:
          type: string
          format: uri
    AssistantConversationTelephonyEvent:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        assistantConversationId:
          $ref: "#/components/schemas/Uint64String"
        provider:
          type: string
        eventType:
          type: string
        payload:
          type: object
          additionalProperties: true
        createdDate:
          type: string
          format: date-time
        updatedDate:
          type: string
          format: date-time
    AssistantConversation:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Uint64String"
        userId:
          $ref: "#/components/schemas/Uint64String"
        assistantId:
          $ref: "#/components/schemas/Uint64String"
        name:
          type: string
        projectId:
          $ref: "#/components/schemas/Uint64String"
        organizationId:
          $ref: "#/components/schemas/Uint64String"
        source:
          type: string
        createdBy:
          $ref: "#/components/schemas/Uint64String"
        updatedBy:
          $ref: "#/components/schemas/Uint64String"
        user:
          $ref: "#/components/schemas/User"
        assistantProviderModelId:
          $ref: "#/components/schemas/Uint64String"
        assistantConversationMessage:
          type: array
          items:
            $ref: "#/components/schemas/AssistantConversationMessage"
        identifier:
          type: string
        status:
          type: string
        createdDate:
          type: string
          format: date-time
        updatedDate:
          type: string
          format: date-time
        contexts:
          type: array
          items:
            $ref: "#/components/schemas/AssistantConversationContext"
        metrics:
          type: array
          items:
            $ref: "#/components/schemas/Metric"
        arguments:
          type: array
          items:
            $ref: "#/components/schemas/Argument"
        metadata:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        options:
          type: array
          items:
            $ref: "#/components/schemas/Metadata"
        direction:
          type: string
        recordings:
          type: array
          items:
            $ref: "#/components/schemas/AssistantConversationRecording"
        telephonyEvents:
          type: array
          items:
            $ref: "#/components/schemas/AssistantConversationTelephonyEvent"
