1. Auth
Cosmic Agency Ad Accounts API
  • Auth
    • 获取 tenant_access_token
      POST
    • Bearer probe
      GET
  • AdAccounts
    • List ad accounts (token-bound client only)
      GET
  • TopUpsList
    • List top-ups for token-bound client
      GET
    • Get one top-up (404 if other tenant)
      GET
  • FundTransfersList
    • List clear/deduct tickets for token-bound client
      GET
    • Get one fund transfer (404 if other tenant)
      GET
  • Insights
    • Daily spend for Meta ad accounts
      GET
    • Daily spend by country for Meta ad accounts
      GET
  • TopupAndBalance
    • Submit topup (aligns with New Top-up modal)
      POST
    • Balance clear → wallet (pending approval)
      POST
    • Partial deduct → wallet (pending approval)
      POST
  1. Auth

获取 tenant_access_token

POST
/api/v1/auth/tenant_access_token/internal
Open-platform client_id + client_secret → tenant_access_token. Max TTL 2h. Remaining ≥ 30m returns the same token. Cache it.

请求参数

Body 参数
application/json
必填

示例
{
    "client_id": "string",
    "client_secret": "string"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://www.cosmicads.app/api/v1/auth/tenant_access_token/internal' \
--header 'Content-Type: application/json' \
--data '{
    "client_id": "string",
    "client_secret": "string"
}'

返回响应

🟢200
application/json
Token issued or reused
Bodyapplication/json

示例
{
    "code": 0,
    "msg": "ok",
    "data": {
        "expires_in": 7200,
        "scope": "ad_accounts:read ad_accounts:topup ad_accounts:clear ad_accounts:deduct topups:read fund_transfers:read",
        "tenant_access_token": "string",
        "token_type": "Bearer"
    },
    "request_id": "string"
}
🟠401
🟠429
修改于 2026-10-27 03:18:05
下一页
Bearer probe
Built with