API referenceGetting started
Authentication
How a request proves which account it belongs to.
Sending a key
Every request carries a key as a bearer token. The account is resolved from the key itself and never from the request body or a path parameter, which is what makes cross-account access impossible rather than merely discouraged: there is no field a caller could set to reach somebody else's data.
curl https://track.acrune.com/v1/campaigns \
-H "Authorization: Bearer $ACRUNE_KEY"The key is an account credential, not a user credential. Anything holding it can read every creator on the account, so it belongs on your server and never in a browser, a mobile binary or a build artefact.
Scopes
A key carries scopes, chosen when it is issued and never widened afterwards. Ask for the narrowest one that does the job: a service that only draws a leaderboard has no business holding a key that can enrol.
| Scope | What it opens |
|---|---|
| read | Every GET: campaigns, creator stats, campaign leaderboards. |
| write | Adds opening campaigns, enrolling creators, and attaching posts. Implies read. |
A key without the scope for a route is refused with 403, not 401. The credential is valid and simply may not do this, and telling the two apart is what lets you fix the right thing.
Rotating and revoking
Only a hash of each key is stored, so the key exists in readable form exactly once, in the response to the request that created it. If it is lost the answer is a new key, not a recovery.
Revoking is immediate and cannot be undone. Anything still presenting the key starts receiving 401 on its next request.
There is no sandbox key. Keys carry a live/test flag but nothing is isolated behind it yet, and issuing a test key that quietly writes to the same data as a live one would be worse than not offering one. Build against a campaign of your own, pointed at a URL you control.