Orbitoads
浏览文档

修改现有广告活动

可管理文案、链接、出价、每日限额、排期、预算和投放状态。单个批量请求支持最多 1,000 项活动,请查询任务中的局部失败记录。

Markdown

所有电话都需要管理活动和经理(或所有者)进入内阁的钥匙。 他们在一个广告活动中行动,(account_id, ad_id):当钥匙到达多个内阁时,通过account_id。 每一次广告活动的历史变化都出现在标有🔌 API的面板上。

呼叫它会做什么答案
PATCH /v1/campaigns/{ad_id}更改文本、链接、出价、上限、时间表、打开/关闭即时
POST /v1/campaigns/{ad_id}/pause切换即时
POST /v1/campaigns/{ad_id}/resume转换即时
POST /v1/campaigns/{ad_id}/budget增加或撤回预算即时
DELETE /v1/campaigns/{ad_id}删除即时
POST /v1/campaigns/{ad_id}/copy1 - 100 份202 + 任务
POST /v1/campaigns/bulk一项行动,最多1 000项运动第202章 任务

直接回答返回更新的广告活动项目 在data。

编辑

PATCH /v1/campaigns/{ad_id} — 只发送什么变化 。

示例
curl -s -X PATCH https://orbitoads.pro/api/v1/campaigns/90412 \
  -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \
  -d '{ "account_id": 53, "cpm": 1.8, "text": "Daily market notes in 3 minutes." }'
田野意义
title, text, promote_url创意与链接.
cpm新出价,超过0分.
daily_budget每日的卡普
views_per_user1–4.
activetrue / false — 与恢复/暂停相同.
schedule日以继夜地展示广告;null取出——参见时间表.
media, picture, button, website_name和创建年一样

关于Telegram的评论 Changing cpm,active或schedule并不使用-它们同时应用,广告活动持续进行. 任何其他领域(title,text,promote_url,media,picture,button,website_name,views_per_user,daily_budget)通过Telegram的完整广告形式保存下来,Telegram再次审查广告:它显示In Review直到获得批准. 发送出价,上/下和时间表变化,而不是与这些领域一起.

目标设定(channels,countries,. ) , 无法改变现有的广告 — — Telegram不允许。 创建新的目标设定运动,或复制并调整。

答复中meta:

田野意义
status_warning但Telegram没有应用开关(例如没有预算),
status_intent_only您的上/下选择被存储并适用于Telegram可以时(在审查中,没有预算).
status_already_set广告活动已经在你要求的状态下进行.

低于Telegram的标价将400 PLATFORM_REJECTED和param: "cpm"、min_cpm和currency回报。

暂停与恢复

示例
curl -s -X POST "https://orbitoads.pro/api/v1/campaigns/90412/pause?account_id=53" -H "X-API-Key: $ORBITO_API_KEY"
curl -s -X POST "https://orbitoads.pro/api/v1/campaigns/90412/resume?account_id=53" -H "X-API-Key: $ORBITO_API_KEY"

meta.intent_only: true意味着Telegram还不能对此采取行动 — — 广告活动正在审查中、被否决或预算外 — — 而你的选择被存储起来:它会尽快运行。 当状态真的改变时,你的网站状态起火灾就会发生。

广告投放时段

只有在选定的工作日和时间(比如工作日9:00-18:00)或晚上才进行广告活动。 Telegram小时以外的时间并不展示广告。 设定、更改或删除时间表不会改变或关闭广告活动 — — status和active保持原样。 它在每个内阁类型上都有效。

示例
curl -s -X PATCH https://orbitoads.pro/api/v1/campaigns/90412 \
  -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \
  -d '{ "account_id": 53, "schedule": {
        "days": { "mon": [9,10,11,12,13,14,15,16,17], "tue": [9,10,11,12,13,14,15,16,17],
                  "wed": [9,10,11,12,13,14,15,16,17], "thu": [9,10,11,12,13,14,15,16,17],
                  "fri": [9,10,11,12,13,14,15,16,17] },
        "timezone": "+03:00" } }'
田野意义
daysmon, tue, wed, thu, fri, sat, sun 每人都有时间(0~23)的广告在那一天运行。 9 意味着 09:00–09:59是的, [9, …, 17] 是 9:00–18:00. 有一天你离开,或者发送 []没有跑。 总共至少一个小时。
timezone"viewer"——每个观众自己的当地时间;只针对观众(target_type: "users"),否则,UTC冲抵:"+03:00"、"-05:00"、"+05:30"。Telegram冲抵:从-12:00至+14:00的全程时间,加上-09:30、-03:30、-02:30、+03:30、+04:30、+05:30、+05:45、+06:30、+08:45、+09:30、+10:30、+12:45、+13:45、"UTC+3"和"+3"。

"schedule": null移除了时间表——广告再次昼夜跑出.

没有预算的广告活动不能有时间表。 Telegram只接受一个可以展开的广告活动的时间表,所以在Stopped的广告活动上,你得到400 PLATFORM_REJECTED和param: "schedule"一无所有,而且没有任何改变——先增加预算,然后设定日程,暂停的(On Hold)广告活动可以顺利进行.

运动对象以相同的形状返回时间表,总是所有7天,并写为"+03:00"的抵消——这样你就可以读取,更改一天并发回. GET /v1/campaigns/{ad_id}给出了目前的时间表,即使它是在Telegram年直接被更改的——见新鲜. 0–23外的小时,未知的一天,空的日程,在频道/bot/搜索广告上的"viewer"或抵消Telegram并不能提供~400 VALIDATION_ERROR,准确的球场在param(例如schedule.days.mon).

复印件和重现的广告活动保持了他们来自的广告活动时间表。 为了同时为许多广告活动设定一个时间表,请使用set_schedule号大片行动。

广告活动预算

POST /v1/campaigns/{ad_id}/budget在内阁和广告活动之间移动金钱,需要Idempotency-Key美元。

示例
curl -s -X POST https://orbitoads.pro/api/v1/campaigns/90412/budget \
  -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "account_id": 53, "action": "add", "amount": 10 }'
actionamount效应
add需要的内阁平衡-广告活动.
withdraw需要的运动 —— 内阁平衡,比运动多 —— 400 INSUFFICIENT_AD_BALANCE。
withdraw_all—广告活动中留下的一切 内阁的平衡

meta.moved是实际移动的;meta.partial是true,因为比要求的要少才能取出。 钱从不通过API离开内阁。

复制广告活动

POST /v1/campaigns/{ad_id}/copy 创建具有相同目标的复制件; 任何您发送的复制件都会超过原件。 需要Idempotency-Key 。 返回复制件为ad_ids 的任务 。

示例
{ "account_id": 53, "copies": 3, "text": "Variant B — shorter", "cpm": 2, "budget": 5 }
田野意义
copies1–100,默认值 1.
title, text, promote_url, cpm, budget, media, picture, views_per_userbudget:0 或至少内阁的min_budget。
schedule副本保存原件的时间表;发送一份来取而代之,或null份无。
group_id / new_group_name把拷贝放入一组.

删除

示例
curl -s -X DELETE "https://orbitoads.pro/api/v1/campaigns/90412?account_id=53" -H "X-API-Key: $ORBITO_API_KEY"
示例
{ "success": true, "data": { "ad_id": 90412, "account_id": 53, "deleted": true } }

已删除的、 有 status: "Deleted" 个数据保留了视图的广告活动被删除。 删除后返回 404 CAMPAIGN_NOT_FOUND 。

批量操作

POST /v1/campaigns/bulk对一个内阁的多达1 000次广告活动采取了一项行动。需要Idempotency-Key次广告活动。

示例
curl -s -X POST https://orbitoads.pro/api/v1/campaigns/bulk \
  -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "account_id": 53, "action": "set_cpm", "cpm": 1.2, "ad_ids": [90412, 90413, 90414] }'
action额外的田野效应
pause—切换
resume—转换
add_budgetamount在每个运动中增加
withdraw_budgetamount退出每个运动
withdraw_all_budget—从每次广告活动中撤走一切
set_cpmcpm给每个都设置相同的出价
set_scheduleschedule每个都设置相同的时间表; "schedule": null 移除它
delete—删除每一个

每ad_id次必须是该内阁的现场宣传;否则就不会排队,在missing年你和罪犯一起得到400 UNKNOWN_AD_IDS次。 重复被忽略了。 任务errors列出了Telegram次活动被拒绝 — — set_schedule次活动,也没有预算,"timezone": "viewer"因为没有针对观众而不能申请。

如何暂停单次行动成本过高的广告活动

示例
import os, uuid, requests

API = "https://orbitoads.pro/api/v1"
H = {"X-API-Key": os.environ["ORBITO_API_KEY"]}
ACCOUNT, MAX_CPA = 53, 4.0

stats = requests.get(f"{API}/stats", params={"period": "1d"}, headers=H, timeout=60).json()["data"]
# cost per action = spend / actions, computed here so the rule means exactly that
expensive = [int(ad_id) for ad_id, s in stats.get(str(ACCOUNT), {}).items()
             if s["actions"] > 0 and s["spent"] / s["actions"] > MAX_CPA]

if expensive:
    r = requests.post(f"{API}/campaigns/bulk",
                      headers={**H, "Idempotency-Key": str(uuid.uuid4())},
                      json={"account_id": ACCOUNT, "action": "pause", "ad_ids": expensive},
                      timeout=60)
    print(r.status_code, r.json()["data"]["id"])

API 参考

完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。

PATCH /api/v1/campaigns/{ad_id}

仅更新请求中给出的广告设置。

参数位置格式必填
ad_idpathinteger是
account_idqueryinteger—
X-API-Keyheaderstring是
Idempotency-Keyheaderstring—
cURL
curl -X PATCH 'https://orbitoads.pro/api/v1/campaigns/38017?account_id=7401' \
  -H 'X-API-Key: YOUR_ORBITO_KEY' \
  -H 'Content-Type: application/json' \
  --data '{
  "cpm": 1.4
}'
HTTP 200
{
  "success": true,
  "data": {
    "account_id": 7401,
    "ad_id": 38017,
    "title": "Conversation club · November",
    "text": "See this month’s language club schedule.",
    "status": "Active",
    "active": true,
    "promote_url": "https://school.example/club",
    "tme_path": null,
    "target_type": "users",
    "targets": [],
    "cpm": "1.40",
    "budget": "36.00",
    "spent": "4.00",
    "daily_budget": "8.00",
    "views": 3200,
    "opens": 0,
    "clicks": 32,
    "actions": 4,
    "ctr": "1.00",
    "cvr": "12.50",
    "cpc": "0.125",
    "cpa": "1.00",
    "views_per_user": 2,
    "schedule": null,
    "has_media": false,
    "media_type": null,
    "button": "learn_more",
    "website_name": "Example language school",
    "group_id": 516,
    "auto_cpm_enabled": false,
    "date": "1793620800",
    "synced_at": "2026-11-03T12:00:00Z",
    "status_changed_at": "2026-11-03T12:00:00Z"
  }
}
请求体结构
JSON Schema
{
  "minProperties": 1,
  "properties": {
    "account_id": {
      "type": "integer"
    },
    "active": {
      "type": "boolean"
    },
    "button": {
      "enum": [
        "subscribe",
        "view",
        "read",
        "learn_more",
        "download",
        "open",
        "sign_up",
        "buy",
        "order",
        "play",
        "try",
        "leave_request"
      ],
      "type": "string"
    },
    "cpm": {
      "exclusiveMinimum": 0,
      "type": "number"
    },
    "daily_budget": {
      "minimum": 0,
      "type": "number"
    },
    "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"
      ]
    },
    "text": {
      "maxLength": 4096,
      "type": "string"
    },
    "title": {
      "maxLength": 255,
      "type": "string"
    },
    "views_per_user": {
      "maximum": 4,
      "minimum": 1,
      "type": "integer"
    },
    "website_name": {
      "maxLength": 255,
      "type": "string"
    }
  },
  "type": "object"
}
请求结果与响应字段
API含义
status_warning字段已保存,但投放开关未能生效,例如预算不足。
status_intent_only目标状态已记录,待审核或预算条件允许后可生效。
status_already_set广告活动已处于所请求的状态。

POST /api/v1/campaigns/{ad_id}/pause

请求暂停广告投放。

参数位置格式必填
ad_idpathinteger是
account_idqueryinteger—
X-API-Keyheaderstring是
Idempotency-Keyheaderstring—
cURL
curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/pause?account_id=7401' \
  -H 'X-API-Key: YOUR_ORBITO_KEY'
HTTP 200
{
  "success": true,
  "data": {
    "account_id": 7401,
    "ad_id": 38017,
    "title": "Conversation club · November",
    "text": "See this month’s language club schedule.",
    "status": "On Hold",
    "active": false,
    "promote_url": "https://school.example/club",
    "tme_path": null,
    "target_type": "users",
    "targets": [],
    "cpm": "1.25",
    "budget": "36.00",
    "spent": "4.00",
    "daily_budget": "8.00",
    "views": 3200,
    "opens": 0,
    "clicks": 32,
    "actions": 4,
    "ctr": "1.00",
    "cvr": "12.50",
    "cpc": "0.125",
    "cpa": "1.00",
    "views_per_user": 2,
    "schedule": null,
    "has_media": false,
    "media_type": null,
    "button": "learn_more",
    "website_name": "Example language school",
    "group_id": 516,
    "auto_cpm_enabled": false,
    "date": "1793620800",
    "synced_at": "2026-11-03T12:00:00Z",
    "status_changed_at": "2026-11-03T12:00:00Z"
  },
  "meta": {
    "intent_only": false
  }
}

POST /api/v1/campaigns/{ad_id}/resume

请求在满足投放条件时恢复广告。

参数位置格式必填
ad_idpathinteger是
account_idqueryinteger—
X-API-Keyheaderstring是
Idempotency-Keyheaderstring—
cURL
curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/resume?account_id=7401' \
  -H 'X-API-Key: YOUR_ORBITO_KEY'
HTTP 200
{
  "success": true,
  "data": {
    "account_id": 7401,
    "ad_id": 38017,
    "title": "Conversation club · November",
    "text": "See this month’s language club schedule.",
    "status": "Active",
    "active": true,
    "promote_url": "https://school.example/club",
    "tme_path": null,
    "target_type": "users",
    "targets": [],
    "cpm": "1.25",
    "budget": "36.00",
    "spent": "4.00",
    "daily_budget": "8.00",
    "views": 3200,
    "opens": 0,
    "clicks": 32,
    "actions": 4,
    "ctr": "1.00",
    "cvr": "12.50",
    "cpc": "0.125",
    "cpa": "1.00",
    "views_per_user": 2,
    "schedule": null,
    "has_media": false,
    "media_type": null,
    "button": "learn_more",
    "website_name": "Example language school",
    "group_id": 516,
    "auto_cpm_enabled": false,
    "date": "1793620800",
    "synced_at": "2026-11-03T12:00:00Z",
    "status_changed_at": "2026-11-03T12:00:00Z"
  },
  "meta": {
    "intent_only": false
  }
}

POST /api/v1/campaigns/{ad_id}/budget

在账户余额和单条广告之间划拨预算。

参数位置格式必填
ad_idpathinteger是
account_idqueryinteger—
Idempotency-Keyheaderstring是
X-API-Keyheaderstring是
cURL
curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/budget?account_id=7401' \
  -H 'X-API-Key: YOUR_ORBITO_KEY' \
  -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474810' \
  -H 'Content-Type: application/json' \
  --data '{
  "action": "add",
  "amount": 5
}'
HTTP 200
{
  "success": true,
  "data": {
    "account_id": 7401,
    "ad_id": 38017,
    "title": "Conversation club · November",
    "text": "See this month’s language club schedule.",
    "status": "Active",
    "active": true,
    "promote_url": "https://school.example/club",
    "tme_path": null,
    "target_type": "users",
    "targets": [],
    "cpm": "1.25",
    "budget": "41.00",
    "spent": "4.00",
    "daily_budget": "8.00",
    "views": 3200,
    "opens": 0,
    "clicks": 32,
    "actions": 4,
    "ctr": "1.00",
    "cvr": "12.50",
    "cpc": "0.125",
    "cpa": "1.00",
    "views_per_user": 2,
    "schedule": null,
    "has_media": false,
    "media_type": null,
    "button": "learn_more",
    "website_name": "Example language school",
    "group_id": 516,
    "auto_cpm_enabled": false,
    "date": "1793620800",
    "synced_at": "2026-11-03T12:00:00Z",
    "status_changed_at": "2026-11-03T12:00:00Z"
  },
  "meta": {
    "action": "add",
    "moved": 5,
    "partial": false
  }
}
请求体结构
JSON Schema
{
  "properties": {
    "account_id": {
      "type": "integer"
    },
    "action": {
      "enum": [
        "add",
        "withdraw",
        "withdraw_all"
      ],
      "type": "string"
    },
    "amount": {
      "exclusiveMinimum": 0,
      "type": "number"
    }
  },
  "required": [
    "action"
  ],
  "type": "object"
}

POST /api/v1/campaigns/{ad_id}/copy

排队创建最多 100 份副本,继承定向,可覆盖部分设置。

参数位置格式必填
ad_idpathinteger是
account_idqueryinteger—
Idempotency-Keyheaderstring是
X-API-Keyheaderstring是
cURL
curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/copy?account_id=7401' \
  -H 'X-API-Key: YOUR_ORBITO_KEY' \
  -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474811' \
  -H 'Content-Type: application/json' \
  --data '{
  "copies": 2,
  "budget": 0,
  "title": "Club · second draft",
  "group_id": 516
}'
HTTP 202
{
  "success": true,
  "data": {
    "id": 96203,
    "type": "copy",
    "status": "pending",
    "account_id": 7401,
    "total": 2,
    "ad_ids": []
  }
}
请求体结构
JSON Schema
{
  "properties": {
    "account_id": {
      "type": "integer"
    },
    "budget": {
      "minimum": 0,
      "type": "number"
    },
    "copies": {
      "default": 1,
      "maximum": 100,
      "minimum": 1,
      "type": "integer"
    },
    "cpm": {
      "exclusiveMinimum": 0,
      "type": "number"
    },
    "group_id": {
      "type": "integer"
    },
    "media": {
      "type": "string"
    },
    "new_group_name": {
      "type": "string"
    },
    "picture": {
      "type": "boolean"
    },
    "promote_url": {
      "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"
      ]
    },
    "text": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "views_per_user": {
      "maximum": 4,
      "minimum": 1,
      "type": "integer"
    }
  },
  "type": "object"
}

POST /api/v1/campaigns/bulk

对同一账户最多 1,000 条广告排队执行同一操作。

参数位置格式必填
Idempotency-Keyheaderstring是
X-API-Keyheaderstring是
cURL
curl -X POST https://orbitoads.pro/api/v1/campaigns/bulk \
  -H 'X-API-Key: YOUR_ORBITO_KEY' \
  -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474812' \
  -H 'Content-Type: application/json' \
  --data '{
  "account_id": 7401,
  "action": "set_cpm",
  "cpm": 1.4,
  "ad_ids": [
    38017,
    38018
  ]
}'
HTTP 202
{
  "success": true,
  "data": {
    "id": 96203,
    "type": "cpm",
    "status": "pending",
    "account_id": 7401,
    "total": 2,
    "ad_ids": []
  }
}
请求体结构
JSON Schema
{
  "properties": {
    "account_id": {
      "type": "integer"
    },
    "action": {
      "enum": [
        "pause",
        "resume",
        "add_budget",
        "withdraw_budget",
        "withdraw_all_budget",
        "set_cpm",
        "set_schedule",
        "delete"
      ],
      "type": "string"
    },
    "ad_ids": {
      "items": {
        "type": "integer"
      },
      "maxItems": 1000,
      "minItems": 1,
      "type": "array"
    },
    "amount": {
      "exclusiveMinimum": 0,
      "type": "number"
    },
    "cpm": {
      "exclusiveMinimum": 0,
      "type": "number"
    },
    "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"
      ]
    }
  },
  "required": [
    "action",
    "ad_ids"
  ],
  "type": "object"
}

DELETE /api/v1/campaigns/{ad_id}

移除广告,保留已有的历史投放统计。

参数位置格式必填
ad_idpathinteger是
account_idqueryinteger—
X-API-Keyheaderstring是
Idempotency-Keyheaderstring—
cURL
curl -X DELETE 'https://orbitoads.pro/api/v1/campaigns/38017?account_id=7401' \
  -H 'X-API-Key: YOUR_ORBITO_KEY'
HTTP 200
{
  "success": true,
  "data": {
    "ad_id": 38017,
    "account_id": 7401,
    "deleted": true
  }
}

实施说明

可编辑字段与时段

修改 cpm、active、schedule 无需重新审核素材,修改素材字段可能触发审核。原有定向保持固定。按星期和 0–23 小时并指定 UTC 偏移,users 定向支持 viewer,设为 null 移除时段。

账户内部预算划拨

add 将额度转入广告。withdraw 转回指定金额,withdraw_all 将剩余预算转回账户。查看 meta.moved 和 meta.partial。外部充值、开票及退款使用账务流程。

受理与完成

创建、复制和批量操作返回 HTTP 202 及任务 ID。按 Retry-After 轮询 GET /api/v1/tasks/{id}。即使状态为 completed,也要检查 failed 和 errors。

操作与字段

PATCH /api/v1/campaigns/{ad_id} POST /api/v1/campaigns/{ad_id}/pause POST /api/v1/campaigns/{ad_id}/resume POST /api/v1/campaigns/{ad_id}/budget POST /api/v1/campaigns/{ad_id}/copy POST /api/v1/campaigns/bulk

  • PATCH /api/v1/campaigns/{ad_id}
  • POST /api/v1/campaigns/{ad_id}/pause
  • POST /api/v1/campaigns/{ad_id}/resume
  • POST /api/v1/campaigns/{ad_id}/budget
  • POST /api/v1/campaigns/{ad_id}/copy
  • POST /api/v1/campaigns/bulk

请求示例

GET /api/v1/campaigns/{ad_id}?account_id={account_id} HTTP/1.1 Host: orbitoads.pro X-API-Key: {key}

结构字段与限制

本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。

协议参考

方法路径参数请求内容响应码
PATCH/api/v1/campaigns/{ad_id}ad_id, account_idapplication/json · UpdateRequest200, 400, 401, 403, 404, 409, 429
POST/api/v1/campaigns/{ad_id}/pausead_id, account_id—200, 400, 401, 403, 404, 409, 429
POST/api/v1/campaigns/{ad_id}/resumead_id, account_id—200, 400, 401, 403, 404, 409, 429
POST/api/v1/campaigns/{ad_id}/budgetad_id, account_id, Idempotency-Keyapplication/json · BudgetRequest200, 400, 401, 403, 404, 409, 422, 429
POST/api/v1/campaigns/{ad_id}/copyad_id, account_id, Idempotency-Keyapplication/json · CopyRequest202, 400, 401, 403, 404, 409, 422, 429
POST/api/v1/campaigns/bulkIdempotency-Keyapplication/json · BulkRequest202, 400, 401, 403, 404, 409, 422, 429
DELETE/api/v1/campaigns/{ad_id}ad_id, account_id—200, 400, 401, 403, 404, 409, 429

来源 · 数据来源

结构字段与限制 · 修改现有广告活动

字段文档取值
BulkRequest.ad_ids[]1 … 1,000
CopyRequest.copies1 … 100
BudgetRequest.actionadd | withdraw | withdraw_all
BulkRequest.actionpause | resume | add_budget | withdraw_budget | withdraw_all_budget | set_cpm | set_schedule | delete
Scheduledays, timezone

来源 · 数据来源

UpdateRequest

字段字段类型
titlestring
textstring
promote_urlstring
cpmnumber
daily_budgetnumber · 0 … ∞
views_per_userinteger · 1 … 4
mediastring
pictureboolean
buttonsubscribe | view | read | learn_more | download | open | sign_up | buy | order | play | try | leave_request
website_namestring
scheduleSchedule
account_idinteger
activeboolean

来源 · 数据来源

BudgetRequest

字段字段类型
account_idinteger
actionadd | withdraw | withdraw_all
amountnumber

来源 · 数据来源

CopyRequest

字段字段类型
account_idinteger
copiesinteger · 1 … 100 · = 1
titlestring
textstring
promote_urlstring
cpmnumber
budgetnumber · 0 … ∞
mediastring
pictureboolean
views_per_userinteger · 1 … 4
scheduleSchedule
group_idinteger
new_group_namestring

来源 · 数据来源

BulkRequest

字段字段类型
account_idinteger
actionpause | resume | add_budget | withdraw_budget | withdraw_all_budget | set_cpm | set_schedule | delete
ad_idsarray · [integer] · 1 … 1000
amountnumber
cpmnumber
scheduleSchedule

来源 · 数据来源

Schedule

字段字段类型
daysobject
timezonestring

来源 · 数据来源

参考资料更新日期

Pro Panel
Pro Panel