trak.sh docs
API Reference

API Reference

Programmatic access to trak.sh via REST API. Pro plan required.

Overview

The trak.sh API lets you create, list, delete links and fetch analytics programmatically. All endpoints require a Pro plan and API key authentication.

Base URL: https://trak.sh/api/v1

Endpoints

MethodPathDescription
POST/api/v1/linksCreate a link
GET/api/v1/linksList your links
DELETE/api/v1/links/:slugDelete a link
GET/api/v1/links/:slug/analyticsGet analytics

Authentication

All requests require a Bearer token in the Authorization header:

Authorization: Bearer trak_YOUR_API_KEY

See Authentication for setup details.

Rate limits

API requests are not currently rate-limited for Pro users. This may change in the future.

Errors

All error responses follow this format:

{
  "error": "Human-readable error message"
}
StatusMeaning
400Invalid request (bad URL, invalid slug format)
401Missing or invalid API key
404Link not found
409Slug already taken
500Server error

On this page