API Reference
Programmatic access to create and manage links
Access qklnk programmatically using our REST API. Create links, retrieve analytics, and manage your account.
Authentication
All API requests require authentication using a Bearer token. Generate an API token from your API Tokens page.
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
https://qklnk.cc/api/v1/...
Token Permissions
When creating an API token, you can select which permissions to grant:
| Permission | Description |
|---|---|
read | List and view links and analytics |
create | Create new links and record events |
update | Update existing links |
delete | Delete links |
Requests made without the required permission will receive a 403 Forbidden response.
Base URL
https://qklnk.cc/api/v1
Endpoints
Get Current User
GET /api/v1/user
Returns information about the authenticated user.
Create Link
POST /api/v1/links
Create a new quick link. Requires create permission.
{
"destination": "https://example.com/page",
"utm_source": "api",
"utm_medium": "email",
"utm_campaign": "winter-sale",
"utm_content": "body_button",
"utm_term": "deal",
"domain": "example.com"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| destination | string | Yes | Target URL to redirect to |
| utm_source | string | No | UTM source parameter |
| utm_medium | string | No | UTM medium parameter |
| utm_campaign | string | No | UTM campaign parameter |
| utm_content | string | No | UTM content parameter |
| utm_term | string | No | UTM term parameter |
| domain | string | No | Custom domain (e.g. "example.com"). Uses team default if not specified |
{
"data": {
"id": 123,
"slug": "abc123",
"short_url": "https://qklnk.cc/abc123",
"destination": "https://example.com/page",
"clicks": 0,
"created_at": "2024-01-15T10:30:00Z"
}
}
List Links
GET /api/v1/links
Retrieve a paginated list of all quick links for the current team. Requires read permission.
{
"data": [...],
"meta": {
"current_page": 1,
"total": 50
}
}
Get Link
GET /api/v1/links/{slug}
Retrieve a single quick link with statistics. Requires read permission.
{
"data": {
"id": 123,
"slug": "abc123",
"destination": "https://example.com/page",
"clicks": 150,
"unique_visitors": 89
}
}
Update Link
PUT /api/v1/links/{slug}
Update an existing quick link. Requires update permission.
{
"destination": "https://example.com/new-page",
"utm_source": "api",
"utm_medium": "email",
"utm_campaign": "updated-campaign",
"utm_content": "footer_link",
"utm_term": "promo"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| destination | string | Yes | Target URL to redirect to |
| utm_source | string | No | UTM source parameter |
| utm_medium | string | No | UTM medium parameter |
| utm_campaign | string | No | UTM campaign parameter |
| utm_content | string | No | UTM content parameter |
| utm_term | string | No | UTM term parameter |
{
"data": {
"id": 123,
"slug": "abc123",
"destination": "https://example.com/new-page",
"utm_source": "api",
"utm_medium": "email",
"utm_campaign": "updated-campaign",
"utm_content": "footer_link",
"utm_term": "promo",
...
}
}
Get Analytics
GET /api/v1/analytics?days=7
Retrieve analytics summary for the current team.
Query Parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
| days | integer | 7 | Number of days to include in analytics |
{
"data": {
"total_clicks": 1500,
"unique_visitors": 890,
"conversions": 120,
"revenue": 2999.99,
"top_links": [
{
"id": 123,
"slug": "abc123",
"destination": "https://example.com/page",
"clicks": 450
}
]
}
}
Record Event
POST /api/v1/events/record
Record an event for conversion tracking.
Request Body:{
"visitor_id": "v_abc123xyz",
"event_name": "purchase",
"revenue": 99.99,
"name": "Premium Package",
"metadata": {
"product_id": "SKU-12345"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| visitor_id | string | Yes | Unique visitor identifier |
| event_name | string | Yes | Type of conversion event |
| revenue | number | No | Monetary value |
| name | string | No | Display name for the event (max 255 chars) |
| metadata | object | No | Additional data |
Response Format
All responses are in JSON format:
Success Response:{
"data": {
"id": 123,
"visitor_id": "v_abc123xyz",
"event_name": "purchase",
"revenue": 99.99,
"occurred_at": "2024-01-15T10:30:00Z",
"is_conversion": true
}
}
{
"message": "Validation failed",
"errors": {
"visitor_id": ["The visitor_id field is required."]
}
}
Rate Limiting
API requests are rate limited to 60 requests per minute. The following headers are included in responses:
X-RateLimit-Limit- Maximum requests per minuteX-RateLimit-Remaining- Remaining requests this minute
Getting Help
If you need additional API endpoints or have questions, please contact support.