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"]
}'
const response = await fetch('https://api.linquid.io/api/links', {
method: 'POST',
headers: {
'X-API-Key': 'lw_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
destinationUrl: 'https://example.com/landing-page',
title: 'Summer Campaign Link',
campaignId: 'camp_xyz789',
tags: ['summer', 'promo'],
}),
});
const { data } = await response.json();
console.log('Created link:', data.shortUrl);
import requests
response = requests.post(
'https://api.linquid.io/api/links',
headers={
'X-API-Key': 'lw_your_api_key_here',
'Content-Type': 'application/json',
},
json={
'destinationUrl': 'https://example.com/landing-page',
'title': 'Summer Campaign Link',
'campaignId': 'camp_xyz789',
'tags': ['summer', 'promo'],
}
)
data = response.json()['data']
print(f"Created link: {data['shortUrl']}")
{
"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"
}
}
Links and Rules
Create Link
Create a new smart link
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"]
}'
const response = await fetch('https://api.linquid.io/api/links', {
method: 'POST',
headers: {
'X-API-Key': 'lw_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
destinationUrl: 'https://example.com/landing-page',
title: 'Summer Campaign Link',
campaignId: 'camp_xyz789',
tags: ['summer', 'promo'],
}),
});
const { data } = await response.json();
console.log('Created link:', data.shortUrl);
import requests
response = requests.post(
'https://api.linquid.io/api/links',
headers={
'X-API-Key': 'lw_your_api_key_here',
'Content-Type': 'application/json',
},
json={
'destinationUrl': 'https://example.com/landing-page',
'title': 'Summer Campaign Link',
'campaignId': 'camp_xyz789',
'tags': ['summer', 'promo'],
}
)
data = response.json()['data']
print(f"Created link: {data['shortUrl']}")
{
"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
string
required
The target URL to redirect to
string
Display name for the link
string
Custom short code (auto-generated if not provided)
string
Campaign to associate this link with
string
Custom domain to use (defaults to linqu.id)
string
ISO 8601 datetime when link expires
number
Maximum number of clicks allowed
string
Password to protect the link
array
Array of tag strings for organization
Response
boolean
Whether the request was successful
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"]
}'
const response = await fetch('https://api.linquid.io/api/links', {
method: 'POST',
headers: {
'X-API-Key': 'lw_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
destinationUrl: 'https://example.com/landing-page',
title: 'Summer Campaign Link',
campaignId: 'camp_xyz789',
tags: ['summer', 'promo'],
}),
});
const { data } = await response.json();
console.log('Created link:', data.shortUrl);
import requests
response = requests.post(
'https://api.linquid.io/api/links',
headers={
'X-API-Key': 'lw_your_api_key_here',
'Content-Type': 'application/json',
},
json={
'destinationUrl': 'https://example.com/landing-page',
'title': 'Summer Campaign Link',
'campaignId': 'camp_xyz789',
'tags': ['summer', 'promo'],
}
)
data = response.json()['data']
print(f"Created link: {data['shortUrl']}")
{
"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"
}
}
Was this page helpful?

