Public Beta

Build with BlinkURLs

Integrate blazing fast link shortening, tracking, and analytics directly into your own applications with our REST API.

Authentication

All API requests require authentication using a Bearer token. You can generate an API key from your account settings.

Include the key in the Authorization header of your HTTP requests. Keep your keys secure and do not expose them in client-side code.

cURL Example
curl -X GET "https://blinkurls.com/api/v1/links" \
  -H "Authorization: Bearer blk_your_api_key_here" \
  -H "Content-Type: application/json"

Endpoints

POST

/api/v1/links

Create a new short link programmatically.

Request Payload
{
  "originalUrl": "https://example.com/very/long/path",
  "shortCode": "myBrand", // Optional
  "domainId": "cuid_here", // Optional
  "tags": ["social", "promo"], // Optional
  "campaignId": 3, // Optional - assign to a campaign
  "expiresAt": "2026-12-31T00:00:00Z" // Optional
}
JSON Response
{
  "data": {
    "id": 1042,
    "shortCode": "myBrand",
    "originalUrl": "https://example.com...",
    "createdAt": "2024-03-20T12:00:00Z"
  }
}
GET

/api/v1/links

List your active short links with pagination.

Request Payload
// Query Params
?page=1&limit=50
JSON Response
{
  "data": [
    {
      "id": 1042,
      "shortCode": "myBrand",
      "originalUrl": "https://example.com...",
      "clicksCount": 142
    }
  ],
  "meta": {
    "total": 45,
    "page": 1,
    "limit": 50,
    "totalPages": 1
  }
}
GET

/api/v1/links/:id/stats

Retrieve comprehensive click analytics for a specific link.

JSON Response
{
  "data": {
    "totalClicks": 1450,
    "recentClicks": [
      {
        "createdAt": "2024-03-20T12:05:00Z",
        "country": "US",
        "device": "Mobile",
        "browser": "Safari",
        "referer": "twitter.com"
      }
    ]
  }
}

Webhooks

Webhooks allow you to build real-time integrations that react to events on your BlinkURLs account. When an event occurs, we'll send a POST request with a JSON payload to your configured URL.

Event Types

  • link.createdEnterprise
    Fires immediately when a new short link is created via account or API.
  • link.updatedMarketer
    Fires when a link's destination, alias, or settings are modified.
  • link.deletedMarketer
    Alerts when a short link is permanently removed.
  • click.createdEnterprise
    Real-time data stream for every individual click (Visitor IP, OS, etc).
  • referral.createdPartner
    Notifies a partner when their referral link leads to a new registration.

Payload Example

{
  "event": "click.created",
  "timestamp": "2024-03-20T12:05:00Z",
  "data": {
    "shortCode": "myBrand",
    "country": "US",
    "browser": "Chrome",
    "os": "iOS",
    "utm": {
      "source": "twitter",
      "medium": "social"
    }
  }
}

Tip: Use the "Test Webhook" button in your Settings to see the exact format for each event.

Rate Limits

Pro users enjoy up to 1,000 API requests per minute. If you exceed this limit, you will receive a 429 Too Many Requests response. Need enterprise volume? Contact us.