This guide explains how to connect your applications to our link shortening service.
Before you can use our service, you'll need to get a special access key (we call it a "token"). Think of it like a password that lets your app talk to our service.
Send your email and password to this address: POST /api/auth
{
"email": "you@example.com",
"password": "your_password"
}
curl -X POST https://clikin.to/api/auth \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "your_password"}'
We'll send you your access key and some basic information about your account:
{
"success": true,
"token": "your.access.key",
"user": {
"id": "your_id",
"email": "you@example.com",
"username": "your_name"
}
}
For all subsequent API requests, include your token in the Authorization header as a Bearer token:
Authorization: Bearer your.access.key
Want to see all the organizations you're part of? Just ask: GET /api/orgs
curl https://clikin.to/api/orgs \
-H "Authorization: Bearer your.access.key"
We'll show you something like this:
{
"success": true,
"organizations": [
{
"id": "org_123",
"name": "My Family Links",
"is_owner": true,
"member_count": 5
}
]
}
Need to see all the links in your organization? Just ask: GET /api/orgs/{your_org_id}/links
curl https://clikin.to/api/orgs/org_123/links \
-H "Authorization: Bearer your.access.key"
We'll show you all your links, including:
Want to make a new short link? Here's how: POST /api/orgs/{your_org_id}/links
{
"destination_url": "https://www.your-long-link.com",
"fallback_url": "https://www.backup-link.com", // optional: users are redirected here if link is disabled/expired/maxed out
"expires_in": 30, // optional: how many days until it expires
"max_clicks": 100, // optional: maximum times it can be used
"tags": ["marketing", "summer-campaign"], // optional: array of tag strings
"password": "secret123" // optional: require a password to access the link
}
Note: The fallback URL is where users will be redirected if the link becomes disabled, expires, or reaches its maximum click limit. If no fallback URL is provided, users will see a 404 error page in these cases. When a password is set, users will need to enter it before accessing the destination URL.
curl -X POST https://clikin.to/api/orgs/org_123/links \
-H "Authorization: Bearer your.access.key" \
-H "Content-Type: application/json" \
-d '{
"destination_url": "https://www.your-long-link.com",
"expires_in": 30,
"max_clicks": 100,
"tags": ["marketing", "summer-campaign"],
"password": "secret123"
}'
Want to know how many people are using your link? Ask for stats: GET /api/orgs/{your_org_id}/links/{link_id}/stats
curl https://clikin.to/api/orgs/org_123/links/link_456/stats \
-H "Authorization: Bearer your.access.key"
We'll tell you:
Need to pause a link temporarily? You can toggle it on/off: POST /api/orgs/{your_org_id}/links/{link_id}/toggle
curl -X POST https://clikin.to/api/orgs/org_123/links/link_456/toggle \
-H "Authorization: Bearer your.access.key"
It's like a light switch - just flip it on or off whenever you need!
If there's a problem, we'll let you know what happened and how to fix it:
{
"success": false,
"message": "Here's what went wrong..."
}
400
- You forgot to include some information we need401
- Your access key is missing or doesn't work anymore403
- You're not allowed to see this information404
- We couldn't find what you were looking for