Skip to main content
POST
/
api
/
v1
/
campaigns
/
Create Campaign
curl --request POST \
  --url https://api.ravan.ai/api/v1/campaigns/ \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "agentId": "<string>",
  "phoneNumberId": "<string>",
  "fromPhoneNumber": "<string>",
  "contactIds": [
    "<string>"
  ],
  "schedule": {
    "windowStart": "<string>",
    "windowEnd": "<string>",
    "windowDays": [
      123
    ],
    "timezone": "<string>",
    "maxConcurrent": 123,
    "retryAttempts": 123,
    "retryGapMin": 123
  }
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "id": "<string>",
    "organizationId": "<string>",
    "name": "<string>",
    "agentId": "<string>",
    "phoneNumberId": "<string>",
    "fromPhoneNumber": "<string>",
    "status": "<string>",
    "executionStatus": "<string>",
    "schedule": {
      "start": "<string>",
      "end": "<string>",
      "windowStart": "<string>",
      "windowEnd": "<string>",
      "windowDays": [
        123
      ],
      "timezone": "<string>",
      "maxConcurrent": 123,
      "retryAttempts": 123,
      "retryGapMin": 123
    },
    "contactStats": {
      "total": 123,
      "contacted": 123,
      "successful": 123,
      "failed": 123,
      "noAnswer": 123,
      "pending": 123,
      "inProgress": 123
    },
    "startedAt": "<string>",
    "completedAt": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "outboundMaxConcurrent": 123,
    "outboundMaxCps": 123
  }
}
Actual endpoint: POST https://api.ravan.ai/api/v1/campaigns/ (note the trailing slash)

Authorizations

X-Api-Key
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.

Body

name
string
required
The internal name of the resource. Use a clear name that your team can recognize in the dashboard and API responses.
agentId
string
required
The unique ID of the agent that should own, handle, or be assigned to this resource. Use the id returned by the Agent API.
phoneNumberId
string
required
The phone number record ID to use for calls or campaigns. Use the ID returned by the telephony endpoints.
fromPhoneNumber
string
required
The caller ID used for outbound calls, in E.164 format. The number must be purchased, imported, or connected in Agni.
contactIds
string[]
required
A list of contact IDs to include in the request. Each ID must belong to a contact in your organization.
schedule
object
The campaign schedule settings. Use this object to define calling windows, timezone, concurrency, and retry behavior.

Response

success
boolean
Whether the request succeeded.
message
string
Human-readable status message.
data
object
Created campaign object.