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.
Manage short link entities within your active organization workspace.

POST /api/v1/links

Request Body Parameters

FieldTypeRequiredDescription
urlstringYesDestination target URL (must include https:// or http://)
slugstringNoCustom slug identifier. If omitted, a random 6-character slug is generated
domainstringNoTarget custom or system domain (defaults to shaf.is)
descriptionstringNoHuman-readable title or memo
tagsstring[]NoArray of classification tags
passwordstringNoAccess password to gate the redirect
expiresAtstringNoISO 8601 UTC timestamp when the link ceases resolving
applestringNoSmart redirect URL for iOS visitors
googlestringNoSmart redirect URL for Android visitors

Request Example

curl -X POST https://shaf.app/api/v1/links \ -H "Authorization: Bearer shaf_live_..." \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/checkout", "slug": "promo-2026", "domain": "link.yourbrand.com", "tags": ["promo", "summer"], "apple": "https://apps.apple.com/app/id12345", "google": "https://play.google.com/store/apps/details?id=com.example" }'

GET /api/v1/links

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Pagination page index
limitnumber20Results per page (max 100)
searchstring-Substring search matching slug, URL, or title
tagstring-Filter links by specific tag
domainstring-Filter links by domain

GET /api/v1/links/:slug?domain=:domain
Retrieves the link metadata along with total click impressions, unique visitors, and geographic breakdown.

PATCH /api/v1/links/:slug
Update mutable properties (destination url, description, tags, apple, google, password).

DELETE /api/v1/links/:slug?domain=:domain
Permanently deletes the short link and invalidates edge KV caches globally.
Deleting a link is immediate and irreversible across Cloudflare's global edge network. Any traffic hitting deleted slugs will fall back to your custom 404 URL or the default Shaf 404 page.