API Reference
The Klinky API enables programmatic management of A/B testing links. Create smart links, retrieve analytics data, and integrate link management into your applications.
Base URL
https://klinky-api.fly.dev/api/v1Authentication
All API requests require an API key passed in the X-API-Key header:
curl 'https://klinky-api.fly.dev/api/v1/public/links' \
-H 'X-API-Key: klinky_live_your_api_key_here'Getting an API Key
- Log in to your dashboard
- Go to Settings → API Keys
- Click "Create New Key"
- Copy the key immediately (it's only shown once)
Store Securely
API keys are shown only once when created. Store them securely in environment variables or secrets management systems. Never commit API keys to version control.
Rate Limits
API access is available on Growth and Scale plans:
| Plan | Rate Limit |
|---|---|
| Growth | 100 requests/hour |
| Scale | 1,000 requests/hour |
Rate limit headers are included in all responses:
X-RateLimit-Limit: Maximum requests per hourX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: Unix timestamp when the limit resets
OpenAPI Specification
View and download the complete OpenAPI 3.1 specification: openapi.json
The spec includes detailed schema definitions for all endpoints, request/response formats, and authentication requirements.
Client Libraries
Official client libraries are coming soon. For now, use the REST API directly with standard HTTP clients.
Example: Python
import requests
API_KEY = 'your-api-key'
BASE_URL = 'https://klinky-api.fly.dev/api/v1'
# Create a link
response = requests.post(
f'{BASE_URL}/public/links',
headers={'X-API-Key': API_KEY},
json={
'name': 'Homepage Test',
'slug': 'homepage-test',
'variants': [
{'label': 'control', 'destination_url': 'https://a.com', 'weight': 50},
{'label': 'variant_b', 'destination_url': 'https://b.com', 'weight': 50}
]
}
)
link = response.json()
print(f"Created: klinky.io/{link['slug']}")Example: JavaScript/TypeScript
const API_KEY = 'your-api-key';
const BASE_URL = 'https://klinky-api.fly.dev/api/v1';
// List links
const response = await fetch(`${BASE_URL}/public/links`, {
headers: { 'X-API-Key': API_KEY }
});
const data = await response.json();
console.log(`Total links: ${data.total}`);Webhooks
Webhook support is coming soon. Subscribe to events like link created, conversion tracked, and winner declared.
Support
Need help with the API?
- Email: support@klinky.io
- Status: status.klinky.io
- OpenAPI spec: Download