Create campaigns
A create request accepts up to 100 campaigns in one account. Choose channel, bot, search or audience targeting, supply a unique operation key and follow the returned task. Upload media first if a creative needs it.
POST /v1/campaigns creates campaigns in one cabinet. It needs a key with Manage campaigns, an Idempotency-Key, and returns 202 with a task — the campaigns appear when the task completes.
A first example
curl -s -X POST https://orbitoads.pro/api/v1/campaigns \
-H "X-API-Key: $ORBITO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"account_id": 53,
"title": "Crypto channels — notes",
"text": "Daily market notes in 3 minutes. No noise.",
"promote_url": "https://t.me/yourchannel",
"cpm": 1.5,
"budget": 20,
"target_type": "channels",
"channels": ["@durov", "t.me/telegram"]
}'{ "success": true, "data": { "id": 81234, "type": "create", "status": "pending", "account_id": 53, "total": 1, "ad_ids": [] } }Many at once
Put the campaigns in campaigns (up to 100). account_id and the group fields stay at the top level and apply to all of them.
{
"account_id": 53,
"new_group_name": "October test",
"campaigns": [
{ "title": "A", "text": "Variant A", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 10,
"target_type": "channels", "channels": ["@durov"] },
{ "title": "B", "text": "Variant B", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 10,
"target_type": "channels", "channels": ["@telegram"] }
]
}Campaigns are created one after another. If the first one fails, the task stops — fix the input rather than repeat the same error 100 times. Each failure is listed in the task’s errors with its index in your array.
Fields
| Field | Required | Meaning |
|---|---|---|
title | yes | Internal name, shown in the panel. |
text | yes | Ad text people see. Telegram’s own length and content rules apply — a refusal comes back in the task’s errors. |
promote_url | yes | What the ad opens: https://t.me/channel, t.me/bot?start=ref, @channel or a website URL. |
cpm | yes | Bid per 1,000 views in the cabinet’s currency, greater than 0. Too low for the targeting → Telegram’s minimum comes back in the error. |
budget | yes | Money moved from the cabinet balance to the campaign: 0, or at least the cabinet’s min_budget (Cabinets). With 0 the ad is created but can’t run until you add budget. |
target_type | yes | channels, bots, search or users — see below. |
active | no | false creates it switched off. Default true. |
daily_budget | no | Daily spending cap. |
views_per_user | no | How many times one person can see the ad, 1–4. |
media | no | Image or video token from POST /v1/media. |
picture | no | true shows the promoted channel’s avatar in the ad. |
button | no | Button under the ad: subscribe, view, read, learn_more, download, open, sign_up, buy, order, play, try, leave_request. Only where the cabinet’s features.ad_button is true. |
website_name | no | Brand name shown above a website ad. |
schedule | no | Show the ad only on chosen weekdays and hours, e.g. weekdays 9:00–18:00. Format: Schedule. Without it the ad runs around the clock. |
Top level only: account_id (needed when the key reaches several cabinets), group_id (an existing group) or new_group_name (creates the group, or reuses one with that name).
Unknown fields are refused with 400 VALIDATION_ERROR and the field name in param — a typo never silently drops a setting.
Targeting
channels — show the ad in specific channels
{ "target_type": "channels", "channels": ["@durov", "t.me/telegram"],
"languages": ["en"], "topics": [7, 26], "exclude_topics": [2], "add_similar_channels": true }| Field | Meaning |
|---|---|
channels | 1–100 public channels: @name, name or t.me/name. Required. |
languages, topics, exclude_topics | Narrow by channel language and topic (codes). |
add_similar_channels | Also add channels similar to these. |
bots — show the ad in bots
{ "target_type": "bots", "bots": ["@somebot"] }bots: 1–100 public bots. Required.
search — show the ad for Telegram search queries
{ "target_type": "search", "search_keywords": ["crypto wallet", "bitcoin"] }search_keywords: 1–100 phrases, up to 64 characters each. Required.
users — show the ad to an audience
{ "target_type": "users", "countries": ["DE", "AT"], "languages": ["de"],
"topics": [26], "exclude_topics": [2], "audience_channels": ["@somechannel"] }| Field | Meaning |
|---|---|
countries | ISO country codes. |
languages | Language codes. |
topics, exclude_topics | Interests by topic id. |
audience_channels | People who read these channels. |
At least one of these is required. Codes: Targeting codes.
Channels, bots and keywords are resolved to Telegram’s own ids when the task runs. Ones Telegram can’t find are skipped; if none are found, that campaign fails — No targets found: … for channels and bots, No valid search queries found for keywords — and the task’s errors says so.
After creating
- Poll
GET /v1/tasks/{id}untilcompleted.ad_idsholds the new campaigns. - Telegram reviews each new ad: it starts
In Review, then becomesActive(orDeclined). A webhook tells you when. - Change, fund or pause them with Manage campaigns.
Upload media
POST /v1/media uploads an image or video into a cabinet and returns a media token for POST /v1/campaigns, PATCH and copy. The token belongs to that cabinet — upload into the cabinet you’ll create in.
curl -s -X POST "https://orbitoads.pro/api/v1/media?account_id=53" \
-H "X-API-Key: $ORBITO_API_KEY" \
-F "file=@banner.jpg"{ "success": true, "data": { "media": "BQACAgIAAx0…", "account_id": 53 } }- JPG, PNG, GIF, WEBP or MP4, up to 10 MB, sent as
multipart/form-datain the fieldfile. - Some cabinets accept only 16:9 images at least 640 px wide; if a file doesn’t fit, Telegram’s reason comes back in
error.
Errors
| Code | When |
|---|---|
VALIDATION_ERROR | A field is missing, unknown, of the wrong type, or doesn’t belong to this target_type — param says which. |
IDEMPOTENCY_KEY_REQUIRED | No Idempotency-Key. |
ACCOUNT_ID_REQUIRED / ACCOUNT_NOT_FOUND | Say which cabinet / that cabinet isn’t reachable. |
VIEW_ONLY_ACCESS | You have Viewer access to this cabinet. |
QUEUE_FULL | 5 creates already queued in this cabinet. |
CABINET_LOCKED, SUBSCRIPTION_REQUIRED | The cabinet can’t take manual changes right now. |
Individual campaign failures (Telegram refused a text, a bid, a link) don’t fail the request — they appear in the task’s errors.
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.
POST /api/v1/campaigns
Queue creation of one campaign or a batch of up to 100 in one account.
| Parameter | Location | Format | Required |
|---|---|---|---|
Idempotency-Key | header | string | Yes |
X-API-Key | header | string | Yes |
curl -X POST https://orbitoads.pro/api/v1/campaigns \
-H 'X-API-Key: YOUR_ORBITO_KEY' \
-H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474805' \
-H 'Content-Type: application/json' \
--data '{
"title": "November club · draft",
"text": "Explore this month’s language club schedule.",
"promote_url": "https://school.example/club",
"cpm": 1.25,
"budget": 0,
"active": false,
"target_type": "users",
"countries": [
"GB"
],
"languages": [
"en"
],
"account_id": 7401,
"group_id": 516
}'{
"success": true,
"data": {
"id": 96203,
"type": "create",
"status": "pending",
"account_id": 7401,
"total": 1,
"ad_ids": []
}
}Request body schema
{
"oneOf": [
{
"properties": {
"account_id": {
"type": "integer"
},
"active": {
"default": true,
"type": "boolean"
},
"add_similar_channels": {
"type": "boolean"
},
"audience_channels": {
"items": {
"type": "string"
},
"type": "array"
},
"bots": {
"items": {
"type": "string"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"budget": {
"minimum": 0,
"type": "number"
},
"button": {
"enum": [
"subscribe",
"view",
"read",
"learn_more",
"download",
"open",
"sign_up",
"buy",
"order",
"play",
"try",
"leave_request"
],
"type": "string"
},
"channels": {
"items": {
"type": "string"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"countries": {
"items": {
"type": "string"
},
"type": "array"
},
"cpm": {
"exclusiveMinimum": 0,
"type": "number"
},
"daily_budget": {
"minimum": 0,
"type": "number"
},
"exclude_topics": {
"items": {
"type": "integer"
},
"type": "array"
},
"group_id": {
"type": "integer"
},
"languages": {
"items": {
"type": "string"
},
"type": "array"
},
"media": {
"type": "string"
},
"new_group_name": {
"maxLength": 100,
"type": "string"
},
"picture": {
"type": "boolean"
},
"promote_url": {
"maxLength": 2048,
"type": "string"
},
"schedule": {
"additionalProperties": false,
"properties": {
"days": {
"additionalProperties": false,
"properties": {
"fri": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"mon": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"sat": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"sun": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"thu": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"tue": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"wed": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
}
},
"type": "object"
},
"timezone": {
"type": "string"
}
},
"required": [
"days",
"timezone"
],
"type": [
"object",
"null"
]
},
"search_keywords": {
"items": {
"maxLength": 64,
"type": "string"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"target_type": {
"enum": [
"channels",
"bots",
"search",
"users"
],
"type": "string"
},
"text": {
"maxLength": 4096,
"type": "string"
},
"title": {
"maxLength": 255,
"type": "string"
},
"topics": {
"items": {
"type": "integer"
},
"type": "array"
},
"views_per_user": {
"maximum": 4,
"minimum": 1,
"type": "integer"
},
"website_name": {
"maxLength": 255,
"type": "string"
}
},
"required": [
"title",
"text",
"promote_url",
"cpm",
"budget",
"target_type"
],
"type": "object"
},
{
"properties": {
"account_id": {
"type": "integer"
},
"campaigns": {
"items": {
"properties": {
"active": {
"default": true,
"type": "boolean"
},
"add_similar_channels": {
"type": "boolean"
},
"audience_channels": {
"items": {
"type": "string"
},
"type": "array"
},
"bots": {
"items": {
"type": "string"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"budget": {
"minimum": 0,
"type": "number"
},
"button": {
"enum": [
"subscribe",
"view",
"read",
"learn_more",
"download",
"open",
"sign_up",
"buy",
"order",
"play",
"try",
"leave_request"
],
"type": "string"
},
"channels": {
"items": {
"type": "string"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"countries": {
"items": {
"type": "string"
},
"type": "array"
},
"cpm": {
"exclusiveMinimum": 0,
"type": "number"
},
"daily_budget": {
"minimum": 0,
"type": "number"
},
"exclude_topics": {
"items": {
"type": "integer"
},
"type": "array"
},
"languages": {
"items": {
"type": "string"
},
"type": "array"
},
"media": {
"type": "string"
},
"picture": {
"type": "boolean"
},
"promote_url": {
"maxLength": 2048,
"type": "string"
},
"schedule": {
"additionalProperties": false,
"properties": {
"days": {
"additionalProperties": false,
"properties": {
"fri": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"mon": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"sat": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"sun": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"thu": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"tue": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
},
"wed": {
"items": {
"maximum": 23,
"minimum": 0,
"type": "integer"
},
"maxItems": 24,
"type": "array"
}
},
"type": "object"
},
"timezone": {
"type": "string"
}
},
"required": [
"days",
"timezone"
],
"type": [
"object",
"null"
]
},
"search_keywords": {
"items": {
"maxLength": 64,
"type": "string"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"target_type": {
"enum": [
"channels",
"bots",
"search",
"users"
],
"type": "string"
},
"text": {
"maxLength": 4096,
"type": "string"
},
"title": {
"maxLength": 255,
"type": "string"
},
"topics": {
"items": {
"type": "integer"
},
"type": "array"
},
"views_per_user": {
"maximum": 4,
"minimum": 1,
"type": "integer"
},
"website_name": {
"maxLength": 255,
"type": "string"
}
},
"required": [
"title",
"text",
"promote_url",
"cpm",
"budget",
"target_type"
],
"type": "object"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"group_id": {
"type": "integer"
},
"new_group_name": {
"maxLength": 100,
"type": "string"
}
},
"required": [
"campaigns"
],
"type": "object"
}
]
}| API | HTTP | Meaning |
|---|---|---|
| VALIDATION_ERROR | 400 | Inspect the request fields and correct invalid input before retrying. |
| IDEMPOTENCY_KEY_REQUIRED | 400 | Supply the required Idempotency-Key header with the write. |
| VIEW_ONLY_ACCESS | 403 | A Viewer can inspect this ad account. A change requires account-level write access. |
| QUEUE_FULL | 429 | Five create jobs already occupy this account’s queue. Wait for capacity. |
POST /api/v1/media
Upload creative media and receive a token tied to the selected account.
| Parameter | Location | Format | Required |
|---|---|---|---|
account_id | query | integer | — |
X-API-Key | header | string | Yes |
Idempotency-Key | header | string | — |
curl -X POST 'https://orbitoads.pro/api/v1/media?account_id=7401' \
-H 'X-API-Key: YOUR_ORBITO_KEY' \
-F file=@./club-cover.png{
"success": true,
"data": {
"media": "example-media-718",
"account_id": 7401
}
}Request body schema
{
"properties": {
"account_id": {
"type": "integer"
},
"file": {
"format": "binary",
"type": "string"
}
},
"required": [
"file"
],
"type": "object"
}{
"account_id": 7401,
"new_group_name": "Language club variants",
"campaigns": [
{
"title": "November club · draft",
"text": "Explore this month’s language club schedule.",
"promote_url": "https://school.example/club",
"cpm": 1.25,
"budget": 0,
"active": false,
"target_type": "users",
"countries": [
"GB"
],
"languages": [
"en"
]
},
{
"title": "Conversation club · second draft",
"text": "Explore this month’s language club schedule.",
"promote_url": "https://school.example/club?from=variant2",
"cpm": 1.25,
"budget": 0,
"active": false,
"target_type": "users",
"countries": [
"GB"
],
"languages": [
"en"
]
}
]
}Implementation notes
One campaign or a batch
A single request puts title, text, promote_url, cpm, budget and target_type at the root. A batch puts 1–100 inputs into campaigns and shares account_id and group fields at the root. Set budget to zero or at least the account’s min_budget.
Targeting and assets
Use channels, bots, search or users. Channel, bot and search lists accept 1–100 entries, each search phrase up to 64 characters. Audience targeting needs at least one valid filter. JPG, PNG, GIF, WebP and MP4 uploads are limited to 10 MB and tied to the uploading account.
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.
Operations and fields
POST /api/v1/campaigns POST /api/v1/media channels bots search users
- POST /api/v1/campaigns
- POST /api/v1/media
- channels
- bots
- search
- users
Request example
GET /api/v1/targeting 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.
Audience test settings
The campaign creation schema distinguishes four targeting modes. A channel list belongs in channels, bot names in bots and search terms in search_keywords. Country, language and topic filters describe a user audience. Read the account capabilities before building the test.
Protocol reference
| Method | Route | Parameters | Request content | Response codes |
|---|---|---|---|---|
| POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest | CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 |
| POST | /api/v1/media | account_id | multipart/form-data · file, account_id | 200, 400, 401, 403, 413 |
| GET | /api/v1/targeting | — | — | 200, 401 |
| GET | /api/v1/tasks/{id} | id | — | 200, 400, 401, 404 |
Source · Data source
Schema fields and limits · Creating campaigns and media
| Field | Documented value |
|---|---|
| target_type | channels | bots | search | users |
| campaigns[] | 1 … 100 |
| active = | true |
| views_per_user | 1 … 4 |
| budget | ≥ 0 |
| Idempotency-Key | UUID |
Source · Data source
CampaignInput
| Field | Field type |
|---|---|
| title | string |
| text | string |
| promote_url | string |
| cpm | number |
| daily_budget | number · 0 … ∞ |
| views_per_user | integer · 1 … 4 |
| media | string |
| picture | boolean |
| button | subscribe | view | read | learn_more | download | open | sign_up | buy | order | play | try | leave_request |
| website_name | string |
| schedule | Schedule |
| budget | number · 0 … ∞ |
| active | boolean · = true |
| target_type | channels | bots | search | users |
| channels | array · [string] · 1 … 100 |
| bots | array · [string] · 1 … 100 |
| search_keywords | array · [string] · 1 … 100 |
| countries | array · [string] |
| languages | array · [string] |
| topics | array · [integer] |
| exclude_topics | array · [integer] |
| audience_channels | array · [string] |
| add_similar_channels | boolean |
Source · Data source
CreateBatchRequest
| Field | Field type |
|---|---|
| account_id | integer |
| group_id | integer |
| new_group_name | string |
| campaigns | array · [CampaignInput] · 1 … 100 |
Source · Data source
CreativeFields
| Field | Field type |
|---|---|
| title | string |
| text | string |
| promote_url | string |
| cpm | number |
| daily_budget | number · 0 … ∞ |
| views_per_user | integer · 1 … 4 |
| media | string |
| picture | boolean |
| button | subscribe | view | read | learn_more | download | open | sign_up | buy | order | play | try | leave_request |
| website_name | string |
| schedule | Schedule |
Source · Data source
Reference revision