Create and manage short links programmatically using the LinkShor REST API.
All API requests require a Bearer token in the Authorization header.
Generate your token in Dashboard → General Settings → API.
Base URL: https://linkshor.com/api
Create a new shortened link.
Endpoint
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
organization_key |
string | Yes | Your organization secret key |
url_group_id |
string | Yes | URL group API ID |
url |
string | Yes | Long URL to shorten (must start with http/https) |
alias |
string | No | Custom alias (auto-generated if empty) |
redirect_type |
integer | No | 301, 302, 303, 307, or 308 (default: 301) |
cURL Example
JavaScript Example
● 200 — Success
● Error Responses
| Status | Code | Meaning |
|---|---|---|
| 401 | 3, 10, 11 | Invalid or missing API token |
| 401 | 12, 13, 17 | Invalid organization key or inactive org |
| 405 | 2 | Method not allowed (use POST) |
| 422 | 4 | Organization key missing |
| 422 | 5 | URL group ID missing |
| 422 | 6, 7 | URL missing or invalid |
| 422 | 8, 9 | Alias format invalid or too long |
| 422 | 14 | URL group not found |
| 422 | 15 | Alias already taken |
| 422 | 18 | URL blocked by anti-phishing check |
| 429 | — | Rate limit exceeded (60 requests/minute) |
The API is rate-limited to 60 requests per minute per token. If you exceed this limit, you'll receive a 429 Too Many Requests response.
Need help? Contact us