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

# Trigger a scenario

> Launches a voice campaign that places an outbound call using a pre-configured scenario. Track progress with the returned voice campaign `id`.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml post /v1/voice-campaigns
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
paths:
  /v1/voice-campaigns:
    post:
      tags:
        - Voice campaigns
      summary: Trigger a scenario
      description: >-
        Launches a voice campaign that places an outbound call using a
        pre-configured scenario. Track progress with the returned voice campaign
        `id`.
      operationId: voice_campaigns_create
      parameters: []
      requestBody:
        description: Attributes for the new voice campaign.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/VoiceCampaignCreateRequest'
                - description: Scenario and contact details for the campaign.
        required: true
      responses:
        '201':
          description: Returns the launched voice campaign.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceCampaignsCreateResponse'
              examples:
                success:
                  summary: Successful response
                  value:
                    voice_campaign:
                      id: 2321423
                      status: status
                      timestamp: '2023-06-15T10:30:00Z'
                      caller_id: org_123
                      contact: contact
        '400':
          $ref: '#/components/responses/BadRequestErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '422':
          description: >-
            Returns when the account has insufficient funds to launch the
            campaign.
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/RecordNotFoundErrorResponse'
                  - example:
                      success: false
                      message: Insufficient funds
              examples:
                default:
                  value:
                    success: false
                    message: Insufficient funds
      deprecated: false
      security:
        - bearerAuth:
            - campaigns:write
components:
  schemas:
    VoiceCampaignCreateRequest:
      title: VoiceCampaignCreateRequest
      required:
        - voice_campaign
      type: object
      additionalProperties: false
      properties:
        voice_campaign:
          $ref: '#/components/schemas/VoiceCampaignResponse'
    VoiceCampaignsCreateResponse:
      type: object
      additionalProperties: false
      properties:
        voice_campaign:
          type: object
          additionalProperties: false
          properties:
            id:
              type: integer
              description: Unique identifier of the voice campaign.
              example: 2321423
            status:
              type: string
              description: Current status of the voice campaign, such as `in_progress`.
              example: in_progress
            timestamp:
              type: string
              format: date-time
              description: >-
                Timestamp when the voice campaign was created, in ISO 8601
                format.
              example: '2023-08-03T09:04:12.000Z'
            caller_id:
              type: string
              description: >-
                Phone number used as the Caller ID for the outbound call, in
                E.164 format.
              example: '13123310912'
            contact:
              type: string
              description: >-
                Destination phone number the outbound call is placed to, in
                E.164 format.
              example: '16729923812'
    RecordNotFoundErrorResponse:
      title: RecordNotFoundErrorResponse
      required:
        - success
        - message
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable error description
          example: Record not found
      example:
        success: false
        message: Record not found
    VoiceCampaignResponse:
      title: VoiceCampaignResponse
      description: >-
        Represents a voice campaign that places an outbound call running a
        pre-approved call flow.
      required:
        - callflow_id
        - caller_id
        - contact
      type: object
      additionalProperties: false
      properties:
        callflow_id:
          type: integer
          description: >-
            Unique identifier of the call flow to launch, listed on the Call
            flows page. Every scenario must be pre-approved by the Wavix Service
            Operations team before it can be used in production.
          format: int32
          example: 3212
        caller_id:
          type: string
          description: >-
            Phone number on the account used as the Caller ID for the outbound
            call, in E.164 format.
          example: '13123310912'
        contact:
          type: string
          description: >-
            Destination phone number the outbound call is placed to, in E.164
            format.
          example: '16729923812'
        callback_url:
          type: string
          description: Webhook URL that receives voice campaign status updates.
          example: https://you-site.com/webhook
    ValidationErrorResponse:
      title: ValidationErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description naming the missing or invalid request
            parameter.
          example: Missing or invalid parameter <param_name>
    ForbiddenErrorResponse:
      title: ForbiddenErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable description of why access is forbidden.
          example: The service is not provisioned for your account.
  responses:
    BadRequestErrorResponse:
      description: Request failed. Missing or invalid parameter <param_name>
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
    ForbiddenErrorResponse:
      description: Request failed. The feature is disabled for your account.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````