Linkly URL Shortener API
The Linkly URL shortener API (also known as a link shortener API) lets you create and manage short links, track clicks, configure custom domains, and subscribe to webhooks — all programmatically.
You don't need to read this documentation to use the API. The Linkly interface shows the exact API request inline whenever you create a link or pull analytics — just copy and paste it directly into your code or terminal.
Looking for step-by-step guides, tutorials, and FAQs? The Linkly API documentation covers a broader range of topics. This page is the complete endpoint reference.
Authentication
All API requests require an API key. You can find your API key in your Linkly workspace settings.
The recommended way is to pass it as a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can also use HTTP Basic Auth, with your API key as the username and an empty password:
Authorization: Basic base64(YOUR_API_KEY:)
Or, for quick testing, pass it as the api_key query parameter. Prefer the header in production — query-string keys can leak into server logs, browser history, and Referer headers:
GET https://api.linklyhq.com/api/v1/workspaces?api_key=YOUR_API_KEY
A request with a missing or invalid API key returns 401; a request for a workspace your key cannot access returns 404 (workspaces you don't belong to are not distinguished from ones that don't exist); plan- or permission-related failures return 403. All errors share the JSON shape documented under Errors below.
Base URL
https://api.linklyhq.com/api/v1
Workspaces
Most endpoints are scoped to a workspace. Use GET /workspaces to list your available workspaces and retrieve their IDs.
Rate Limits
API requests are rate-limited per API key. When you exceed the limit, the API returns 429 Too Many Requests. Check the response body for your current usage and limit.
Errors
Errors return the appropriate HTTP status code and a JSON body with a human-readable error message and a stable, machine-readable code you can branch on:
{ "error": "Not authorized", "code": "unauthorized" }
| Status | code |
Meaning |
|---|---|---|
400 |
bad_request |
Missing or malformed parameters. |
401 |
unauthorized |
Missing or invalid API key. |
403 |
forbidden |
Your plan or permissions don't allow this action. |
404 |
not_found |
The resource doesn't exist, or your key can't access it. |
429 |
rate_limit_exceeded |
You've exceeded a rate or usage limit. |
500 |
internal_error |
Something went wrong on our side. |
Validation failures return 400 and may include field-level details (e.g. { "slug": ["is invalid"] }) in place of the envelope above.