Skip to content
FTLink
Pricing API Log in

FTLink API

Create short links and track their clicks from your own website, app or CRM. Simple REST endpoints with JSON responses.

Get API access Business login

Getting started Authentication Limits Create a link List links Get a link Change a link Click stats Webhooks Errors Code examples

Getting started

  1. Sign up. Create a business account and confirm your email. We review new accounts, usually within one business day, and email you when yours is approved.
  2. Create an API key in your business dashboard. You can have up to 5 keys, for example one per app, and revoke them any time.
  3. Send requests to the base URL below with your key in the Authorization header.
Base URL
https://ftlink.us/api/v1

Requests can send JSON (Content-Type: application/json) or regular form data. All responses are JSON. All times are in UTC.

Authentication

Send your key as a Bearer token on every request:

Authorization: Bearer ftl_your_api_key

The X-API-Key: ftl_your_api_key header also works. Keys in the URL are not accepted, because URLs end up in logs.

Keep your key secret. Only call the API from your server, never from a browser or mobile app where users can see the key. Your keys can only see your own account's links. In your dashboard you can limit each key to your servers' IP addresses and to read-only or create-only use. If a key leaks, revoke it and create a new one.

Limits

Each account has two limits, shared by all its keys (default values shown; your dashboard shows yours, and you can ask us for more):

  • 60 requests per minute. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the limit resets). When you go over, you get 429 with a Retry-After header.
  • 1,000 new links per day. Resets at 00:00 UTC. Reading links and stats doesn't count towards this.

POST /links

Create a short link.

FieldRequiredDescription
urlYesThe long URL, starting with http:// or https://.
aliasNoCustom ending, e.g. summer-sale gives ftlink.us/summer-sale. Letters, numbers and hyphens, up to 50 characters. Without it you get a random code.
titleNoA label for your own reference. If left out, we read the page title.
utmNoCampaign tags added to the long URL: an object with any of source, medium, campaign, term, content. They replace the same utm_* parameters if the URL already has them.
expires_atNoWhen the link stops working, in ISO 8601, e.g. 2026-12-31T23:59:00+05:30 (UTC if no offset). Visitors then see a "link no longer available" page.
max_clicksNoThe link stops working after this many clicks.
passwordNoVisitors must enter this password (4–72 characters) to open the link. The destination is never shown before that.
domainNoOne of your custom domains, e.g. go.yourbrand.com. The short link then uses it.
Request
curl -X POST https://ftlink.us/api/v1/links \
  -H "Authorization: Bearer ftl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/products/summer", "alias": "summer-sale", "utm": {"source": "newsletter"}}'
Response 201 Created
{
    "data": {
        "keyword": "summer-sale",
        "short_url": "https://ftlink.us/summer-sale",
        "long_url": "https://example.com/products/summer?utm_source=newsletter",
        "title": "Summer collection",
        "clicks": 0,
        "status": "active",
        "disabled": false,
        "domain": null,
        "expires_at": null,
        "max_clicks": null,
        "password_protected": false,
        "created_at": "2026-09-24T10:30:00Z",
        "existing": false
    }
}

Sending the same url again (without a different alias) returns your existing link with status 200 and "existing": true, so retries are safe; a request with an expiry, click limit, password or domain always makes a new link. Your links are separate from anyone else's, so your click counts only include your own traffic.

status is active, expired, limit_reached or disabled (disabled links broke our Terms). Expiry dates, click limits and passwords are part of the Pro and Business plans; custom domains need a plan that includes them.

GET /links

List the links created with your key, newest first. Query parameters: page (default 1) and per_page (default 25, max 100).

Request
curl "https://ftlink.us/api/v1/links?page=1&per_page=25" \
  -H "Authorization: Bearer ftl_your_api_key"
Response 200
{
    "data": [ { "keyword": "summer-sale", "short_url": "https://ftlink.us/summer-sale", "clicks": 152, ... } ],
    "meta": { "page": 1, "per_page": 25, "total": 42, "total_pages": 2 }
}

GET /links/{keyword}

Get one link and its total clicks. disabled is true if the link was disabled for breaking our Terms.

Request
curl https://ftlink.us/api/v1/links/summer-sale \
  -H "Authorization: Bearer ftl_your_api_key"

PATCH /links/{keyword}

Change a link. Send only the fields you want to change: url, title, utm, expires_at, max_clicks, password or domain. Send null to remove an expiry, click limit or password, and "" as domain to use ftlink.us. The short link stays the same. Needs a key with full access.

Request
curl -X PATCH https://ftlink.us/api/v1/links/summer-sale \
  -H "Authorization: Bearer ftl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/products/winter", "max_clicks": null}'

The response is the updated link, like GET /links/{keyword}. Short links redirect with HTTP 302, so browsers never remember an old destination.

GET /links/{keyword}/clicks

Click statistics for a date range: clicks per day, top countries and top referring websites. Query parameters: from and to as YYYY-MM-DD (UTC). The default is the last 30 days, and the maximum range is 366 days.

Request
curl "https://ftlink.us/api/v1/links/summer-sale/clicks?from=2026-09-01&to=2026-09-03" \
  -H "Authorization: Bearer ftl_your_api_key"
Response 200
{
    "data": {
        "keyword": "summer-sale",
        "short_url": "https://ftlink.us/summer-sale",
        "total_clicks": 152,
        "from": "2026-09-01",
        "to": "2026-09-03",
        "range_clicks": 57,
        "daily": [
            {
                "date": "2026-09-01",
                "clicks": 12
            },
            {
                "date": "2026-09-02",
                "clicks": 30
            },
            {
                "date": "2026-09-03",
                "clicks": 15
            }
        ],
        "top_countries": [
            {
                "country": "IN",
                "clicks": 41
            },
            {
                "country": "US",
                "clicks": 9
            }
        ],
        "top_referrers": [
            {
                "referrer": "direct",
                "clicks": 30
            },
            {
                "referrer": "facebook.com",
                "clicks": 18
            }
        ]
    }
}

The response also has unique_visitors (approximate), previous_range_clicks (the same number of days just before, for comparison), qr_scans (opens from QR codes made in the dashboard), devices, browsers and operating_systems (each a ranked list like the countries), and hours_ist (24 numbers: clicks per hour of the day, India time).

total_clicks is all-time; range_clicks covers only the dates requested. Countries are two-letter ISO codes. Referrers show only the website's domain; direct means no referring page (for example apps, email or typed links).

Webhooks

On the Business plan, we can call your server when something happens to your links. Add up to 3 endpoints (HTTPS) in your dashboard and choose the events:

EventWhendata
link.createdA link is created on the website, by bulk import or with the APIThe link, like GET /links/{keyword}
link.updatedA link's destination or settings changeThe link after the change
link.clickedSomeone opens a link (link previews and bots are not counted)keyword, short_url, long_url, clicked_at, country, referrer (domain only), total_clicks
pingYou press "Send test event"A test message
POST to your endpoint
{
    "id": "evt_5f2c9a1e8b7d43a6c0e1f2a3",
    "type": "link.clicked",
    "created_at": "2026-09-24T10:31:07Z",
    "data": {
        "keyword": "summer-sale",
        "short_url": "https://ftlink.us/summer-sale",
        "long_url": "https://example.com/products/summer",
        "clicked_at": "2026-09-24T10:31:07Z",
        "country": "IN",
        "referrer": "facebook.com",
        "total_clicks": 153
    }
}

Each request has the headers FTLink-Event, FTLink-Delivery (a unique ID; use it to ignore repeats) and FTLink-Signature: t=<unix time>,v1=<signature>. The signature is the hex HMAC-SHA256 of <t>.<raw request body> with your webhook's signing secret. Check it, and reject requests whose t is more than 5 minutes old.

Check the signature (PHP)
<?php
$secret  = getenv('FTLINK_WEBHOOK_SECRET');
$body    = file_get_contents('php://input');
preg_match('/t=(\d+),v1=([0-9a-f]{64})/', $_SERVER['HTTP_FTLINK_SIGNATURE'] ?? '', $m);
$valid   = $m && abs(time() - (int) $m[1]) < 300
    && hash_equals(hash_hmac('sha256', $m[1] . '.' . $body, $secret), $m[2]);
if (!$valid) { http_response_code(400); exit; }
$event = json_decode($body, true);
// ... handle $event['type'] and $event['data'], then answer quickly:
http_response_code(204);
Check the signature (Node.js)
const crypto = require('crypto');
// Express: app.post('/hooks/ftlink', express.raw({ type: 'application/json' }), handler)
function handler(req, res) {
  const [, t, sig] = /t=(\d+),v1=([0-9a-f]{64})/.exec(req.get('FTLink-Signature') || '') || [];
  const expected = t && crypto.createHmac('sha256', process.env.FTLINK_WEBHOOK_SECRET)
    .update(t + '.' + req.body).digest('hex');
  if (!expected || Math.abs(Date.now() / 1000 - t) > 300 ||
      !crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig))) return res.sendStatus(400);
  const event = JSON.parse(req.body);
  res.sendStatus(204);
}

Answer with any 2xx status within 8 seconds; do slow work afterwards. Failed deliveries are retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours. A webhook that fails 100 times in a row is turned off, and we email you. Deliveries usually arrive within a minute; their order is not guaranteed. Visitors' IP addresses are never sent.

Errors

Errors return a matching HTTP status and a JSON body:

{
    "error": { "code": "alias_taken", "message": "That alias is already taken or reserved." }
}
StatusCodeMeaning
400invalid_url, invalid_alias, invalid_option, invalid_date, invalid_range, nothing_to_updateSomething in your request isn't valid. The message says what.
400url_blockedThe destination is not allowed: flagged as phishing or malware, another URL shortener, an IP address, or a blocked website.
401missing_api_key, invalid_api_keyNo key was sent, or it's wrong.
403api_key_revoked, account_inactive, plan_required, api_not_approved, ip_not_allowed, scope_deniedThe key was revoked (create a new one in your dashboard), or your account is suspended. Contact us.
404link_not_found, not_foundThe link doesn't exist or wasn't created by your account, or the endpoint is wrong.
405method_not_allowedWrong HTTP method; see the Allow header.
409alias_taken, link_disabledSomeone already uses that alias, or the link was disabled for breaking our Terms and can't be changed.
429rate_limited, daily_quota_exceeded, monthly_quota_exceededSlow down (see Retry-After) or wait for the daily reset.
500server_errorSomething went wrong on our side. Try again shortly.

Code examples

PHP
<?php
$ch = curl_init('https://ftlink.us/api/v1/links');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('FTLINK_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode(['url' => 'https://example.com/products/summer']),
]);
$result = json_decode(curl_exec($ch), true);
echo $result['data']['short_url'] ?? $result['error']['message'];
Node.js
const res = await fetch('https://ftlink.us/api/v1/links', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.FTLINK_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ url: 'https://example.com/products/summer' }),
});
const body = await res.json();
console.log(res.ok ? body.data.short_url : body.error.message);
Python
import os, requests

res = requests.post(
    "https://ftlink.us/api/v1/links",
    headers={"Authorization": f"Bearer {os.environ['FTLINK_API_KEY']}"},
    json={"url": "https://example.com/products/summer"},
    timeout=10,
)
body = res.json()
print(body["data"]["short_url"] if res.ok else body["error"]["message"])

Fair use

Links created with the API follow the same Terms of Service as every other link. Links used for spam, phishing or malware are disabled, and repeated abuse gets the API key revoked. See our Privacy Policy for what click data we record.

© 2026 FTLink · ftlink.us

URL shortener Click counter Pricing API Business login Report abuse Terms Privacy Refunds Contact Status