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

# Create Campaign

## Overview

The "Create Campaign" endpoint is designed to help users efficiently set up a new AI-driven calling campaign in Toingg. By sending a POST request to the `/create_campaign` endpoint, users can specify various parameters such as `title`, `voice`, `language`, and more. These parameters are crucial in defining the campaign's unique characteristics, including its script, purpose, and call handling settings. Additionally, the endpoint offers features for post-call analysis and cost tracking, making it an essential tool for optimizing AI calling strategies.

### Parameters

* `title`: Specifies the name of the campaign, helping users identify and manage multiple campaigns.
* `voice`: Determines the AI voice used during calls, allowing customization to match the campaign's tone and audience.
* `language`: Sets the language for the campaign, ensuring communication is clear and appropriate for the target audience.
* `script`: Provides the dialogue or script the AI will follow during calls, essential for maintaining consistency and achieving campaign objectives.
* `purpose`: Describes the campaign's goal, guiding the AI's interactions and ensuring alignment with business objectives.
* `knowledgeBase`: Links to a repository of information the AI can use to answer questions or provide details during calls.
* `calendar`: Integrates scheduling capabilities, enabling the AI to manage appointments or follow-ups.
* `firstLine`: Sets the initial line or greeting used by the AI, creating a strong first impression.
* `flowName`: Identifies the specific call flow or sequence of interactions, allowing for tailored customer experiences.
* `systemPrompt`: Provides additional instructions or context for the AI, enhancing its ability to handle complex scenarios.
* `tone`: Defines the emotional tone of the AI's voice, ensuring it aligns with the campaign's branding and audience expectations.
* `maxCallTimeout`: Specifies the maximum duration for a call, helping manage time and resources effectively.
* `inactiveCallTimeout`: Sets the timeout for inactive calls, ensuring efficient use of AI resources.
* `postCallAnalysis`: Enables or disables post-call analysis, providing insights into call performance and outcomes.
* `postCallAnalysisSchema`: Defines the structure for analyzing post-call data, allowing for detailed reporting and optimization.
* `totalCallTime`, `totalNumCall`, `totalSpent`, `averageCallCost`: Track and report on campaign metrics, offering insights into performance and cost-effectiveness.
* `isFreeflow`: Indicates whether the AI can deviate from the script, allowing for more natural and adaptive interactions.

These parameters collectively enable users to create highly customized and effective AI calling campaigns, with features for post-call analysis and cost tracking to optimize strategies.


## OpenAPI

````yaml POST /create_campaign
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.toingg.com/api/v3
security: []
paths:
  /create_campaign:
    post:
      tags:
        - Campaign handling
      summary: Create Campaign
      operationId: create_campaign_create_campaign_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/campaignModel'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    campaignModel:
      properties:
        title:
          type: string
          title: Title
        voice:
          type: string
          title: Voice
        language:
          type: string
          title: Language
        script:
          type: string
          title: Script
        purpose:
          type: string
          title: Purpose
        knowledgeBase:
          type: string
          title: Knowledgebase
        calendar:
          type: string
          title: Calendar
        firstLine:
          type: string
          title: Firstline
        flowName:
          type: string
          title: Flowname
          default: ''
        systemPrompt:
          type: string
          title: Systemprompt
          default: ''
        tone:
          type: string
          title: Tone
        maxCallTimeout:
          type: integer
          title: Maxcalltimeout
          default: 1
        inactiveCallTimeout:
          type: integer
          title: Inactivecalltimeout
          default: 15
        postCallAnalysis:
          type: boolean
          title: Postcallanalysis
          default: false
        postCallAnalysisSchema:
          type: object
          title: Postcallanalysisschema
        totalCallTime:
          type: integer
          title: Totalcalltime
        totalNumCall:
          type: integer
          title: Totalnumcall
        totalSpent:
          type: number
          title: Totalspent
        averageCallCost:
          type: number
          title: Averagecallcost
        timeZone:
          type: string
          title: Timezone
          default: UTC
        isFreeflow:
          type: boolean
          title: Isfreeflow
          default: true
        public:
          type: boolean
          title: Public
          default: false
        sampleSid:
          type: string
          title: Samplesid
          default: ''
        description:
          type: string
          title: Description
          default: ''
      type: object
      required:
        - title
        - voice
        - language
        - script
        - purpose
        - knowledgeBase
        - calendar
        - firstLine
        - tone
        - postCallAnalysisSchema
        - totalCallTime
        - totalNumCall
        - totalSpent
        - averageCallCost
      title: campaignModel
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: login

````