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

# Create Campaign

> Create a campaign, optionally with contacts (up to 10,000) and optionally started at once with `start: true`. Duplicate numbers are skipped.



## OpenAPI

````yaml POST /campaigns
openapi: 3.1.0
info:
  title: RevRing Voice AI API
  description: >-
    RevRing Voice AI platform API for managing AI voice agents, phone calls, SIP
    trunks, and analytics. Build intelligent voice applications that can handle
    inbound and outbound phone calls with AI-powered conversational agents.
  version: 1.0.0
  contact:
    name: RevRing Support
    url: https://revring.ai
servers:
  - url: https://api.revring.ai/v1
    description: Production API
security:
  - apiKeyAuth: []
tags:
  - name: Messaging Connections
    description: Connect messaging providers so agents can send text messages
  - name: Messages
    description: Send text messages and read your message log
  - name: Conversations
    description: List and clear managed conversation threads
  - name: SIP Trunks
    description: Manage SIP trunks for connecting agents to the phone network
  - name: Agents
    description: Manage AI voice agents and their configuration
  - name: Agent Folders
    description: Organize agents into folders for dashboard navigation
  - name: Calls
    description: Manage and query phone calls
  - name: Analytics
    description: Get analytics and metrics about your calls
  - name: Knowledge Bases
    description: >-
      Manage knowledge bases and sources for agent retrieval-augmented
      generation
  - name: Test Suites
    description: Manage test suites, test cases, and test runs for agent evaluation
  - name: Voices
    description: Browse the voices available to your organization for agent speech
  - name: Webhooks
    description: Webhook delivery settings for your organization
paths:
  /campaigns:
    post:
      tags:
        - Campaigns
      summary: Create Campaign
      description: >-
        Create a campaign, optionally with contacts (up to 10,000) and
        optionally started at once with `start: true`. Duplicate numbers are
        skipped.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - agentId
                - fromNumber
              properties:
                name:
                  type: string
                fromNumber:
                  type: string
                  description: Caller ID; must be on the agent's SIP trunk
                environment:
                  type: string
                  nullable: true
                startAt:
                  type: string
                  format: date-time
                  nullable: true
                  description: Don't dial before this time
                callingWindow:
                  type: object
                  description: >-
                    Calling window. A contact's own timezone wins over the
                    campaign's.
                  properties:
                    start:
                      type: string
                      example: '09:00'
                      description: 24h HH:MM
                    end:
                      type: string
                      example: '18:00'
                      description: >-
                        24h HH:MM (exclusive); may be earlier than start to
                        cross midnight
                    days:
                      type: array
                      items:
                        type: integer
                        minimum: 0
                        maximum: 6
                      description: 0 = Sunday. Default Monday to Friday
                    timezone:
                      type: string
                      example: America/New_York
                  required:
                    - start
                    - end
                    - timezone
                  nullable: true
                retryPolicy:
                  type: object
                  properties:
                    maxAttempts:
                      type: integer
                      minimum: 1
                      maximum: 10
                      default: 3
                    retryDelayMinutes:
                      type: integer
                      minimum: 1
                      maximum: 10080
                      default: 60
                    retryOn:
                      type: array
                      items:
                        type: string
                        enum:
                          - no_answer
                          - busy
                          - voicemail
                          - declined
                          - failed
                      default:
                        - no_answer
                        - busy
                        - failed
                  nullable: true
                maxConcurrency:
                  type: integer
                  minimum: 1
                  nullable: true
                callsPerSecond:
                  type: number
                  minimum: 0.1
                  maximum: 10
                  default: 1
                defaultVariables:
                  type: object
                  additionalProperties: true
                agentId:
                  type: string
                contacts:
                  type: array
                  items:
                    type: object
                    required:
                      - toNumber
                    properties:
                      toNumber:
                        type: string
                        description: E.164
                      variables:
                        type: object
                        additionalProperties: true
                        description: Passed to the call like Send Call variables
                      timezone:
                        type: string
                        description: >-
                          IANA time zone used for this contact's calling window;
                          inferred from the number when omitted
                  maxItems: 10000
                start:
                  type: boolean
                  default: false
                voicemailStrategy:
                  type: string
                  enum:
                    - agent
                    - last_attempt
                  default: agent
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/Campaign'
                      - type: object
                        properties:
                          contactsAdded:
                            type: integer
                          duplicatesSkipped:
                            type: integer
        '400':
          description: invalid_body, agent_missing_trunk, from_number_not_on_trunk
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '404':
          description: agent_not_found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
components:
  schemas:
    Campaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
            - draft
            - running
            - paused
            - completed
            - canceled
        agentId:
          type: string
        agentName:
          type: string
          nullable: true
        fromNumber:
          type: string
          description: Caller ID; must be on the agent's SIP trunk
        environment:
          type: string
          nullable: true
        startAt:
          type: string
          format: date-time
          nullable: true
          description: Don't dial before this time
        callingWindow:
          type: object
          description: Calling window. A contact's own timezone wins over the campaign's.
          properties:
            start:
              type: string
              example: '09:00'
              description: 24h HH:MM
            end:
              type: string
              example: '18:00'
              description: >-
                24h HH:MM (exclusive); may be earlier than start to cross
                midnight
            days:
              type: array
              items:
                type: integer
                minimum: 0
                maximum: 6
              description: 0 = Sunday. Default Monday to Friday
            timezone:
              type: string
              example: America/New_York
          required:
            - start
            - end
            - timezone
          nullable: true
        retryPolicy:
          type: object
          properties:
            maxAttempts:
              type: integer
              minimum: 1
              maximum: 10
              default: 3
            retryDelayMinutes:
              type: integer
              minimum: 1
              maximum: 10080
              default: 60
            retryOn:
              type: array
              items:
                type: string
                enum:
                  - no_answer
                  - busy
                  - voicemail
                  - declined
                  - failed
              default:
                - no_answer
                - busy
                - failed
          nullable: true
        maxConcurrency:
          type: integer
          minimum: 1
          nullable: true
        callsPerSecond:
          type: number
          minimum: 0.1
          maximum: 10
          default: 1
        voicemailStrategy:
          type: string
          enum:
            - agent
            - last_attempt
          default: agent
          description: >-
            `last_attempt`: hang up on voicemail and retry; leave the message
            only on the final attempt
        defaultVariables:
          type: object
          additionalProperties: true
        progress:
          type: object
          properties:
            total:
              type: integer
            done:
              type: integer
            contacts:
              type: object
              additionalProperties:
                type: integer
              description: Contacts per status
            outcomes:
              type: object
              additionalProperties:
                type: integer
              description: Contacts per outcome
        startedAt:
          type: string
          nullable: true
        completedAt:
          type: string
          nullable: true
        createdAt:
          type: string
        updatedAt:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Generate API keys from the RevRing
        dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.