shorten.dev/docs
shorten.dev/docs
Getting StartedAuthentication
OverviewLinksAnalyticsErrors & Rate Limits
API Reference

Overview

Complete reference for the Shorten REST API.

Base URL

All API requests are made to:

https://shorten.dev/api/v1

The 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

MethodEndpointDescription
POST/linksCreate a link
POST/links/bulkBulk create links
GET/linksList links
GET/links/:slugGet a link
POST/links/:slug/revokeRevoke a link
GET/links/:slug/analyticsGet analytics

Pagination

List endpoints return paginated responses with data, total, page, limit, and total_pages fields.

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger10Items per page (max 50)
sortstringcreated_atSort by created_at, updated_at, slug, destination_url, or status
orderstringdescasc 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.

Section overview

Links

Create, list, retrieve, and revoke shortened links.

Analytics

Retrieve click analytics and traffic data for your links.

Errors & Rate Limits

Error codes, rate limits, and retry strategies.

Authentication

Authenticate requests across the REST API, CLI, and MCP server with API keys.

Links

Create, retrieve, list, and revoke shortened links.

On this page

Base URLAuthenticationEndpointsPaginationLink retentionVersioningSection overview