Agent-readable docs index: /docs/llms.txt. Full docs in one file: /docs/llms-full.txt. Download /docs/docs.zip to grep all markdown files locally.

REST API v1 Overview & Authentication

The Shaf REST API provides programmatic access to manage links, domains, analytics, and workspace entities.

Base URL

All requests must be directed over HTTPS to:
https://shaf.app/api/v1

Authentication

Every API request requires an API key supplied in the HTTP Authorization header using the Bearer scheme:
Authorization: Bearer shaf_live_your_api_key_here
Unauthenticated or invalid requests receive an HTTP 401 Unauthorized response.

Standard Response Format

All responses are returned in JSON format using a consistent envelope structure:

Successful Response:

{ "code": 0, "data": { "key": "value" } }

Error Response:

{ "code": 40001, "message": "Invalid destination URL provided", "data": null }

Rate Limits

Plan TierRate Limit (Requests / Minute)Burst Allowance
Starter120 req / min30 req / 5s
Pro600 req / min100 req / 5s
EnterpriseCustom (up to 10,000 req / min)Custom
When limits are exceeded, the API responds with HTTP 429 Too Many Requests containing standard rate limit headers:
  • X-RateLimit-Limit: Maximum requests permitted per window.
  • X-RateLimit-Remaining: Remaining requests in the active window.
  • X-RateLimit-Reset: Unix timestamp when the quota refreshes.