Getting Started v1

Rate Limits & Error Handling

Understand API rate limits, HTTP status codes, and exponential backoff retry strategies.

Updated Yesterday 1 min read Verified
SDK & Request Quickstart Select your language
curl -X POST https://klic.in/api/v1/links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "destination": "https://mybrand.com/launch-promo",
    "customSlug": "launch2026"
  }'
// npm install node-fetch (or native fetch in Node 18+)
const response = await fetch('https://klic.in/api/v1/links', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    destination: 'https://mybrand.com/launch-promo',
    customSlug: 'launch2026'
  })
});

const data = await response.json();
console.log('Short Link:', data.data.shortUrl);
# pip install requests
import requests

url = "https://klic.in/api/v1/links"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "destination": "https://mybrand.com/launch-promo",
    "customSlug": "launch2026"
}

response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Short Link: {data['data']['shortUrl']}")
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");

var payload = new {
    destination = "https://mybrand.com/launch-promo",
    customSlug = "launch2026"
};

var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://klic.in/api/v1/links", content);
var result = await response.Content.ReadAsStringAsync();

Console.WriteLine(result);
<?php
$curl = curl_init();

$payload = [
    'destination' => 'https://mybrand.com/launch-promo',
    'customSlug'  => 'launch2026'
];

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://klic.in/api/v1/links',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode($payload),
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_API_KEY',
        'Content-Type: application/json'
    ],
]);

$response = curl_exec($curl);
curl_close($curl);

$data = json_decode($response, true);
echo 'Short Link: ' . $data['data']['shortUrl'];
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	payload := map[string]string{
		"destination": "https://mybrand.com/launch-promo",
		"customSlug":  "launch2026",
	}
	jsonData, _ := json.Marshal(payload)

	req, _ := http.NewRequest("POST", "https://klic.in/api/v1/links", bytes.NewBuffer(jsonData))
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
200 OK 18ms application/json
{
  "status": "success",
  "data": {
    "id": "link_9a482b1c",
    "shortUrl": "https://klic.in/launch2026",
    "destination": "https://mybrand.com/launch-promo",
    "domain": "klic.in",
    "clicks": 0,
    "createdAt": "2026-08-20T13:36:12.842Z"
  }
}

Rate Limits & Error Handling

KLIC uses token-bucket rate limiting to maintain service stability.

Rate Limits by Tier

  • Free Tier: 60 requests per minute
  • Pro Tier: 600 requests per minute
  • Enterprise: Custom dedicated quota

HTTP Status Codes

CodeStatusDescription
200OKRequest succeeded.
201CreatedResource successfully created.
400Bad RequestInvalid JSON payload or missing parameters.
401UnauthorizedMissing or invalid API key.
429Too Many RequestsRate limit exceeded. Check Retry-After header.