API Documentation
Integrate our URL shortening service into your own applications with our simple and powerful API.
Quick Start
Get started quickly with this example request.
curl -X GET https://lnky.click/api/shorten -H "Authorization: Bearer YOUR_API_TOKEN"Authentication
Include your API token in the Authorization header.
Authorization Header
Include your API token in the Authorization header.
Authorization: Bearer YOUR_API_TOKENBase URL
All API requests should be made to this base URL.
https://lnky.click/apiEndpoints
List Short URLs
GET
/api/shortenRetrieve a paginated list of your short URLs.
curl -X GET https://lnky.click/api/shorten -H "Authorization: Bearer YOUR_API_TOKEN"Response Example
{
"data": [
{
"id": 1,
"short_url": "XXXXXX",
"long_url": "https://example.com",
"clicks": 42,
"max_clicks": null,
"expires_at": "2025-12-31 23:59:59",
"password_protected": false,
"created_at": "2024-01-15T10:30:00Z"
}
],
"meta": {
"total": 1,
"per_page": 50,
"current_page": 1
}
}Create a Short URL
POST
/api/shortenCreate a new short URL.
Parameters
required
longUrlThe URL to shortenoptional
passwordPassword protectionoptional
expires_atExpiration date (YYYY-MM-DD HH:MM:SS)optional
max_clicksMaximum number of clickscurl -X POST https://lnky.click/api/shorten -H "Authorization: Bearer YOUR_API_TOKEN" -H "Content-Type: application/json" -d '{
"longUrl": "https://example.com",
"expires_at": "2025-12-31 23:59:59",
"max_clicks": 100,
"password": "secret123"
}'Response Example
{
"data": {
"id": 2,
"short_url": "YYYYYY",
"long_url": "https://example.com",
"clicks": 0,
"max_clicks": 100,
"expires_at": "2025-12-31 23:59:59",
"password_protected": true,
"created_at": "2024-01-15T10:30:00Z",
"full_short_url": "https://lnky.click/YYYYYY"
}
}Update a Short URL
PATCH
/api/shorten/:short_urlUpdate an existing short URL.
curl -X PATCH https://lnky.click/api/shorten/XXXXXX -H "Authorization: Bearer YOUR_API_TOKEN" -H "Content-Type: application/json" -d '{
"longUrl": "https://example.com/updated",
"max_clicks": 200
}'Delete a Short URL
DELETE
/api/shorten/:short_urlPermanently delete a short URL.
curl -X DELETE https://lnky.click/api/shorten/XXXXXX -H "Authorization: Bearer YOUR_API_TOKEN"Error Codes
The API uses standard HTTP status codes to indicate the success or failure of a request.
Success Codes
200 - OK201 - Created204 - No ContentError Codes
400 - Bad Request401 - Unauthorized404 - Not Found422 - Validation Error429 - Rate LimitedRate Limits
1000
Requests per hour
100
URLs per minute
10000
Daily limit