API Documentation
Integrate Short into your applications with our RESTful API.
🔑 Authentication
All API requests require an API key. Generate one from your Dashboard → API Keys.
Header: X-Api-Key: sk_your_api_key_here
Or pass as query parameter: ?api_key=sk_your_api_key_here
🌐 Base URL
https://your-domain.com/api/v1
⚡ Shorten URL
POST
/api/v1/shorten
Create a new short link.
Request Body (JSON)
{
"url": "https://example.com/very-long-url", // required
"customAlias": "my-brand", // optional
"title": "My Campaign Link", // optional
"tags": "marketing, social", // optional
"expiresAt": "2025-12-31T23:59:59", // optional
"password": "secret123", // optional
"maxClicks": 1000 // optional
}
Response
{
"success": true,
"data": {
"id": 42,
"shortUrl": "https://short.link/AbCdEf",
"shortCode": "AbCdEf",
"originalUrl": "https://example.com/very-long-url",
"title": "My Campaign Link",
"createdAt": "2025-01-15T10:30:00Z"
}
}
📋 List Links
GET
/api/v1/links
Retrieve your links with pagination.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number (default: 1) |
| limit | integer | Items per page (default: 20, max: 100) |
| search | string | Search links by URL, code, or title |
📊 Link Analytics
GET
/api/v1/links/:id/stats
Get detailed analytics for a specific link.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| days | integer | Analytics window in days (default: 30) |
✏️ Update Link
PUT
/api/v1/links/:id
Request Body (JSON)
{
"title": "Updated Title",
"tags": "updated, tags",
"isActive": false,
"expiresAt": "2026-06-30"
}
🗑️ Delete Link
DELETE
/api/v1/links/:id
Permanently delete a link. This action cannot be undone.
🚦 Rate Limits
| Plan | API Access | Requests/Min |
|---|---|---|
| Free | No | - |
| Starter | No | - |
| Pro | Yes | 60 |
| Enterprise | Yes | Unlimited |
❌ Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 403 | Forbidden — plan doesn't include API access |
| 404 | Not found — link doesn't exist or belongs to another user |
| 500 | Server error — contact support |