URLNIX API: Shorten Links and Track Clicks Programmatically

The URLNIX REST API lets you create short links, retrieve click analytics, and manage campaigns from your own apps, scripts, or automation workflows. Authentication uses a simple API key — no OAuth flow required.

Getting Started

Step 1: Generate an API Key

  1. In your Dashboard, go to Developer → API Keys
  2. Click Generate New Key
  3. Give the key a descriptive name (e.g., "Zapier Integration" or "Internal Dashboard")
  4. Select the scopes: Read Links, Write Links, Read Analytics, Manage Campaigns
  5. Click Generate and copy the key immediately — it is only shown once

Step 2: Authenticate Requests

Include your API key in the Authorization header of every request:

Authorization: Bearer YOUR_API_KEY

Core Endpoints

Create a Short Link

POST https://urlnix.live/api/links
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "url": "https://destination.com/page",
  "alias": "my-alias",
  "password": "secretpass",
  "expiresAt": "2026-12-31",
  "maxClicks": 500,
  "campaign": "campaign-id"
}

Response includes the short link URL, short code, and full link object.

List All Links

GET https://urlnix.live/api/links?page=1&limit=50
Authorization: Bearer YOUR_API_KEY

Get Analytics for a Link

GET https://urlnix.live/api/links/{shortCode}/analytics?range=30d
Authorization: Bearer YOUR_API_KEY

Returns click counts, referrer breakdown, device breakdown, country breakdown, and a time-series of clicks.

Update a Link

PATCH https://urlnix.live/api/links/{shortCode}
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "url": "https://new-destination.com",
  "alias": "new-alias"
}

Delete a Link

DELETE https://urlnix.live/api/links/{shortCode}
Authorization: Bearer YOUR_API_KEY

Rate Limits

Pro accounts can make up to 1,000 requests per minute. If you exceed this, the API returns:

HTTP 429 Too Many Requests
Retry-After: 15

The Retry-After header tells you how many seconds to wait before retrying. Implement exponential backoff in your code for robust handling.

Webhooks (Coming Soon)

Webhooks will allow you to receive a real-time HTTP POST to your endpoint whenever a link is clicked, created, or updated — eliminating the need to poll the analytics endpoint. Webhook support is on the URLNIX roadmap for the next release.

API Key Security

  • Store API keys in environment variables, never in source code
  • Use the narrowest scope that your integration needs
  • Rotate keys regularly — you can generate multiple keys for different integrations
  • Revoke keys immediately from the dashboard if they are compromised