Docs menu

Campaigns

A campaign calls a whole list within the allowed hours and tries again with people who did not pick up. Everyone on it must have agreed to hear from you.

GET /campaigns

Your campaigns. Any key, including a read-only key.

Request

curl https://navaprastha.in/api/v1/campaigns \
  -H "Authorization: Bearer $NAVAPRASTHA_KEY"

Response

{
  "data": [
    {
      "id": "c7a1e4d9b2f84a10",
      "name": "April fee reminder",
      "purpose": "reminder",
      "script": "The April fee is due on the 10th.",
      "status": "running",
      "numberId": "n_2b44c901",
      "windowStart": 600,
      "windowEnd": 1080,
      "maxAttempts": 2,
      "retryMinutes": 120,
      "maxConcurrent": 2,
      "consentAttested": true,
      "createdAt": 1794135000,
      "startedAt": 1794135100,
      "finishedAt": null,
      "stats": null
    }
  ]
}

POST /campaigns

Create a campaign, optionally with the people, and start it. Needs a full-access key.

windowStart and windowEnd are minutes after midnight, India time, between 540 (9 am) and 1260 (9 pm). Extra fields on a contact (like amount) are told to the employee on that person's call. consent must be true.

Request body

name
text, required
A name for you.
purpose
text, required
reminder, followup, feedback or information.
script
text
What the employee should say or ask.
consent
true or false, required
Must be true: everyone on the list agreed to be contacted or is your customer.
windowStart
integer
Minutes after midnight, 540 or more.
windowEnd
integer
Minutes after midnight, 1260 or less.
maxAttempts
integer
How many times to try each person.
contacts
list
Up to 1,000 people: { name, phone, ... }.
start
true or false
Start straight away.

Request

curl -X POST https://navaprastha.in/api/v1/campaigns \
  -H "Authorization: Bearer $NAVAPRASTHA_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: unique-text-from-your-system" \
  -d '{"name":"April fee reminder","purpose":"reminder","script":"The April fee is due on the 10th.","consent":true,"windowStart":600,"windowEnd":1080,"maxAttempts":2,"contacts":[{"name":"Anitha","phone":"98480 42345","amount":"5000"}],"start":true}'

Response

{
  "data": {
    "id": "c7a1e4d9b2f84a10",
    "name": "April fee reminder",
    "purpose": "reminder",
    "script": "The April fee is due on the 10th.",
    "status": "running",
    "numberId": "n_2b44c901",
    "windowStart": 600,
    "windowEnd": 1080,
    "maxAttempts": 2,
    "retryMinutes": 120,
    "maxConcurrent": 2,
    "consentAttested": true,
    "createdAt": 1794135000,
    "startedAt": 1794135100,
    "finishedAt": null,
    "stats": {
      "total": 40,
      "byStatus": {
        "queued": 28,
        "done": 12
      },
      "remaining": 28
    }
  },
  "contacts": {
    "added": 1,
    "duplicates": 0,
    "dnc": 0,
    "invalid": []
  }
}

GET /campaigns/{id}

Progress and counts. Any key, including a read-only key.

Request

curl https://navaprastha.in/api/v1/campaigns/ID \
  -H "Authorization: Bearer $NAVAPRASTHA_KEY"

Response

{
  "data": {
    "id": "c7a1e4d9b2f84a10",
    "name": "April fee reminder",
    "purpose": "reminder",
    "script": "The April fee is due on the 10th.",
    "status": "running",
    "numberId": "n_2b44c901",
    "windowStart": 600,
    "windowEnd": 1080,
    "maxAttempts": 2,
    "retryMinutes": 120,
    "maxConcurrent": 2,
    "consentAttested": true,
    "createdAt": 1794135000,
    "startedAt": 1794135100,
    "finishedAt": null,
    "stats": {
      "total": 40,
      "byStatus": {
        "queued": 28,
        "done": 12
      },
      "remaining": 28
    }
  }
}

POST /campaigns/{id}/contacts

Add people to a draft or paused campaign. Needs a full-access key.

Up to 1,000 people each time and 20,000 in a campaign. The answer counts added, duplicates, dnc and lists the invalid rows.

Request

curl -X POST https://navaprastha.in/api/v1/campaigns/ID/contacts \
  -H "Authorization: Bearer $NAVAPRASTHA_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: unique-text-from-your-system" \
  -d '{"contacts":[{"name":"Bhavya","phone":"98480 42346"}]}'

Response

{
  "added": 1,
  "duplicates": 0,
  "dnc": 0,
  "invalid": []
}

POST /campaigns/{id}/start

Start or resume a campaign. Needs a full-access key.

Request

curl -X POST https://navaprastha.in/api/v1/campaigns/ID/start \
  -H "Authorization: Bearer $NAVAPRASTHA_KEY"

Response

{
  "data": {
    "id": "c7a1e4d9b2f84a10",
    "name": "April fee reminder",
    "purpose": "reminder",
    "script": "The April fee is due on the 10th.",
    "status": "running",
    "numberId": "n_2b44c901",
    "windowStart": 600,
    "windowEnd": 1080,
    "maxAttempts": 2,
    "retryMinutes": 120,
    "maxConcurrent": 2,
    "consentAttested": true,
    "createdAt": 1794135000,
    "startedAt": 1794135100,
    "finishedAt": null,
    "stats": {
      "total": 40,
      "byStatus": {
        "queued": 28,
        "done": 12
      },
      "remaining": 28
    }
  }
}

POST /campaigns/{id}/pause

Pause a running campaign. Needs a full-access key.

Request

curl -X POST https://navaprastha.in/api/v1/campaigns/ID/pause \
  -H "Authorization: Bearer $NAVAPRASTHA_KEY"

Response

{
  "data": {
    "id": "c7a1e4d9b2f84a10",
    "name": "April fee reminder",
    "purpose": "reminder",
    "script": "The April fee is due on the 10th.",
    "status": "paused",
    "numberId": "n_2b44c901",
    "windowStart": 600,
    "windowEnd": 1080,
    "maxAttempts": 2,
    "retryMinutes": 120,
    "maxConcurrent": 2,
    "consentAttested": true,
    "createdAt": 1794135000,
    "startedAt": 1794135100,
    "finishedAt": null,
    "stats": {
      "total": 40,
      "byStatus": {
        "queued": 28,
        "done": 12
      },
      "remaining": 28
    }
  }
}

Last updated 13 November 2026. Found something wrong on this page? Email bodavulasiddardha@navaprastha.in and we will correct it.