Overview
Complete reference for the Shorten REST API.
Base URL
All API requests are made to:
https://shorten.dev/api/v1The API accepts and returns JSON. Include Content-Type: application/json for request bodies.
Authentication
All requests require a Bearer token. See Authentication for details on scopes and key management.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /links | Create a link |
| POST | /links/bulk | Bulk create links |
| GET | /links | List links |
| GET | /links/:slug | Get a link |
| POST | /links/:slug/revoke | Revoke a link |
| GET | /links/:slug/analytics | Get analytics |
Pagination
List endpoints return paginated responses with data, total, page, limit, and total_pages fields.
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 10 | Items per page (max 50) |
sort | string | created_at | Sort by created_at, updated_at, slug, destination_url, or status |
order | string | desc | asc or desc |
Link retention
Links on Shorten are permanent — they never expire and are never automatically deleted. Once a slug is created, it cannot be reassigned to a different destination, even after revocation. This prevents link takeover attacks where a widely-shared URL could be replaced with a malicious destination.
Versioning
The API is versioned via the URL path (/v1). Breaking changes ship under a new version. Non-breaking additions (new fields, new endpoints) may be added without notice.