API Reference/Authentication

Authentication

Bearer tokens, the base URL, and API versioning.

Base URL

https://api.stynar.com

All API requests use this base URL. Append the path shown on each endpoint page, e.g.:

GET https://api.stynar.com/v1/campaigns/
POST https://api.stynar.com/v1/campaigns/

API version

API version v1

The version is the literal v1 path prefix — there's currently one version of this API. Future breaking changes would ship as a new prefix (e.g. v2) rather than in place, so existing integrations keep working.

Authorization header

Every request must include your API key as a Bearer token. Keys are 256-bit random secrets, prefixed esk_ — treat them exactly like a password.

Authorization header
Authorization: Bearer esk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keys are not interchangeable with your login session

API keys and the session token your browser uses when you're logged into Stynar are validated by completely separate systems. A key that works here will never work as a login session, and vice versa.

Scopes

Each key is created with read (view-only endpoints), write (state-changing endpoints), or both — chosen at creation time. A key without the required scope gets 403 INSUFFICIENT_SCOPE. See API Keys for how to create and manage them.

Check your access

GET/v1/account

Returns your plan-independent API entitlement, limits, and this month's usage.

curl "https://api.stynar.com/v1/account" \
  -H "Authorization: Bearer esk_your_key_here"
200 OK
200 response
{
  "apiEnabled": true,
  "limits": {
    "monthlyRequests": 50000,
    "requestsPerMinute": 60,
    "burstPerSecond": 10,
    "maxApiKeys": 3
  },
  "usage": {
    "monthlyRequests": 1284
  }
}