Tasks (async operations)
Create, copy and batch changes can return HTTP 202 with a task ID. Poll the task to see progress, totals and individual failures. Keep the final list of affected campaign IDs for reconciliation.
Some operations talk to Telegram once per campaign, so they can take longer than an HTTP request should wait. These return 202 Accepted with a task instead of the final result:
POST /v1/campaigns— createPOST /v1/campaigns/{ad_id}/copy— copyPOST /v1/campaigns/bulk— pause, resume, budget, CPM or delete many
Single-campaign changes (PATCH, pause, resume, budget, delete) answer directly — no task.
The 202 response
HTTP/1.1 202 Accepted
Location: /api/v1/tasks/81234
Retry-After: 2{
"success": true,
"data": {
"id": 81234,
"type": "create",
"status": "pending",
"account_id": 53,
"progress": 0,
"total": 3,
"succeeded": null,
"failed": null,
"ad_ids": [],
"errors": [],
"paused_reason": null,
"error": null,
"created_at": "2026-10-08T10:15:02.411Z",
"started_at": null,
"completed_at": null
}
}GET /v1/tasks/{id}
curl -s https://orbitoads.pro/api/v1/tasks/81234 -H "X-API-Key: $ORBITO_API_KEY"Same shape as above. Poll it until status is final; while a task is pending or running the response carries Retry-After: 2 — wait that long between polls. Any key of the same owner can read the task.
| Field | Meaning |
|---|---|
type | create, copy, status (bulk pause/resume), budget, cpm, delete |
status | see below |
progress / total | campaigns processed so far / in total |
succeeded / failed | counts, once known |
ad_ids | campaigns the task created (create, copy) or changed (bulk) |
errors[] | up to 50 failures: { ad_id, index, error } — index is the position in your campaigns array for creates |
paused_reason | why a task stopped to wait, e.g. the cabinet ran out of balance |
error | why the whole task failed |
Statuses
| Status | Meaning | Final? |
|---|---|---|
pending | queued — the cabinet runs one create and one other operation at a time | no |
running | in progress | no |
paused | stopped to wait — usually the cabinet balance ran out mid-way. Top up the cabinet; resume it from the panel | no |
completed | finished. Check failed and errors — a completed task can contain individual failures | yes |
failed | the task as a whole failed — see error | yes |
cancelled | cancelled from the panel | yes |
Things to know about creates
- New campaign ids appear in
ad_idswhen the task completes (they are found by syncing the cabinet after the last campaign is created). - If the first campaign of a batch fails, the task stops there rather than repeat the same mistake 100 times. Fix the input and send again.
- If Telegram can’t resolve any of a campaign’s channels or bots, that campaign fails with
No targets found: …listing them. - Telegram reviews every new ad. A created campaign usually starts
In Review; a webhook tells you when that changes.
A polling loop
async function waitForTask(id) {
for (;;) {
const res = await fetch(`https://orbitoads.pro/api/v1/tasks/${id}`, {
headers: { 'X-API-Key': process.env.ORBITO_API_KEY },
});
const { data } = await res.json();
if (['completed', 'failed', 'cancelled'].includes(data.status)) return data;
if (data.status === 'paused') throw new Error(`Task paused: ${data.paused_reason}`);
await new Promise(r => setTimeout(r, Number(res.headers.get('Retry-After') || 2) * 1000));
}
}import time, requests
def wait_for_task(task_id):
while True:
r = requests.get(f"https://orbitoads.pro/api/v1/tasks/{task_id}",
headers={"X-API-Key": API_KEY}, timeout=30)
task = r.json()["data"]
if task["status"] in ("completed", "failed", "cancelled"):
return task
if task["status"] == "paused":
raise RuntimeError(f"Task paused: {task['paused_reason']}")
time.sleep(int(r.headers.get("Retry-After", 2)))API reference
The full advertising contract requires a dedicated provider credential for this workspace. Use your Orbito API key for client calls. Account orders, provisioning and external billing are separate workflows.
GET /api/v1/tasks/{id}
Read job progress, resulting ad identifiers and individual failures.
| Parameter | Location | Format | Required |
|---|---|---|---|
id | path | integer | Yes |
X-API-Key | header | string | Yes |
curl -X GET https://orbitoads.pro/api/v1/tasks/96203 \
-H 'X-API-Key: YOUR_ORBITO_KEY'{
"success": true,
"data": {
"id": 96203,
"type": "create",
"status": "completed",
"account_id": 7401,
"total": 1,
"ad_ids": [
38019
],
"progress": 1,
"succeeded": 1,
"failed": 0,
"errors": [],
"paused_reason": null,
"error": null,
"created_at": "2026-11-03T12:01:00Z",
"started_at": "2026-11-03T12:01:02Z",
"completed_at": "2026-11-03T12:01:04Z"
}
}Implementation notes
Accepted work and completion
Create, copy and bulk requests return HTTP 202 with a task id. Poll GET /api/v1/tasks/{id}, respecting Retry-After. Check failed and errors even when status is completed.
Job outcomes
pending, running and paused are nonterminal states. completed, failed and cancelled end the job. Use progress, total, ad_ids and up to 50 item errors. A paused_reason can identify a budget shortage that the operator resolves in the panel.
Operations and fields
GET /api/v1/tasks/{id} pending running paused completed failed cancelled succeeded failed errors
- GET /api/v1/tasks/{id}
- pending
- running
- paused
- completed
- failed
- cancelled
- succeeded
- failed
- errors
Request example
GET /api/v1/tasks/{id} HTTP/1.1 Host: orbitoads.pro X-API-Key: {key}
Schema fields and limits
This table follows the public v1 contract. Parameter and field names are case-sensitive. For each operation, the HTTP response codes distinguish a successful result, input validation and access checks. The linked specification defines the full request and response shapes.
Report dimensions
The API accepts up to 100 campaigns in a create request, up to 100 copies in one copy request, and up to 1,000 existing campaigns in one bulk operation. A 202 response identifies the queued task. Inspect failed and errors on completion before changing the next group.
Protocol reference
| Method | Route | Parameters | Request content | Response codes |
|---|---|---|---|---|
| GET | /api/v1/tasks/{id} | id | — | 200, 400, 401, 404 |
| POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest | CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 |
| POST | /api/v1/campaigns/bulk | Idempotency-Key | application/json · BulkRequest | 202, 400, 401, 403, 404, 409, 422, 429 |
| POST | /api/v1/campaigns/{ad_id}/copy | ad_id, account_id, Idempotency-Key | application/json · CopyRequest | 202, 400, 401, 403, 404, 409, 422, 429 |
Source · Data source
Schema fields and limits · Tracking a queued operation
| Field | Documented value |
|---|---|
| HTTP 202 | Location, Retry-After |
| status | pending, running, paused, completed, failed, cancelled |
| progress / total | integer / integer |
| succeeded / failed | integer | null |
| errors[] | ≤ 50 |
| ad_ids[] | integer |
Source · Data source
Task
| Field | Field type |
|---|---|
| id | integer |
| type | create | copy | status | budget | cpm | delete | edit | recreate |
| status | pending | running | paused | completed | failed | cancelled |
| account_id | integer |
| progress | integer |
| total | integer |
| succeeded | integer | null |
| failed | integer | null |
| ad_ids | array · [integer] |
| errors | array · [object] · 0 … 50 |
| paused_reason | string | null |
| error | string | null |
| created_at | string · date-time |
| started_at | string | null · date-time |
| completed_at | string | null · date-time |
Source · Data source
Reference revision