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

# Create Campaign

> Create Campaign.

<Note>Actual endpoint: `POST https://api.ravan.ai/api/v1/campaigns/` (note the trailing slash)</Note>

### Authorizations

<ParamField header="X-Api-Key" type="string" required>
  Your Agni API key used to authenticate the request. Pass it in the `X-Api-Key` header. Find or rotate it from your Ravan AI account settings.
</ParamField>

***

### Body

<ParamField body="name" type="string" required placeholder="test agent harsh">
  The internal name of the resource. Use a clear name that your team can recognize in the dashboard and API responses.
</ParamField>

<ParamField body="agentId" type="string" required placeholder="019e92f8-f032-7fb7-b294-508f4167618e">
  The unique ID of the agent that should own, handle, or be assigned to this resource. Use the `id` returned by the Agent API.
</ParamField>

<ParamField body="phoneNumberId" type="string" required placeholder="019e92f4-097d-7a52-b5e5-fa7e0dd0761f">
  The phone number record ID to use for calls or campaigns. Use the ID returned by the telephony endpoints.
</ParamField>

<ParamField body="fromPhoneNumber" type="string" required placeholder="+918035088113">
  The caller ID used for outbound calls, in E.164 format. The number must be purchased, imported, or connected in Agni.
</ParamField>

<ParamField body="contactIds" type="string[]" required>
  A list of contact IDs to include in the request. Each ID must belong to a contact in your organization.
</ParamField>

<ParamField body="schedule" type="object">
  The campaign schedule settings. Use this object to define calling windows, timezone, concurrency, and retry behavior.

  <Expandable title="schedule">
    <ParamField body="windowStart" type="string" placeholder="09:00">
      The daily start time for campaign calls in `HH:mm` 24-hour format.
    </ParamField>

    <ParamField body="windowEnd" type="string" placeholder="17:00">
      The daily end time for campaign calls in `HH:mm` 24-hour format.
    </ParamField>

    <ParamField body="windowDays" type="integer[]" placeholder="[1, 2, 3, 4, 5]">
      The days of the week when the campaign can place calls. Use integers `1` through `7`, where `1` is Monday and `7` is Sunday.
    </ParamField>

    <ParamField body="timezone" type="string" placeholder="Asia/Kolkata">
      The IANA timezone used for schedules and appointment availability.
    </ParamField>

    <ParamField body="maxConcurrent" type="integer" placeholder="1">
      The maximum number of calls the campaign can run at the same time.
    </ParamField>

    <ParamField body="retryAttempts" type="integer" placeholder="2">
      The maximum number of retry attempts per contact after an unsuccessful campaign call.
    </ParamField>

    <ParamField body="retryGapMin" type="integer" placeholder="30">
      The wait time, in minutes, between campaign retry attempts.
    </ParamField>
  </Expandable>
</ParamField>

***

### Response

<ResponseField name="success" type="boolean">
  Whether the request succeeded.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseField name="data" type="object">
  Created campaign object.

  <Expandable title="data">
    <ResponseField name="id" type="string">
      Campaign UUID. Example: `019ebbef-48d7-7ebc-a751-4a10362a3bbf`
    </ResponseField>

    <ResponseField name="organizationId" type="string">
      Organization UUID. Example: `95a4e479-03a7-4f1b-834d-8705756e8e59`
    </ResponseField>

    <ResponseField name="name" type="string">
      Campaign name. Example: `Q4 Outreach`
    </ResponseField>

    <ResponseField name="agentId" type="string">
      Assigned agent UUID. Example: `019e92f8-f032-7fb7-b294-508f4167618e`
    </ResponseField>

    <ResponseField name="phoneNumberId" type="string">
      Phone number UUID. Example: `019e92f4-097d-7a52-b5e5-fa7e0dd0761f`
    </ResponseField>

    <ResponseField name="fromPhoneNumber" type="string">
      Caller ID in E.164 format. Example: `+918035088113`
    </ResponseField>

    <ResponseField name="status" type="string">
      Campaign status: `draft`, `active`, `paused`, `completed`.
    </ResponseField>

    <ResponseField name="executionStatus" type="string">
      Execution state of the campaign: `draft`, `running`, `paused`, `completed`.
    </ResponseField>

    <ResponseField name="schedule" type="object">
      Campaign scheduling configuration.

      <Expandable title="schedule">
        <ResponseField name="start" type="string">
          Campaign start datetime.
        </ResponseField>

        <ResponseField name="end" type="string">
          Campaign end datetime.
        </ResponseField>

        <ResponseField name="windowStart" type="string">
          Daily calling window start time. Example: `09:00`
        </ResponseField>

        <ResponseField name="windowEnd" type="string">
          Daily calling window end time. Example: `17:00`
        </ResponseField>

        <ResponseField name="windowDays" type="integer[]">
          Active days of the week (1=Monday … 7=Sunday). Example: `[1, 2, 3, 4, 5]`
        </ResponseField>

        <ResponseField name="timezone" type="string">
          Timezone for the schedule. Example: `Asia/Kolkata`
        </ResponseField>

        <ResponseField name="maxConcurrent" type="integer">
          Maximum concurrent calls. Example: `1`
        </ResponseField>

        <ResponseField name="retryAttempts" type="integer">
          Number of retry attempts. Example: `2`
        </ResponseField>

        <ResponseField name="retryGapMin" type="integer">
          Gap in minutes between retries. Example: `30`
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="contactStats" type="object">
      Aggregated contact-level statistics.

      <Expandable title="contactStats">
        <ResponseField name="total" type="integer">Total contacts.</ResponseField>
        <ResponseField name="contacted" type="integer">Contacts successfully reached.</ResponseField>
        <ResponseField name="successful" type="integer">Contacts with a successful outcome.</ResponseField>
        <ResponseField name="failed" type="integer">Contacts that failed.</ResponseField>
        <ResponseField name="noAnswer" type="integer">Contacts that did not answer.</ResponseField>
        <ResponseField name="pending" type="integer">Contacts yet to be called.</ResponseField>
        <ResponseField name="inProgress" type="integer">Contacts currently being called.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="startedAt" type="string">
      Timestamp when the campaign started (ISO 8601).
    </ResponseField>

    <ResponseField name="completedAt" type="string">
      Timestamp when the campaign completed (ISO 8601).
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Creation timestamp. Example: `2026-06-12T13:04:41Z`
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      Last updated timestamp. Example: `2026-06-12T13:04:41Z`
    </ResponseField>

    <ResponseField name="outboundMaxConcurrent" type="integer">
      Maximum concurrent outbound calls limit.
    </ResponseField>

    <ResponseField name="outboundMaxCps" type="integer">
      Maximum outbound calls per second.
    </ResponseField>
  </Expandable>
</ResponseField>
