All docs

Docs · Section 14

API Keys & Public API

Cut.bd provides a REST API so you can create links, query analytics, manage tags, and more from your own code or integrations.

Key format

Every key looks like sl_live_XXXXXXXXXXXXXXXXXXXX — a brand prefix, environment marker, and a 22-character random body with 110 bits of entropy.

The raw key is shown only once at creation time. Cut.bd stores only a salted hash — the original key cannot be retrieved later. If you lose a key, revoke it and create a new one.

Scopes

ScopePermission
links:read / links:write / links:deleteRead, create/update, or delete links.
analytics:readRead click analytics and the raw click log.
domains:read / domains:writeList or manage custom domains.
tags:read / tags:writeList/read or create/update/delete tags.
pixels:read / pixels:writeList or create/delete retargeting pixels.
funnels:read / funnels:writeList/read or create/update/delete funnels.
workspaces:readList workspaces you’re a member of.

You can have up to 50 active (non-revoked) API keys per account at any time.

Public API reference

Base URL: https://api.cut.bd/api/v1/public. All requests must include:

Authorization: Bearer sl_live_YOUR_KEY_HERE

Create a link

POST /links

{
  "destinationUrl": "https://example.com/page",
  "slug": "my-slug",
  "title": "My Campaign Link",
  "tags": ["launch", "email"],
  "expiresAt": "2026-12-31T23:59:59Z",
  "utm": {
    "source": "newsletter",
    "medium": "email",
    "campaign": "q1-launch"
  }
}

Required scope: links:write.

List links

GET /links?limit=20&cursor=...&status=active&tag=launch-2026

Required scope: links:read.

Get link analytics

GET /links/:id/analytics?range=7d

Response includes totals, previousTotals, timeSeries, topCountries, topReferrers, topDevices, deepLinkBreakdown, hourlyHeatmap, and utmBreakdown. Required scope: analytics:read.

Error responses

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "destinationUrl is required",
    "details": [{ "path": "destinationUrl", "message": "Required" }]
  }
}
CodeHTTPMeaning
UNAUTHORIZED401Missing or invalid API key.
KEY_REVOKED / KEY_EXPIRED401The API key has been revoked or has expired.
INSUFFICIENT_SCOPE401The key lacks the required scope.
FORBIDDEN403Authenticated but not allowed (e.g. wrong workspace).
NOT_FOUND404Resource does not exist.
CONFLICT409Duplicate slug or other uniqueness violation.
VALIDATION_ERROR422Request body failed validation.
TOO_MANY_REQUESTS429Rate limit exceeded.