Cliplink Logo
Loading...
Sections
  • Overview
  • Environments
  • Webhook Categories
  • Supported Events
  • Request Headers
  • Payload Format
  • Ingress API
Overview

Webhooks allow Cliplink to send real-time POST requests to your server when certain events occur. It’s a great way to keep your systems in sync.

You can configure Cliplink to notify your systems when a URL is created, updated, deleted, clicked, or scanned via QR code.

Once set up, Cliplink will send a POST request to your configured URL with event data when a webhook is triggered.


Environments

Cliplink supports two distinct webhook environments:

  • Test Environment: For development and testing (Only accessible through API requests)
  • Production Environment: For real traffic and production users

Each environment has its own webhook URLs and secret token. Events triggered in test mode only go to test URLs.


Webhook Categories

Cliplink webhooks are grouped into two main categories:

  • URL Lifecycle: Triggered on create, update, and delete actions
  • Analytics: Triggered when a short URL is clicked or a QR code is scanned

Each category can be configured independently with its own URL and toggle.


Supported Events
Event NameCategoryDescription
url.createdLifecycleA new short URL is created
url.updatedLifecycleA short URL is updated
url.deletedLifecycleA short URL is deleted
url.clickedAnalyticsA shortened URL is clicked
qr.scannedAnalyticsA QR code is scanned

Request Headers

Every webhook request sent by Cliplink contains:

  • Content-Type: application/json
  • X-Cliplink-Signature: The secret token provided in the Webhook config page

The signature is calculated using your secret token and the raw request body.


Payload Format
URL Lifecycle Event Example:
{
  "event": "url.updated",
  "timestamp": "2025-03-30T14:22:01Z",
  "data": {
    "id": "abc123",
    "originalUrl": "https://youtube.com/xyz",
    "domain": "cliplink.in",
    "title": "My Video Link",
    "shortUrl": "xyz321",
    "shortUrlFullPath": "https://cliplink.in/xyz321",
    "createdAt": "2025-03-25T12:00:00Z",
    "qrCodeData": {
      "enableQrCodeGen": true,
      "qrCodeColour": "#000000",
      "size": 300,
      "qrCodeConfig": {
        "shape": "square",
        "quietZone": 4
      }
    }
  }
}
Analytics Event Example:
{
  "event": "url.clicked",
  "timestamp": "2025-03-30T14:26:42Z",
  "data": {
    "shortUrl": "xyz321",
    "ip": "192.0.2.25",
    "geoData": {
      "city": "Chicago",
      "region": "Illinois",
      "country": "USA",
      "loc": "41.8781,-87.6298",
      "timezone": "America/Chicago"
    },
    "referer": "Twitter",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...",
    "userAgentData": {
      "browser": {
        "name": "Safari",
        "version": "15.2",
        "major": "15"
      },
      "cpu": {
        "architecture": "x86_64"
      },
      "device": {
        "type": "desktop"
      },
      "os": {
        "name": "macOS",
        "version": "10.15.7"
      }
    },
    "isQrCodeScanned": false
  }
}

Ingress API

Prefer a programmatic alternative to server-side webhooks? Use the Cliplink ingress API to create, update, or delete short links from your own backend. All requests must include your personal API key in the x-cliplink-signature header; only active, non-revoked keys can perform these operations.

Base URL : https://cliplink.in/api/ingress.

Common Requirements
  • Header: x-cliplink-signature: <your-api-key>
  • Header: X-Idempotency-Key: <unique-request-id>
  • Header: Content-Type: application/json
  • Responses are JSON with data or success payloads

Important

Reuse of an X-Idempotency-Key within five minutes returns the original response instead of performing the action again. Always generate a fresh, unique key for every mutation to avoid hidden retries or loops.

Create Short URL

Endpoint: POST /api/ingress/create

{
  "method": "POST",
  "headers": {
    "x-cliplink-signature": "YOUR_API_KEY",
    "X-Idempotency-Key": "create-pricing-landing",
    "Content-Type": "application/json"
  },
  "body": {
    "originalUrl": "https://example.com/pricing",
    "domain": "https://go.cliplink.in/",
    "title": "Pricing Landing",
    "shortUrl": "pricing-landing",
    "qrCodeData": {
      "enableQrCodeGen": true,
      "qrCodeColour": "#1A73E8",
      "size": 256
    }
  }
}

On success, the API returns 201 Created with the full URL mapping (including id, shortUrlFullPath, and ingress metadata).

Update Short URL

Endpoint: PATCH /api/ingress/update

{
  "method": "PATCH",
  "headers": {
    "x-cliplink-signature": "YOUR_API_KEY",
    "X-Idempotency-Key": "update-pricing-q3",
    "Content-Type": "application/json"
  },
  "body": {
    "id": "64f9f1a5c2d6e31234567890",
    "title": "Pricing Landing – Q3",
    "shortUrl": "pricing-q3",
    "domain": "https://go.cliplink.in/"
  }
}

If the short code already exists for the requested domain, the API responds with status 409.

Delete Short URL

Endpoint: DELETE /api/ingress/delete

{
  "method": "DELETE",
  "headers": {
    "x-cliplink-signature": "YOUR_API_KEY",
    "X-Idempotency-Key": "update-pricing-q3",
    "Content-Type": "application/json"
  },
  "body": {
    "id": "64f9f1a5c2d6e31234567890"
  }
}

Deletions are soft deletes; future lookups return 404 after removal. Successful deletions return { success: true }.

Tip: Rotate API keys regularly and store them in a secure secret manager. Revoked keys are blocked immediately.