API reference

Create and manage short links and read their stats from your own code, with a JSON REST API.

Authentication

Create a token under Settings, API. A token belongs to one workspace and either only reads or also writes. Send it as a bearer token with every request. Create a token

curl https://v2.exx.us/api/v1/links \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Limits and errors

Each workspace can make 120 reading and 30 writing requests a minute. The X-RateLimit-Remaining header says how many are left. Clicks on your links are never limited.

Errors come as JSON with a message, and for invalid input an errors object per field.

401
No token, or not an API token.
403
The token is read-only, you left its workspace, or the plan has no API access.
404
No link in this workspace matches.
422
The input is not valid, or a plan limit is reached. errors lists each field.
429
Too many requests. Retry-After says how many seconds to wait.

Endpoints

Every path starts at https://v2.exx.us/api/v1.

Workspace analytics

GET /analytics

Clicks across the whole workspace: a daily trend, the top links and the same breakdowns.

period14, 30, 90, 365, 730
Days to cover, 14 by default. Your plan sets how far back you can look.

Workspace

GET /workspace

The workspace of the token, its plan, and how much of each limit it uses.

{
  "data": {
    "id": 7,
    "name": "Marketing",
    "plan": { "key": "free", "name": "Free", "stats_days": 90 },
    "usage": { "links_per_month": { "used": 12, "limit": 100 }, ... }
  }
}

Domains

GET /domains

The domains you can create links on: the shared ones and your own verified ones.

Campaigns

GET /campaigns

The campaigns in the workspace, starred first.

Channels

GET /channels

The channels in the workspace, starred first.