Skip to content
API & Integrations

API Integration Guide

5 min read
Updated Nov 13, 2026

The LNK7 REST API lets your own code create, update and delete short links and read their analytics. It is free on every account, like everything else.

Getting Your API Token

  1. 1 Open Settings and click "Manage tokens" under API tokens
  2. 2 Name the token, choose its abilities (read, write, delete, and for LNK7 Forms forms:read and responses:read) and when it should expire
  3. 3 Confirm your password if asked - or sign in with Google again if that is how you sign in
  4. 4 Copy the token immediately: it is shown once and never again
  5. 5 Keep it out of version control, and delete it and make a new one if it is ever exposed

Authentication

Send the token as a bearer token on every request. Your email address must be verified before the API will answer:

Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json
Accept: application/json

A token belongs to the workspace you were in when you created it: your personal workspace, unless you made it inside a team. Switching workspace in your browser does not change which workspace a token uses, and a team's token stops working if you leave or are removed from that team.

Creating a Link

POST a destination URL. Only destination_url is required; leave custom_slug out and one is generated for you. expires_at, click_limit, password and is_active work exactly like Expires at, Click limit, Password and Link is active on the dashboard form:

POST /api/v1/links

{
  "destination_url": "https://example.com/long-url",
  "custom_slug": "spring-sale",
  "title": "Spring sale",
  "expires_at": "2026-12-31T23:59:59Z",
  "click_limit": 500,
  "password": null,
  "is_active": true
}

click_limit is optional: a whole number of 1 or more. Once the link has had that many clicks it stops redirecting and its status reads expired. On an update, send null to remove the limit, or leave the field out to keep it as it is.

password is optional: at least four characters, as on the dashboard form - a shorter one is refused with a 422. On an update, send null to remove the password, or leave the field out to keep it as it is.

expires_at is an ISO 8601 date-time. Include an offset (Z, +02:00, -05:00) and the link expires at exactly that moment; without one the time is read as UTC. It always comes back in UTC.

What Comes Back

Every response is wrapped in success, message and data. Passwords are never returned - check has_password instead:

{
  "success": true,
  "message": "Short link created successfully",
  "data": {
    "id": "9b1c...-uuid",
    "short_url": "https://lnk7.io/spring-sale",
    "destination_url": "https://example.com/long-url",
    "custom_slug": "spring-sale",
    "title": "Spring sale",
    "is_active": true,
    "status": "active",
    "has_password": false,
    "expires_at": "2026-12-31T23:59:59+00:00",
    "click_limit": 500,
    "visits_count": 0,
    "created_at": "2026-09-23T10:15:00+00:00",
    "updated_at": "2026-09-23T10:15:00+00:00"
  }
}

Reading Analytics

For one link, use ?days= (1 to 90, default 30) to set the window:

GET /api/v1/links/{id}/analytics?days=7

The account-wide overview takes the same ?days= (1 to 90); without ?days= it covers the last 90 days. Its data.window says exactly which days were counted, and in which time zone:

GET /api/v1/analytics/overview?days=30

Endpoints

  • POST /api/v1/links - create a link (returns 201)
  • GET /api/v1/links - list links (?search=, ?status=active or inactive, ?sort_by=, ?sort_order=, ?per_page= up to 100)
  • GET /api/v1/links/{id} - one link
  • PUT or PATCH /api/v1/links/{id} - update a link (every field optional)
  • DELETE /api/v1/links/{id} - delete a link (returns 204)
  • GET /api/v1/links/{id}/analytics - analytics for one link
  • GET /api/v1/analytics/overview - analytics across your account
  • POST /api/v1/links/bulk - activate, deactivate or delete up to 100 existing links in one request (it does not create links)
  • GET /api/v1/forms - list your workspace's forms (needs forms:read)
  • GET /api/v1/forms/{id} - one form with its published questions (needs forms:read)
  • GET /api/v1/forms/{id}/responses - a form's responses, newest first (?since=, ?status=complete or waitlisted; needs responses:read, and only for forms whose responses you can see)
  • GET /api/v1/forms/{id}/responses/{responseId} - one response (needs responses:read)
  • GET /api/v1/forms/{id}/leads - a form's lead records (needs responses:read)
  • GET /api/v1 - the live reference for all of the above

The Forms abilities are opt-in: tick them when you create a token. A token made without them never gains them, so make a new one.

Errors You Should Handle

  • 401 - the token is missing, revoked, expired or wrong, or belongs to a team you are no longer in
  • 403 - the token lacks the ability the request needs, or your email is not verified
  • 404 - the link does not exist, or is not yours
  • 409 - your account has no active workspace yet
  • 422 - validation failed; the errors object names each field
  • 429 - rate limited; wait for the Retry-After header

Rate Limits

  • 60 requests per minute, per account - all of your tokens share the allowance
  • Every response carries X-RateLimit-Limit and X-RateLimit-Remaining headers
  • A 429 response adds Retry-After: wait that many seconds before trying again
  • Creating links is one request per link, so pace large imports to stay inside the limit
  • To activate, deactivate or delete many links, use POST /api/v1/links/bulk instead of one call per link

Pro Tip

GET https://app.lnk7.io/api/v1 returns the live reference - endpoints, request fields, query parameters and status codes - straight from the running app, so it is never out of date.

Was this article helpful?

Still need help?

Our support team is here to assist you.

Published by , built by Digital Brainwave. Last updated .