Legacy API
Reference for existing ViewsBase API callers.
The ViewsBase CLI and skill are retired. Connect your AI app through the
hosted MCP server. Existing API tokens keep their current access
until they expire or you revoke them. The API comes with Growth and up: on
Starter, calls and new tokens are refused with 402 and code
integrations_plan_required.
Offer example
[
{
"payment_type": "per_post",
"name": "Per post + bonus",
"cpm": 0,
"cap_type": "views",
"post_terms": {
"version": 1,
"amount": 15,
"minimum_views": 300,
"posts_per_period": 20,
"period_days": 30,
"starts_at": "2026-10-01T00:00:00Z",
"counting_window_days": 30,
"bonus": {
"type": "milestones",
"milestones": [
{ "views": 100000, "amount": 100 },
{ "views": 250000, "amount": 250 }
]
}
}
}
]API Contract
The CLI uses /api/cli/v1. Send Authorization: Bearer TOKEN and
X-ViewsBase-Campaign: CAMPAIGN_ID_OR_SLUG on campaign requests. Data responses
use Cache-Control: no-store. No raw creator access code, token, proof link,
or payment reference is returned by these post endpoints.
| Method and path | Purpose |
|---|---|
GET /posts | Paginated scoped posts with saved deals and payment breakdowns |
GET /posts/{id} | One scoped post and its current creator offer |
GET /posts/{id}/views | Sampled view history |
GET /creators/{id} | Creator details and campaign offer; includes a private portal link |
POST /creators/{id}/offer | Replace that creator's campaign offer |
PATCH /posts/{id}/cpm | Change effective CPM/cap for an eligible CPM post |
POST /posts/{id}/finalize | Close an eligible post using saved terms |
POST /posts/{id}/refresh | Fetch fresh views for one active post now (Scale and up; once per post every 10 minutes; daily workspace limit). Returns 402, 429 or 502 when refused or the fetch fails |
The offer request is { "compensation_mode": "cpm", "deal": [...] }, using the
same array as offer.json. Pending and no-CPM modes use an empty deal. The route
rejects unsupported fields and invalid terms with 400. It returns 409 for a
locked per-post schedule. Success returns the creator ID, campaign ID, handle,
compensation mode, and deal.
The finalize request body is {}. 409 means the post is frozen, its window is
open, or its current state does not allow the action. A per-post refresh failure
returns 502; read the post before retrying. A successful response contains
post, including its stored amount and available breakdown. Missing or
out-of-scope records return 404; insufficient permissions return 403.
Expired or revoked tokens return 401.