Lnky.click Logo

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_TOKEN

Base URL

All API requests should be made to this base URL.

https://lnky.click/api

Endpoints

List Short URLs
GET/api/shorten

Retrieve 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/shorten

Create a new short URL.

Parameters

requiredlongUrlThe URL to shorten
optionalpasswordPassword protection
optionalexpires_atExpiration date (YYYY-MM-DD HH:MM:SS)
optionalmax_clicksMaximum number of clicks
curl -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_url

Update 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_url

Permanently 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 - OK
201 - Created
204 - No Content
Error Codes
400 - Bad Request
401 - Unauthorized
404 - Not Found
422 - Validation Error
429 - Rate Limited

Rate Limits

1000
Requests per hour
100
URLs per minute
10000
Daily limit