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 -X GET "https://blinkurls.com/api/v1/links" \
-H "Authorization: Bearer blk_your_api_key_here" \
-H "Content-Type: application/json"Endpoints
/api/v1/links
Create a new short link programmatically.
{
"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
}{
"data": {
"id": 1042,
"shortCode": "myBrand",
"originalUrl": "https://example.com...",
"createdAt": "2024-03-20T12:00:00Z"
}
}/api/v1/links
List your active short links with pagination.
// Query Params
?page=1&limit=50{
"data": [
{
"id": 1042,
"shortCode": "myBrand",
"originalUrl": "https://example.com...",
"clicksCount": 142
}
],
"meta": {
"total": 45,
"page": 1,
"limit": 50,
"totalPages": 1
}
}/api/v1/links/:id/stats
Retrieve comprehensive click analytics for a specific link.
{
"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.createdEnterpriseFires immediately when a new short link is created via account or API.
- link.updatedMarketerFires when a link's destination, alias, or settings are modified.
- link.deletedMarketerAlerts when a short link is permanently removed.
- click.createdEnterpriseReal-time data stream for every individual click (Visitor IP, OS, etc).
- referral.createdPartnerNotifies 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.