Shortaty API documentation
Create and manage your short links programmatically from any application, service, or script — the same capabilities you get in the dashboard, exposed through a simple, predictable REST API.
- Create a new key from the API Keys page.
- Save the
Secret— it's shown only once. - Send your first POST request to create your first link.
Authentication
Every request must carry a valid API Key and Secret. There are two equivalent ways — pick whichever fits your HTTP client:
Response Envelope
All responses follow the same unified envelope. That simplifies error handling in your code.
All responses include the header X-Api-Version: v1. . The status code (200 / 201 / 4xx / 5xx) conveys HTTP-level state, and the error.code field conveys the programmatic detail.
Scopes
Each key is provisioned with specific scopes at creation time. If you call an endpoint without the required scope, the response is 403 insufficient_scope.
The least privilegeprinciple: grant the key only what it needs. The links:delete and clicks:read scopes are non-default by design.
Rate limits & quotas
Currently there's no strict requests-per-minute rate limit — but abuse may auto-disable the key. If you need higher limits, contact the admin.
Endpoints — overview
/api/v1/linksscope: links:writeCreates a new link on a domain available to your account. Auto-generates a slug if you don't provide one.
curl -X POST https://short-tool.vercel.app/api/v1/links \
-H "X-API-Key: pk_..." \
-H "X-API-Secret: sk_..." \
-H "Content-Type: application/json" \
-d '{
"target_url": "https://example.com/very/long/url",
"domain": "ostazna.blog",
"title": "Spring sale",
"expires_at": "2026-06-01T00:00:00Z"
}'Response (201)
{
"data": {
"id": "8b3b6e8c-7e9a-4b1f-bb87-1e0c1f4f5b3e",
"short_url": "https://ostazna.blog/x7K9p2",
"slug": "x7K9p2",
"subdomain": null,
"domain": "ostazna.blog",
"target_url": "https://example.com/very/long/url",
"title": "Spring sale",
"expires_at": "2026-06-01T00:00:00.000Z",
"max_clicks": null,
"is_active": true,
"created_at": "2026-05-21T10:30:00.000Z"
}
}/api/v1/linksscope: links:readReturns your links with pagination.
curl "https://short-tool.vercel.app/api/v1/links?limit=20&offset=0" \
-H "X-API-Key: pk_..." \
-H "X-API-Secret: sk_..."Response
{
"data": {
"links": [
{
"id": "8b3b6e8c-...",
"short_url": "https://ostazna.blog/x7K9p2",
"slug": "x7K9p2",
"subdomain": null,
"domain": "ostazna.blog",
"target_url": "https://example.com/long/url",
"title": "Spring sale",
"click_count": 42,
"expires_at": null,
"max_clicks": null,
"is_active": true,
"created_at": "2026-05-21T10:30:00.000Z"
}
],
"pagination": { "total": 137, "limit": 20, "offset": 0 }
}
}/api/v1/links/:idscope: links:readReturns a single link with full details, including target_rules.
curl https://short-tool.vercel.app/api/v1/links/8b3b6e8c-7e9a-4b1f-bb87-1e0c1f4f5b3e \
-H "X-API-Key: pk_..." \
-H "X-API-Secret: sk_..."/api/v1/links/:idscope: links:writePartial update — send only the fields you want to change. Every field is optional, but you must send at least one.
curl -X PATCH https://short-tool.vercel.app/api/v1/links/8b3b6e8c-... \
-H "X-API-Key: pk_..." \
-H "X-API-Secret: sk_..." \
-H "Content-Type: application/json" \
-d '{ "is_active": false, "title": "Paused — pending review" }'/api/v1/links/:idscope: links:deletePATCH with is_active: false.curl -X DELETE https://short-tool.vercel.app/api/v1/links/8b3b6e8c-... \
-H "X-API-Key: pk_..." \
-H "X-API-Secret: sk_..."/api/v1/domainsscope: domains:readReturns the domains you can create links on. Admins — all domains. Regular users — only granted domains.
curl https://short-tool.vercel.app/api/v1/domains \
-H "X-API-Key: pk_..." \
-H "X-API-Secret: sk_..."Error codes
Ready to start?
Create your first key in under a minute and start creating links programmatically.
Create API Key