docs: add developer and api reference tabs (#190)

* docs: add developer and api reference tabs

* fix: remove duplicate image
This commit is contained in:
Sabiha Khan 2026-03-14 16:30:02 +05:30 committed by GitHub
parent 1b03191cf8
commit f075bcb623
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 1609 additions and 57 deletions

View file

@ -0,0 +1,20 @@
---
title: "Create Campaign"
description: "Create a new outbound calling campaign"
openapi: "POST /api/v1/campaign/create"
---
Before creating a campaign, [upload your contacts CSV](/api-reference/campaigns/upload-contacts) to get a `source_url`.
The `time_slots` field controls when Dograh is allowed to place calls. If omitted, calls can be placed at any time. The `timezone` field applies to all time slot windows.
```json
{
"time_slots": [
{ "day": "monday", "start": "09:00", "end": "17:00" },
{ "day": "tuesday", "start": "09:00", "end": "17:00" }
]
}
```
Once created, the campaign is in `draft` status. Call [Start](/api-reference/campaigns/start) to begin dialing.

View file

@ -0,0 +1,5 @@
---
title: "Get Campaign"
description: "Retrieve a single campaign by ID"
openapi: "GET /api/v1/campaign/{campaign_id}"
---

View file

@ -0,0 +1,5 @@
---
title: "List Campaigns"
description: "Retrieve all campaigns for your organization"
openapi: "GET /api/v1/campaign/"
---

View file

@ -0,0 +1,7 @@
---
title: "Pause Campaign"
description: "Temporarily stop a running campaign"
openapi: "POST /api/v1/campaign/{campaign_id}/pause"
---
Stops dispatching new calls. In-flight calls are not interrupted — they run to completion. Use [Resume](/api-reference/campaigns/resume) to continue from where the campaign paused.

View file

@ -0,0 +1,16 @@
---
title: "Get Campaign Progress"
description: "Get the current progress of a campaign"
openapi: "GET /api/v1/campaign/{campaign_id}/progress"
---
Returns a real-time snapshot of how many contacts have been processed.
| Field | Description |
|---|---|
| `total` | Total number of contacts in the campaign |
| `processed` | Contacts that have been attempted at least once |
| `completed` | Contacts with a successful call outcome |
| `failed` | Contacts that exhausted all retry attempts without success |
| `pending` | Contacts not yet attempted |
| `completion_percentage` | `processed / total × 100` |

View file

@ -0,0 +1,7 @@
---
title: "Resume Campaign"
description: "Resume a paused campaign"
openapi: "POST /api/v1/campaign/{campaign_id}/resume"
---
Resumes dispatching calls from where the campaign paused. Only valid on campaigns in `paused` status.

View file

@ -0,0 +1,7 @@
---
title: "Get Campaign Runs"
description: "Retrieve individual call records for each contact in a campaign"
openapi: "GET /api/v1/campaign/{campaign_id}/runs"
---
Returns the individual call records for each contact in the campaign. Each record includes the same fields as a [workflow run](/api-reference/calls#retrieve-call-details), including call status, duration, transcript, and recording URL.

View file

@ -0,0 +1,7 @@
---
title: "Start Campaign"
description: "Start dialing contacts in a campaign"
openapi: "POST /api/v1/campaign/{campaign_id}/start"
---
Transitions the campaign from `draft` or `paused` to `running`. Dograh begins dialing contacts up to the configured `max_concurrency`.

View file

@ -0,0 +1,7 @@
---
title: "Update Campaign"
description: "Update campaign settings"
openapi: "PATCH /api/v1/campaign/{campaign_id}"
---
You can update name, concurrency, time slots, and retry config. Updates are only allowed on campaigns in `draft` or `paused` status — [pause the campaign](/api-reference/campaigns/pause) first if it is currently running.

View file

@ -0,0 +1,33 @@
---
title: "Upload Contacts CSV"
description: "Get a presigned S3 URL to upload a contacts CSV for a campaign"
openapi: "POST /api/v1/s3/presigned-upload-url"
---
Uploading contacts is a two-step process. First call this endpoint to get a presigned upload URL, then PUT your CSV directly to that URL.
```bash
# Step 1: Get upload URL
curl -X POST https://your-dograh-instance/api/v1/s3/presigned-upload-url \
-H "X-API-Key: dg_your_api_key"
# Response:
# { "upload_url": "https://...", "s3_key": "campaigns/..." }
# Step 2: Upload the CSV
curl -X PUT "https://presigned-url..." \
-H "Content-Type: text/csv" \
--data-binary @contacts.csv
```
Use the `s3_key` from the response as the `source_url` when [creating a campaign](/api-reference/campaigns/create).
### CSV format
The CSV must include a `phone_number` column. Any additional columns are passed as `initial_context` to each call, making them available as template variables in the workflow.
```csv
phone_number,customer_name,plan
+14155550100,Jane Smith,premium
+14155550101,Bob Jones,basic
```