Skip to main content
POST
/
api
/
links
curl -X POST https://api.linquid.io/api/links \
  -H "X-API-Key: lw_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "destinationUrl": "https://example.com/landing-page",
    "title": "Summer Campaign Link",
    "campaignId": "camp_xyz789",
    "tags": ["summer", "promo"]
  }'
{
  "success": true,
  "data": {
    "id": "link_abc123",
    "shortCode": "abc123",
    "shortUrl": "https://linqu.id/abc123",
    "destinationUrl": "https://example.com/landing-page",
    "title": "Summer Campaign Link",
    "campaignId": "camp_xyz789",
    "enabled": true,
    "passwordProtected": false,
    "expiresAt": null,
    "clicksLimit": null,
    "tags": ["summer", "promo"],
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  }
}

Request Body

destinationUrl
string
required
The target URL to redirect to
title
string
Display name for the link
shortCode
string
Custom short code (auto-generated if not provided)
campaignId
string
Campaign to associate this link with
domainId
string
Custom domain to use (defaults to linqu.id)
expiresAt
string
ISO 8601 datetime when link expires
clicksLimit
number
Maximum number of clicks allowed
password
string
Password to protect the link
tags
array
Array of tag strings for organization

Response

success
boolean
Whether the request was successful
data
object
The created link object
curl -X POST https://api.linquid.io/api/links \
  -H "X-API-Key: lw_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "destinationUrl": "https://example.com/landing-page",
    "title": "Summer Campaign Link",
    "campaignId": "camp_xyz789",
    "tags": ["summer", "promo"]
  }'
{
  "success": true,
  "data": {
    "id": "link_abc123",
    "shortCode": "abc123",
    "shortUrl": "https://linqu.id/abc123",
    "destinationUrl": "https://example.com/landing-page",
    "title": "Summer Campaign Link",
    "campaignId": "camp_xyz789",
    "enabled": true,
    "passwordProtected": false,
    "expiresAt": null,
    "clicksLimit": null,
    "tags": ["summer", "promo"],
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  }
}

Error Responses

Invalid URL

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid destination URL format"
  }
}

Short Code Taken

{
  "success": false,
  "error": {
    "code": "SHORT_CODE_EXISTS",
    "message": "This short code is already in use"
  }
}

Insufficient Credits

{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "Workspace has insufficient credits"
  }
}