Every operation has a Markdown page for tools and language models.
Examples read AGIMONE_API_KEY (and optionally AGIMONE_API_BASE) from the environment and print the JSON response.
GET/v1/balance
Get balance
Current balance of the publisher: `available` is the amount that can be requested for payout, `pending` is estimated revenue (days AGIMone has not finalized yet; not payable until final), `requested` is the amount in open payout requests, `paid_total` is the total already paid out, and `min_payout` is the minimum payout amount. All amounts are money strings. Same numbers as the `balance` field of GET /v1/earnings. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ available: string; held: string; min_payout: string; paid_total: string; pending: string; requested: string }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
示例
cURL
#!/usr/bin/env bash
# GET /v1/balance: current balance (pending, available, requested, paid_total, min_payout).
# Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE.
set -euo pipefail
BASE="${AGIMONE_API_BASE:-https://app.agimone.com}"
curl -fsS -H "Authorization: Bearer $AGIMONE_API_KEY" "$BASE/v1/balance"
echo
Node.js
// GET /v1/balance: current balance (pending, available, requested, paid_total, min_payout). Node 18+, no dependencies.
// Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE.
const base = process.env.AGIMONE_API_BASE ?? 'https://app.agimone.com';
const res = await fetch(`${base}/v1/balance`, {
headers: { Authorization: `Bearer ${process.env.AGIMONE_API_KEY}` },
});
if (!res.ok) {
console.error(`HTTP ${res.status}: ${await res.text()}`);
process.exit(1);
}
console.log(JSON.stringify(await res.json()));
PHP
<?php
// GET /v1/balance: current balance (pending, available, requested, paid_total, min_payout). PHP 8 with the curl extension, no other dependencies.
// Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE.
$base = getenv('AGIMONE_API_BASE') ?: 'https://app.agimone.com';
$ch = curl_init("$base/v1/balance");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('AGIMONE_API_KEY')],
CURLOPT_TIMEOUT => 15,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
fwrite(STDERR, "HTTP $status: " . ($body === false ? curl_error($ch) : $body) . "\n");
exit(1);
}
curl_close($ch);
echo trim($body), "\n";
Python
# GET /v1/balance: current balance (pending, available, requested, paid_total, min_payout). Python 3.8+, standard library only.
# Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE.
import json
import os
import sys
import urllib.error
import urllib.request
base = os.environ.get("AGIMONE_API_BASE", "https://app.agimone.com")
req = urllib.request.Request(
f"{base}/v1/balance",
headers={"Authorization": f"Bearer {os.environ['AGIMONE_API_KEY']}"},
)
try:
with urllib.request.urlopen(req, timeout=15) as res:
print(json.dumps(json.load(res)))
except urllib.error.HTTPError as e:
print(f"HTTP {e.code}: {e.read().decode()}", file=sys.stderr)
sys.exit(1)
GET/v1/disputes
List disputes
Publisher disputes with first-response (48 hours) and resolution (7 days) deadlines, overdue first. Requires `publisher:read`. Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ amount_returned: string | null; first_response_at: string | null; first_response_due_at: string; id: integer; opened_at: string; overdue: boolean; resolution: "upheld" | "rejected" | "partial" | null; resolve_due_at: string; resolved_at: string | null; status: "open" | "answered" | "resolved"; subject_id: integer | null; subject_type: "hold" | "adjustment" | "ivt" | "zone_quality" | "payout" | "other" }[]
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
POST/v1/disputes
Create dispute
Create a dispute with a message of up to 5,000 Unicode characters. At most five unresolved disputes per publisher and one zone-quality dispute per zone in 24 hours. Subjects must belong to the publisher. Requires `publisher:write`; view-as is read-only. Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
无参数。
请求体
{ message: string; subject_id?: integer | null; subject_type: "hold" | "adjustment" | "ivt" | "zone_quality" | "payout" | "other" }
响应
{ amount_returned: string | null; first_response_at: string | null; first_response_due_at: string; id: integer; messages: { author_type: "publisher" | "admin"; body: string; created_at: string; id: integer }[]; opened_at: string; overdue: boolean; resolution: "upheld" | "rejected" | "partial" | null; resolve_due_at: string; resolved_at: string | null; status: "open" | "answered" | "resolved"; subject_id: integer | null; subject_type: "hold" | "adjustment" | "ivt" | "zone_quality" | "payout" | "other" }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/disputes/{id}
Get dispute
A publisher-owned dispute and its message thread. Requires `publisher:read`. Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
响应
{ amount_returned: string | null; first_response_at: string | null; first_response_due_at: string; id: integer; messages: { author_type: "publisher" | "admin"; body: string; created_at: string; id: integer }[]; opened_at: string; overdue: boolean; resolution: "upheld" | "rejected" | "partial" | null; resolve_due_at: string; resolved_at: string | null; status: "open" | "answered" | "resolved"; subject_id: integer | null; subject_type: "hold" | "adjustment" | "ivt" | "zone_quality" | "payout" | "other" }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
POST/v1/disputes/{id}/messages
Create dispute message
Send up to 5,000 Unicode characters to an unresolved publisher-owned dispute. A publisher reply reopens an answered dispute. Requires `publisher:write`; view-as is read-only. Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
请求体
{ message: string }
响应
{ amount_returned: string | null; first_response_at: string | null; first_response_due_at: string; id: integer; messages: { author_type: "publisher" | "admin"; body: string; created_at: string; id: integer }[]; opened_at: string; overdue: boolean; resolution: "upheld" | "rejected" | "partial" | null; resolve_due_at: string; resolved_at: string | null; status: "open" | "answered" | "resolved"; subject_id: integer | null; subject_type: "hold" | "adjustment" | "ivt" | "zone_quality" | "payout" | "other" }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/earnings
Get earnings
Daily earnings in a date range together with the current balance. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| from | query | string | 是 |
| to | query | string | 是 |
响应
{ adjustments: { amount: string; detected_on: string; earnings_day_id: integer; for_date: string; source: "network" | "dispute" }[]; balance: { available: string; held: string; min_payout: string; paid_total: string; pending: string; requested: string }; count_basis?: "valid" | "legacy" | "mixed"; currency: "USD"; days: { adjustment: string; count_basis?: "valid" | "legacy" | "mixed"; date: string; pops: integer; revenue: string; status?: "estimated" | "reported" | "final" | "mixed" }[]; estimated_at?: string | null; forecast_basis_version?: "forecast-basis-v1"; forecast_generation?: string; forecast_updated_at?: string | null; measurement_definition?: { complete: boolean; includes_direct: boolean; includes_legacy: boolean; tag_valid_after_ms: integer[] }; measurement_generation?: string; measurement_status?: "ok" | "stale" | "updating"; measurement_updated_at?: string | null; money_basis_version?: string; money_generation?: string; updated_at?: string | null }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/holds
List payout holds
Up to 200 publisher holds, newest first, including evidence, decision status, seven-day forfeiture boundary and automatic release time. Active holds already reduce available balance. Requires `publisher:read`. Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ amount: string; auto_release_at: string; created_at: string; date_from: string; date_to: string; decided_at: string | null; decision_note: string | null; evidence: string; evidence_data: { cap: string; ivt: object | null; network_report_ref: string | null; reported_deduction: string | null; revenue_publisher: string; revshare_pct: number; suspect_pct: number | null }; forfeit_not_before: string; id: integer; original_amount: string; reason_code: "ivt_suspected" | "network_clawback_pending" | "policy_violation"; status: "active" | "released" | "forfeited"; zone_id: integer | null; zone_name: string | null }[]
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/me
Get my profile
Profile of the signed-in user (and publisher). Requires a user actor (API key of a user or web session). GET and HEAD use rate limit tier `me`: 600 requests/minute per user, shared by web sessions and user API keys. Other reads and profile writes keep their own rate limit tiers.
- 权限范围
- 任意密钥或会话
- 速率限制级别
- me
参数
无参数。
响应
{ email: string; id: integer; locale: "en" | "vi" | "es" | "pt" | "fr" | "id" | "ru" | "zh" | "ar"; mfa_enabled: boolean; publisher: { display_name: string; id: integer; min_payout: string; payout_details_masked: string | null; payout_method: "paypal" | "usdt" | "bank" | null; payout_method_pending: { effective_at: string; masked: string; method: "paypal" | "usdt" | "bank"; requested_at: string } | null; permissions: { auto_approve_sites: boolean; direct_link: boolean; manage: boolean }; revshare_pct: number; status: "active" | "pending" | "suspended" } | null; role: "admin" | "publisher" | "advertiser"; security_notice: { at: string; kind: "mfa_enabled" | "mfa_disabled" | "mfa_reset_by_admin" | "recovery_regenerated" | "recovery_used" | "password_changed" | "login_new_device" | "session_revoked" | "payout_method_requested" | "payout_method_applied" | "payout_method_cancelled" | "telegram_linked" | "telegram_unlinked" | "telegram_payout_enabled" | "telegram_payout_disabled" } | null; timezone: string; view_as: { display_name: string; publisher_id: integer } | null }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/me/api-keys
List API keys
List active API keys of the publisher (the secret is never returned again). Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ created_at: string; id: integer; last_used_at: string | null; name: string; scopes: ("publisher:read" | "publisher:write" | "admin:read" | "admin:write" | "infra:read" | "infra:write" | "adv:read" | "adv:write" | "scan:work" | "dsp0:review")[] }[]
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
DELETE/v1/me/api-keys/{id}
Revoke an API key
Revoke an API key, for example one that leaked. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
响应
any
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/notifications/prefs
Get notification preferences
Which notification events are enabled on each channel. Changing them is web-only (signed-in person). Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ items: { channel: "email" | "telegram" | "webhook" | "webpush"; enabled: boolean; event_type: "payout.upcoming" | "payout.status_changed" | "hold.created" | "hold.decided" | "dispute.replied" | "kyc.status_changed" | "zone.quality_changed" | "ivt.threshold_exceeded" | "zone.traffic_stopped" | "zone.traffic_resumed" | "day.finalized" | "report.daily" | "site.status_changed" | "referral.credited" | "support.replied" | "webhook.endpoint_disabled" | "account.security" | "ping"; locked: boolean }[]; report_hour?: integer }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/openapi/publisher.json
Get the OpenAPI document
The OpenAPI 3 document of this API (publisher operations only). No authentication. Rate limit tier: `public` (60 requests/minute per IP). Cached for 5 minutes.
- 速率限制级别
- public
参数
无参数。
响应
{ }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/payouts
List payouts
List the publisher's payout requests and their status. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ amount: string; decided_at: string | null; id: integer; method: "paypal" | "usdt" | "bank"; notes: string | null; paid_at: string | null; requested_at: string; status: "requested" | "approved" | "paid" | "rejected"; tx_ref: string | null }[]
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/public/payout-terms
Get public payout terms
Current manual payout schedule, enforced publisher defaults and IVT policy. Public; cached for 300 seconds. Rate limit tier: `public`.
- 速率限制级别
- public
参数
无参数。
响应
{ generated_at: string; ivt_policy: { effective_from: string; status: "draft" | "approved"; version: string }; methods: "usdt"[]; minimum_payout: string; revshare_default_pct: number; schedule: { approval_business_days: integer | null; mode: "manual" | "net7" }; upcoming_changes: { effective_from: string; summary: object }[] }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/quality/ivt
Get IVT report
Daily IVT totals and filtering reasons for this publisher, by zone and fixed EST date (UTC-5), up to 92 days inclusive. Requires `publisher:read`. Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| from | query | string | 是 |
| to | query | string | 是 |
| zone_id | query | integer | 否 |
响应
{ rows: { by_reason: object; capped: integer; date: string; demand_as_of: string | null; demand_ivt_amount: string | null; filtered: integer; final: boolean; ivt_rate_pre: number | null; level: "ok" | "watch" | "strict" | "limited" | "paused_quality"; paused: integer; requests: integer; sent: integer; zone_id: integer }[] }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/sites
List sites
List the publisher's live sites. Use `include=deleted` to also include deleted sites. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| include | query | "deleted" | 否 |
响应
{ category: "mainstream" | "adult" | "network"; created_at: string; deleted_at: string | null; domain: string; id: integer; notes: string | null; pending_category: "mainstream" | "adult" | "network" | null; pending_category_at: string | null; publisher_note: string | null; status: "pending" | "approved" | "rejected"; zones_count: integer }[]
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
POST/v1/sites
Create a site
Register a new site (201). If you have the manage permission, adding your deleted site again restores it with the requested category (200). A conflict returns reason `domain_exists` for your live site, `domain_taken` for a domain reserved by another publisher, or `domain_archived` if you lack permission to restore your site. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
无参数。
请求体
{ category: "mainstream" | "adult" | "network"; domain: string }
响应
{ category: "mainstream" | "adult" | "network"; created_at: string; deleted_at: string | null; domain: string; id: integer; notes: string | null; pending_category: "mainstream" | "adult" | "network" | null; pending_category_at: string | null; publisher_note: string | null; status: "pending" | "approved" | "rejected"; zones_count: integer }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
DELETE/v1/sites/{id}
Delete a site
Delete a site and all of its zones. Requires the manage permission on your account (ask support to enable it); otherwise 403 with reason manage_not_allowed. With an API key, send the header X-Adnet-Confirm: true. Traffic stops within seconds; statistics and earnings are kept. Add the same domain again to restore the site. Requires scope publisher:write; not available in view-as. Rate limit tier: write.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| id | path | integer | 是 |
| x-adnet-confirm | header | string | 否 |
响应
any
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/sites/{id}
Get a site
Return one live site owned by the publisher. Use `include=deleted` to also look up deleted sites you own. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| include | query | "deleted" | 否 |
| id | path | integer | 是 |
响应
{ category: "mainstream" | "adult" | "network"; created_at: string; deleted_at: string | null; domain: string; id: integer; notes: string | null; pending_category: "mainstream" | "adult" | "network" | null; pending_category_at: string | null; publisher_note: string | null; status: "pending" | "approved" | "rejected"; zones_count: integer }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
PATCH/v1/sites/{id}
Update a site (partial)
Update a site. `category`: mainstream, adult or network. Some changes on an approved site need review: the response is 202 and `pending_category` shows the requested value; the site keeps running with its current `category` until the review is done. Send the current category to cancel a pending request. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`. `notes`: a note for the review team (max 500 characters); null or empty clears it.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
请求体
{ category?: "mainstream" | "adult" | "network"; notes?: string | null }
响应
{ category: "mainstream" | "adult" | "network"; created_at: string; deleted_at: string | null; domain: string; id: integer; notes: string | null; pending_category: "mainstream" | "adult" | "network" | null; pending_category_at: string | null; publisher_note: string | null; status: "pending" | "approved" | "rejected"; zones_count: integer }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
示例
cURL
#!/usr/bin/env bash
# Request mainstream for a site. HTTP 202 means it keeps its current category while the request is reviewed.
# Needs AGIMONE_API_KEY, AGIMONE_SITE_ID, curl and jq. Optional AGIMONE_API_BASE overrides the API URL.
set -euo pipefail
BASE="${AGIMONE_API_BASE:-https://app.agimone.com}"
SITE_ID="${AGIMONE_SITE_ID:?Set AGIMONE_SITE_ID to the site ID}"
curl -fsS -X PATCH -H "Authorization: Bearer $AGIMONE_API_KEY" -H 'Content-Type: application/json' \
--data '{"category":"mainstream"}' "$BASE/v1/sites/$SITE_ID" | jq -c '{category, pending_category}'
Node.js
// Request mainstream for a site. HTTP 202 means it keeps its current category while the request is reviewed.
// Needs AGIMONE_API_KEY, AGIMONE_SITE_ID and Node 18+. Optional AGIMONE_API_BASE overrides the API URL.
const base = process.env.AGIMONE_API_BASE ?? 'https://app.agimone.com';
const siteId = process.env.AGIMONE_SITE_ID;
if (!siteId) {
console.error('Set AGIMONE_SITE_ID to the site ID.');
process.exit(1);
}
const res = await fetch(`${base}/v1/sites/${siteId}`, {
method: 'PATCH',
headers: { Authorization: `Bearer ${process.env.AGIMONE_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ category: 'mainstream' }),
});
if (!res.ok) {
console.error(`HTTP ${res.status}: ${await res.text()}`);
process.exit(1);
}
const { category, pending_category } = await res.json();
console.log(JSON.stringify({ category, pending_category }));
PHP
<?php
// Request mainstream for a site. HTTP 202 means it keeps its current category while the request is reviewed.
// Needs AGIMONE_API_KEY, AGIMONE_SITE_ID and PHP 8 with cURL. Optional AGIMONE_API_BASE overrides the API URL.
$base = getenv('AGIMONE_API_BASE') ?: 'https://app.agimone.com';
$siteId = getenv('AGIMONE_SITE_ID');
if (!$siteId) {
fwrite(STDERR, "Set AGIMONE_SITE_ID to the site ID.\n");
exit(1);
}
$ch = curl_init("$base/v1/sites/$siteId");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('AGIMONE_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['category' => 'mainstream']),
CURLOPT_TIMEOUT => 15,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
fwrite(STDERR, "HTTP $status: " . ($body === false ? curl_error($ch) : $body) . "\n");
exit(1);
}
curl_close($ch);
$site = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
echo json_encode(['category' => $site['category'], 'pending_category' => $site['pending_category']]), "\n";
Python
# Request mainstream for a site. HTTP 202 means it keeps its current category while the request is reviewed.
# Needs AGIMONE_API_KEY, AGIMONE_SITE_ID and Python 3.8+. Optional AGIMONE_API_BASE overrides the API URL.
import json
import os
import sys
import urllib.error
import urllib.request
base = os.environ.get("AGIMONE_API_BASE", "https://app.agimone.com")
site_id = os.environ.get("AGIMONE_SITE_ID")
if not site_id:
sys.exit("Set AGIMONE_SITE_ID to the site ID.")
req = urllib.request.Request(
f"{base}/v1/sites/{site_id}",
data=json.dumps({"category": "mainstream"}).encode("utf-8"),
headers={
"Authorization": f"Bearer {os.environ['AGIMONE_API_KEY']}",
"Content-Type": "application/json",
},
method="PATCH",
)
try:
with urllib.request.urlopen(req, timeout=15) as res:
site = json.load(res)
print(json.dumps({"category": site["category"], "pending_category": site["pending_category"]}))
except urllib.error.HTTPError as e:
print(f"HTTP {e.code}: {e.read().decode()}", file=sys.stderr)
sys.exit(1)
PUT/v1/sites/{id}
Update a site
Change the category of a site owned by the publisher: mainstream, adult or network. Prefer PATCH /v1/sites/{id}. Some changes on an approved site need review: the response is 202 and `pending_category` shows the requested value; the site keeps running with its current `category` until the review is done. Send the current category to cancel a pending request. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
请求体
{ category: "mainstream" | "adult" | "network" }
响应
{ category: "mainstream" | "adult" | "network"; created_at: string; deleted_at: string | null; domain: string; id: integer; notes: string | null; pending_category: "mainstream" | "adult" | "network" | null; pending_category_at: string | null; publisher_note: string | null; status: "pending" | "approved" | "rejected"; zones_count: integer }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
POST/v1/sites/{id}/restore
Restore a site
Restore a deleted site you own and the zones deleted with it. Restored zones stay paused. A live site is returned unchanged. Requires the manage permission and scope `publisher:write` (API key or web session); not available in view-as. A domain in use returns `domain_taken`. Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
响应
{ category: "mainstream" | "adult" | "network"; created_at: string; deleted_at: string | null; domain: string; id: integer; notes: string | null; pending_category: "mainstream" | "adult" | "network" | null; pending_category_at: string | null; publisher_note: string | null; status: "pending" | "approved" | "rejected"; zones_count: integer }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/sites/{id}/zones
List zones of a site
List the ad zones of one site. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
响应
{ adblock_rate: number | null; category: "mainstream" | "adult"; category_source: "site" | "zone"; created_at: string; direct_url_enabled: boolean; freq: { cap_count: integer; cap_window_s: integer; delay_s: integer; min_interval_s: integer; per_page: integer | null; preset: "light" | "balanced" | "strong" | "per_page" | "custom"; repeat_after_s?: 0 | integer }; freq_cap_count: integer; freq_cap_hours: integer; id: integer; last_load_at: string | null; last_request_at: string | null; loads_24h: integer; name: string; requests_24h: integer; site_domain: string; site_id: integer; status: "active" | "paused"; tag_state: "never" | "stale" | "live"; via: "tag" | "smart_link" | "both" | null }[]
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
POST/v1/sites/{id}/zones
Create a zone
Create an ad zone under a site. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
请求体
{ category?: "mainstream" | "adult"; direct_url_enabled?: boolean; freq?: { cap_count?: integer; cap_window_s?: integer; delay_s?: integer; min_interval_s?: integer; per_page?: integer | null; preset: "light" | "balanced" | "strong" | "per_page" | "custom"; repeat_after_s?: 0 | integer }; freq_cap_count?: integer; freq_cap_hours?: integer; name: string }
响应
{ adblock_rate: number | null; category: "mainstream" | "adult"; category_source: "site" | "zone"; created_at: string; direct_url_enabled: boolean; freq: { cap_count: integer; cap_window_s: integer; delay_s: integer; min_interval_s: integer; per_page: integer | null; preset: "light" | "balanced" | "strong" | "per_page" | "custom"; repeat_after_s?: 0 | integer }; freq_cap_count: integer; freq_cap_hours: integer; id: integer; last_load_at: string | null; last_request_at: string | null; loads_24h: integer; name: string; requests_24h: integer; site_domain: string; site_id: integer; status: "active" | "paused"; tag_state: "never" | "stale" | "live"; via: "tag" | "smart_link" | "both" | null }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/stats
Get statistics
Pops, revenue and eCPM for the publisher, grouped by date, hour, site, zone, country, device, os, browser or page_domain; JSON or CSV. The browser filter accepts canonical browser keys. Revenue by browser is allocated in proportion to impressions. The browser view may be unavailable or switched off; check /v1/stats/availability. Unavailable browser grouping or filtering returns 400 breakdown_unavailable with breakdown browser (JSON and CSV) before statistics queries. Grouping or filtering by page_domain is available only once measurement is active: before that it returns 400 `page_domain_unavailable`, and JSON responses carry `page_domain_available`. With group_by containing `hour` the range (both ends inclusive, EST business days) must be at most 31 days, otherwise 400 `hour_range`; hourly revenue of finalized days is an allocation of the daily revenue (response has `hourly_revenue_allocated: true`), not a per-hour measurement; hours of days not yet finalized are estimates. JSON hours are ISO UTC; CSV hours display EST (UTC-5). Each row has status estimated, reported, final or mixed; zero valid impressions have null eCPM. The response identifies the accepted count and money snapshot. Requires scope publisher:read (API key or web session). Rate limit tier: stats.
- 权限范围
- publisher:read
- 速率限制级别
- stats
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| from | query | string | 是 |
| to | query | string | 是 |
| group_by | query | ("date" | "hour" | "site" | "zone" | "country" | "device" | "os" | "browser" | "page_domain")[] | 否 |
| metrics | query | ("pops" | "revenue" | "ecpm")[] | 否 |
| site_id | query | integer | 否 |
| zone_id | query | integer | 否 |
| country | query | string | 否 |
| browser | query | "chrome" | "safari" | "firefox" | "edge" | "samsung_internet" | "opera" | "uc_browser" | "yandex" | "other" | 否 |
| page_domain | query | string | 否 |
| format | query | "json" | "csv" | 否 |
响应
{ browser_missing_days?: string[]; count_basis?: "valid" | "legacy" | "mixed"; currency: "USD"; data_as_of?: string | null; estimated_from: string | null; forecast_basis_version?: "forecast-basis-v1"; forecast_generation?: string; forecast_updated_at?: string | null; hourly_revenue_allocated?: true; measurement_definition?: { complete: boolean; includes_direct: boolean; includes_legacy: boolean; tag_valid_after_ms: integer[] }; measurement_generation?: string; measurement_status?: "ok" | "stale" | "updating"; measurement_updated_at?: string | null; money_basis_version?: string; money_generation?: string; page_domain_available?: boolean; rows: { browser?: "chrome" | "safari" | "firefox" | "edge" | "samsung_internet" | "opera" | "uc_browser" | "yandex" | "other"; country?: string; date?: string; device?: string; ecpm?: string | null; hour?: string; os?: string; page_domain?: string | null; pops?: integer; publisher_id?: integer; revenue?: string; site_deleted?: true; site_domain?: string; site_id?: integer; status?: "estimated" | "reported" | "final" | "mixed"; zone_deleted?: true; zone_id?: integer; zone_name?: string }[]; totals: { ecpm: string | null; pops: integer; revenue: string; status?: "estimated" | "reported" | "final" | "mixed" }; truncated?: boolean; updated_at?: string | null }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
示例
cURL
#!/usr/bin/env bash
# GET /v1/stats: daily pops, revenue and eCPM for the last 7 calendar days (EST, fixed UTC-5).
# Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE, AGIMONE_FROM, AGIMONE_TO.
set -euo pipefail
BASE="${AGIMONE_API_BASE:-https://app.agimone.com}"
# Snapshot the EST day once; calendar arithmetic uses that date label.
TODAY="$(TZ=Etc/GMT+5 date +%F)"
# `date -v` is BSD/macOS, `date -d` is GNU/Linux.
FROM="${AGIMONE_FROM:-$(date -u -j -v-6d -f '%Y-%m-%d' "$TODAY" +%F 2>/dev/null || date -u -d "$TODAY -6 days" +%F)}"
TO="${AGIMONE_TO:-$TODAY}"
curl -fsS -H "Authorization: Bearer $AGIMONE_API_KEY" \
"$BASE/v1/stats?from=$FROM&to=$TO&group_by=date&metrics=pops,revenue,ecpm"
echo
Node.js
// GET /v1/stats: daily pops, revenue and eCPM for the last 7 calendar days (EST, fixed UTC-5). Node 18+, no dependencies.
// Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE, AGIMONE_FROM, AGIMONE_TO.
const base = process.env.AGIMONE_API_BASE ?? 'https://app.agimone.com';
const parts = new Intl.DateTimeFormat('en-US', { timeZone: 'Etc/GMT+5', year: 'numeric', month: '2-digit', day: '2-digit' }).formatToParts(new Date());
const part = (type) => parts.find((p) => p.type === type).value;
const today = `${part('year')}-${part('month')}-${part('day')}`;
const day = (offset) => new Date(Date.parse(`${today}T00:00:00Z`) + offset * 86_400_000).toISOString().slice(0, 10);
const query = new URLSearchParams({
from: process.env.AGIMONE_FROM ?? day(-6),
to: process.env.AGIMONE_TO ?? today,
group_by: 'date',
metrics: 'pops,revenue,ecpm',
});
const res = await fetch(`${base}/v1/stats?${query}`, {
headers: { Authorization: `Bearer ${process.env.AGIMONE_API_KEY}` },
});
if (!res.ok) {
console.error(`HTTP ${res.status}: ${await res.text()}`);
process.exit(1);
}
console.log(JSON.stringify(await res.json()));
PHP
<?php
// GET /v1/stats: daily pops, revenue and eCPM for the last 7 calendar days (EST, fixed UTC-5). PHP 8 with the curl extension, no other dependencies.
// Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE, AGIMONE_FROM, AGIMONE_TO.
$base = getenv('AGIMONE_API_BASE') ?: 'https://app.agimone.com';
$today = new DateTimeImmutable('now', new DateTimeZone('Etc/GMT+5'));
$query = http_build_query([
'from' => getenv('AGIMONE_FROM') ?: $today->modify('-6 days')->format('Y-m-d'),
'to' => getenv('AGIMONE_TO') ?: $today->format('Y-m-d'),
'group_by' => 'date',
'metrics' => 'pops,revenue,ecpm',
]);
$ch = curl_init("$base/v1/stats?$query");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('AGIMONE_API_KEY')],
CURLOPT_TIMEOUT => 15,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
fwrite(STDERR, "HTTP $status: " . ($body === false ? curl_error($ch) : $body) . "\n");
exit(1);
}
curl_close($ch);
echo trim($body), "\n";
Python
# GET /v1/stats: daily pops, revenue and eCPM for the last 7 calendar days (EST, fixed UTC-5). Python 3.8+, standard library only.
# Needs: AGIMONE_API_KEY (create one at https://app.agimone.com/app/account/api-keys). Optional: AGIMONE_API_BASE, AGIMONE_FROM, AGIMONE_TO.
import json
import os
import sys
import urllib.error
import urllib.parse
import urllib.request
from datetime import datetime, timedelta, timezone
base = os.environ.get("AGIMONE_API_BASE", "https://app.agimone.com")
# Fixed UTC-5 is Etc/GMT+5; Python 3.8 needs no zoneinfo/tzdata dependency.
today = datetime.now(timezone(timedelta(hours=-5))).date()
query = urllib.parse.urlencode({
"from": os.environ.get("AGIMONE_FROM", str(today - timedelta(days=6))),
"to": os.environ.get("AGIMONE_TO", str(today)),
"group_by": "date",
"metrics": "pops,revenue,ecpm",
})
req = urllib.request.Request(
f"{base}/v1/stats?{query}",
headers={"Authorization": f"Bearer {os.environ['AGIMONE_API_KEY']}"},
)
try:
with urllib.request.urlopen(req, timeout=15) as res:
print(json.dumps(json.load(res)))
except urllib.error.HTTPError as e:
print(f"HTTP {e.code}: {e.read().decode()}", file=sys.stderr)
sys.exit(1)
GET/v1/stats/availability
Get available statistics views
Returns browser_available: true when statistics may be grouped or filtered by browser, or false when this view is unavailable for the account configuration. Also returns browser_enabled: false when the browser view is switched off (hide the option) and browser_data_since: the first EST business day (YYYY-MM-DD) from which every hour carries a browser label, or null when unknown; earlier traffic is grouped as other. Check before selecting a browser view. Unavailable browser grouping or filtering returns 400 breakdown_unavailable with breakdown browser for JSON and CSV. Requires scope publisher:read (API key or web session). Rate limit tier: read.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ browser_available: boolean; browser_data_since?: string | null; browser_enabled?: boolean }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/stats/subid
Get statistics by subid
Pops, revenue and eCPM grouped by sub1, sub2 and sub3, for at most 90 days; JSON or CSV. Revenue per subid is an allocation of the revenue reported by /v1/stats for each zone and country in proportion to pops, not a separate measurement (`revenue_allocated` is always true); the totals equal the totals of /v1/stats for the same range and filters. Rows are sorted by revenue; rows beyond `limit` are merged into one row whose subid is `~other`. A null subid means no subid was sent. Requires scope publisher:read (API key or web session). Rate limit tier: stats.
- 权限范围
- publisher:read
- 速率限制级别
- stats
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| from | query | string | 是 |
| to | query | string | 是 |
| group_by | query | ("sub1" | "sub2" | "sub3")[] | 否 |
| site_id | query | integer | 否 |
| zone_id | query | integer | 否 |
| sub1 | query | string | 否 |
| sub2 | query | string | 否 |
| sub3 | query | string | 否 |
| limit | query | integer | 否 |
| format | query | "json" | "csv" | 否 |
响应
{ count_basis?: "valid" | "legacy" | "mixed"; currency: "USD"; estimated_from: string | null; forecast_basis_version?: "forecast-basis-v1"; forecast_generation?: string; forecast_updated_at?: string | null; measurement_definition?: { complete: boolean; includes_direct: boolean; includes_legacy: boolean; tag_valid_after_ms: integer[] }; measurement_generation?: string; measurement_status?: "ok" | "stale" | "updating"; measurement_updated_at?: string | null; money_basis_version?: string; money_generation?: string; revenue_allocated: true; rows: { ecpm: string | null; pops: integer; revenue: string; status?: "estimated" | "reported" | "final" | "mixed"; sub1?: string | null; sub2?: string | null; sub3?: string | null }[]; totals: { ecpm: string | null; pops: integer; revenue: string; status?: "estimated" | "reported" | "final" | "mixed" }; truncated?: boolean; updated_at?: string | null }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/stats/subid/availability
Subid statistics availability
Whether statistics by subid are enabled. Requires scope publisher:read (API key or web session).
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ enabled: boolean }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/telegram/links
List Telegram links
Active and blocked Telegram links for this publisher. Chat identifiers are private. Returns enabled:false when Telegram is unavailable. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
无参数。
响应
{ bot_username: string | null; enabled: boolean; links: { created_at: string; id: integer; locale: "en" | "vi" | "es" | "pt" | "fr" | "id" | "ru" | "zh" | "ar"; status: "active" | "blocked"; tg_username: string | null }[]; max_links: 3 }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/whoami
Who am I
Actor behind the current API key or session, with its scopes. Any authenticated actor. Rate limit tier: `read`.
- 权限范围
- 任意密钥或会话
- 速率限制级别
- read
参数
无参数。
响应
{ actor_id: integer | null; actor_type: string; api_key_id: integer | null; scopes: ("publisher:read" | "publisher:write" | "admin:read" | "admin:write" | "infra:read" | "infra:write" | "adv:read" | "adv:write" | "scan:work" | "dsp0:review")[] }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/zones
List zones
List all ad zones of the publisher, optionally filtered by site_id. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| site_id | query | integer | 否 |
响应
{ adblock_rate: number | null; category: "mainstream" | "adult"; category_source: "site" | "zone"; created_at: string; direct_url_enabled: boolean; freq: { cap_count: integer; cap_window_s: integer; delay_s: integer; min_interval_s: integer; per_page: integer | null; preset: "light" | "balanced" | "strong" | "per_page" | "custom"; repeat_after_s?: 0 | integer }; freq_cap_count: integer; freq_cap_hours: integer; id: integer; last_load_at: string | null; last_request_at: string | null; loads_24h: integer; name: string; requests_24h: integer; site_domain: string; site_id: integer; status: "active" | "paused"; tag_state: "never" | "stale" | "live"; via: "tag" | "smart_link" | "both" | null }[]
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
DELETE/v1/zones/{id}
Delete a zone
Delete a zone. Requires the manage permission on your account (ask support to enable it); otherwise 403 with reason manage_not_allowed. With an API key, send the header X-Adnet-Confirm: true. Traffic stops within seconds; statistics and earnings are kept. Contact support to restore the zone. Requires scope publisher:write; not available in view-as. Rate limit tier: write.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| id | path | integer | 是 |
| x-adnet-confirm | header | string | 否 |
响应
any
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/zones/{id}
Get a zone
Return one zone owned by the publisher. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
响应
{ adblock_rate: number | null; category: "mainstream" | "adult"; category_source: "site" | "zone"; created_at: string; direct_url_enabled: boolean; freq: { cap_count: integer; cap_window_s: integer; delay_s: integer; min_interval_s: integer; per_page: integer | null; preset: "light" | "balanced" | "strong" | "per_page" | "custom"; repeat_after_s?: 0 | integer }; freq_cap_count: integer; freq_cap_hours: integer; id: integer; last_load_at: string | null; last_request_at: string | null; loads_24h: integer; name: string; requests_24h: integer; site_domain: string; site_id: integer; status: "active" | "paused"; tag_state: "never" | "stale" | "live"; via: "tag" | "smart_link" | "both" | null }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
PUT/v1/zones/{id}
Update a zone
Update fields of a zone owned by the publisher. Requires scope `publisher:write` (API key or web session); not available in view-as. Renaming and changing frequency need no confirmation. With an API key, pausing an active zone or turning its Smart Link off requires the header `X-Adnet-Confirm: true` (otherwise 428). Changing `direct_url_enabled` needs the Direct Link permission (403 `direct_link_not_allowed`). After the site is approved, changing the category of a network-site zone from mainstream to adult is always allowed; from adult to mainstream requires the manage permission (409 `manage_not_allowed`). Rate limit tier: `write`.
- 权限范围
- publisher:write
- 速率限制级别
- write
参数
| 名称 | 位置 | 类型 | 必填 |
|---|
| id | path | integer | 是 |
| x-adnet-confirm | header | string | 否 |
请求体
{ category?: "mainstream" | "adult"; direct_url_enabled?: boolean; freq?: { cap_count?: integer; cap_window_s?: integer; delay_s?: integer; min_interval_s?: integer; per_page?: integer | null; preset: "light" | "balanced" | "strong" | "per_page" | "custom"; repeat_after_s?: 0 | integer }; freq_cap_count?: integer; freq_cap_hours?: integer; name?: string; status?: "active" | "paused" }
响应
{ adblock_rate: number | null; category: "mainstream" | "adult"; category_source: "site" | "zone"; created_at: string; direct_url_enabled: boolean; freq: { cap_count: integer; cap_window_s: integer; delay_s: integer; min_interval_s: integer; per_page: integer | null; preset: "light" | "balanced" | "strong" | "per_page" | "custom"; repeat_after_s?: 0 | integer }; freq_cap_count: integer; freq_cap_hours: integer; id: integer; last_load_at: string | null; last_request_at: string | null; loads_24h: integer; name: string; requests_24h: integer; site_domain: string; site_id: integer; status: "active" | "paused"; tag_state: "never" | "stale" | "live"; via: "tag" | "smart_link" | "both" | null }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.
GET/v1/zones/{id}/code
Get zone embed code
Return the embed code snippet for a zone. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.
- 权限范围
- publisher:read
- 速率限制级别
- read
参数
响应
{ direct_url: string | null; loader: string; tag: { adblock_rate: number | null; last_load_at: string | null; last_request_at: string | null; loads_24h: integer; requests_24h: integer; state: "never" | "stale" | "live"; via: "tag" | "smart_link" | "both" | null } }
操作错误
The operation reference lists additional HTTP responses. Check its response schema in OpenAPI for the exact error codes and fields.