# Tasks (async operations)

[Orbito Ads · English · HTML](https://orbitoads.pro/docs/api/tasks/)

Sources checked · 2026-11-27

### Browse documentation



[All documentation](/docs/) 
Get started

- [API quickstart](/docs/api/)
- [Keys and cabinet permissions](/docs/api/authentication/)
- [Using the API reference with an assistant](/docs/api/ai-assistants/)

Concepts

- [Reading API errors](/docs/api/errors/)
- [Request and event limits](/docs/api/rate-limits/)
- [Retrying a single operation](/docs/api/idempotency/)
- [Tracking a queued operation](/docs/api/tasks/)
- [Stepping through campaign pages](/docs/api/pagination/)

API reference

- [Accessible advertising accounts](/docs/api/accounts/)
- [Looking up a campaign](/docs/api/campaigns/)
- [Creating campaigns and media](/docs/api/create-campaigns/)
- [Changing existing campaigns](/docs/api/manage-campaigns/)
- [Campaign and account statistics](/docs/api/stats/)
- [Targeting dictionaries and groups](/docs/api/targeting/)

Integrations

- [Receiving campaign events](/docs/api/webhooks/)
- [Sending confirmed conversions](/docs/api/conversions/)
- [API versions and changes](/docs/api/changelog/)

Machine-readable

- [OpenAPI · YAML](/docs/api/openapi.yaml)
- [OpenAPI · JSON](/docs/api/openapi.json)
- [llms.txt](/en/docs/llms.txt)
- [llms-full.txt](/en/docs/llms-full.txt)



[All documentation](/docs/) 
Get started

- [API quickstart](/docs/api/)
- [Keys and cabinet permissions](/docs/api/authentication/)
- [Using the API reference with an assistant](/docs/api/ai-assistants/)

Concepts

- [Reading API errors](/docs/api/errors/)
- [Request and event limits](/docs/api/rate-limits/)
- [Retrying a single operation](/docs/api/idempotency/)
- [Tracking a queued operation](/docs/api/tasks/)
- [Stepping through campaign pages](/docs/api/pagination/)

API reference

- [Accessible advertising accounts](/docs/api/accounts/)
- [Looking up a campaign](/docs/api/campaigns/)
- [Creating campaigns and media](/docs/api/create-campaigns/)
- [Changing existing campaigns](/docs/api/manage-campaigns/)
- [Campaign and account statistics](/docs/api/stats/)
- [Targeting dictionaries and groups](/docs/api/targeting/)

Integrations

- [Receiving campaign events](/docs/api/webhooks/)
- [Sending confirmed conversions](/docs/api/conversions/)
- [API versions and changes](/docs/api/changelog/)

Machine-readable

- [OpenAPI · YAML](/docs/api/openapi.yaml)
- [OpenAPI · JSON](/docs/api/openapi.json)
- [llms.txt](/en/docs/llms.txt)
- [llms-full.txt](/en/docs/llms-full.txt)



[Orbito Ads](/en/) [Documentation](/docs/) [API](/docs/api/)



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.


[Markdown](/docs/api/tasks.md)



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` — create
- `POST /v1/campaigns/{ad_id}/copy` — copy
- `POST /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

Example

```
HTTP/1.1 202 Accepted
Location: /api/v1/tasks/81234
Retry-After: 2
```

Example

```
{
  "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}

Example

```
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_ids` when 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](/docs/api/webhooks/) tells you when that changes.



## A polling loop

Example

```
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));
  }
}
```

Example

```
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

```
curl -X GET https://orbitoads.pro/api/v1/tasks/96203 \
  -H 'X-API-Key: YOUR_ORBITO_KEY'
```

HTTP 200

```
{
  "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](https://adsly.pro/docs/api/openapi.yaml)

## 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](https://adsly.pro/docs/api/tasks/)

## 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](https://adsly.pro/docs/api/openapi.yaml)



## Related reading

[Reading API errors](/docs/api/errors/)[Request and event limits](/docs/api/rate-limits/)[Retrying a single operation](/docs/api/idempotency/)[Stepping through campaign pages](/docs/api/pagination/)



Reference revision 2026-10-08



[Previous topic**Retrying a single operation**](/docs/api/idempotency/)[Next topic**Stepping through campaign pages**](/docs/api/pagination/)

## Sources and data

- [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml)
- [openapi.json](https://orbitoads.pro/docs/api/openapi.json)
