Creates a new short link for the authenticated user. This endpoint requires a Bearer token and an available shortlink quota, and supports optional title, tags, expiration, password protection, UTM parameters, QR generation, link-in-bio, and public link settings.
curl -X POST 'https://apis.divsly.com/api/v1/short-link' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '{
"destinationUrl": "https://example.com/long-url",
"brandedDomain": "custom.domain",
"slashTag": "my-custom-slug",
"utm_source": "twitter",
"utm_medium": "social",
"utm_campaign": "summer_2024",
"public": false,
"password": "optional_password",
"isQrGenerated": true,
"qrSettings": {
"color": "#000000",
"bgColor": "#ffffff",
"pattern": "classy",
"corner": "square"
}
}'
const data = {
destinationUrl: "https://example.com/long-url",
brandedDomain: "custom.domain",
slashTag: "my-custom-slug",
utm_source: "twitter",
utm_medium: "social",
utm_campaign: "summer_2024",
public: false,
password: "optional_password",
isQrGenerated: true,
qrSettings: {
color: "#000000",
bgColor: "#ffffff",
pattern: "classy",
corner: "square"
}
};
fetch('https://apis.divsly.com/api/v1/short-link', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error('Error:', error));
const axios = require('axios');
const data = {
destinationUrl: 'https://example.com/long-url',
brandedDomain: 'custom.domain',
slashTag: 'my-custom-slug',
utm_source: 'twitter',
utm_medium: 'social',
utm_campaign: 'summer_2024',
public: false,
password: 'optional_password',
isQrGenerated: true,
qrSettings: {
color: '#000000',
bgColor: '#ffffff',
pattern: 'classy',
corner: 'square'
}
};
axios.post(
'https://apis.divsly.com/api/v1/short-link',
data,
{
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
}
)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error.response?.data || error.message);
});
$data = [
"destinationUrl" => "https://example.com/long-url",
"brandedDomain" => "custom.domain",
"slashTag" => "my-custom-slug",
"utm_source" => "twitter",
"utm_medium" => "social",
"utm_campaign" => "summer_2024",
"public" => false,
"password" => "optional_password",
"isQrGenerated" => true,
"qrSettings" => [
"color" => "#000000",
"bgColor" => "#ffffff",
"pattern" => "classy",
"corner" => "square"
]
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apis.divsly.com/api/v1/short-link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer YOUR_ACCESS_TOKEN"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://apis.divsly.com/api/v1/short-link"
payload = {
"destinationUrl": "https://example.com/long-url",
"brandedDomain": "custom.domain",
"slashTag": "my-custom-slug",
"utm_source": "twitter",
"utm_medium": "social",
"utm_campaign": "summer_2024",
"public": False,
"password": "optional_password",
"isQrGenerated": True,
"qrSettings": {
"color": "#000000",
"bgColor": "#ffffff",
"pattern": "classy",
"corner": "square"
}
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
"success": true,
"message": "Short Link Created Successfully.",
"data": {
"id": 1162,
"type": "shortlink",
"type2": null,
"userId": 92,
"clicks": 0,
"lbClicks": 0,
"scans": 0,
"destinationUrl": "https://jsdev.org/",
"faviconUrl": "",
"title": "JS dev",
"titleLabel": "js dev",
"btnLabel": "Click Here",
"brandedDomain": "kut.lt",
"slashTag": "tw9e1",
"edit": 0,
"utm_id": null,
"utm_content": null,
"utm_term": null,
"utm_campaign": null,
"utm_medium": null,
"utm_source": null,
"preset": null,
"bgColor": null,
"color": null,
"pattern": null,
"corner": null,
"logo": null,
"qr": null,
"qrLogoId": null,
"tags": "",
"linkInBioId": null,
"uniqueTagId": 1221,
"isActive": true,
"isStarred": false,
"expirationDate": "2025-06-25T04:30:15.979Z",
"createdAt": "2025-03-27T04:30:25.542Z",
"updatedAt": "2025-03-27T04:30:25.542Z",
"fieldData": null,
"frame": null,
"isadminblocked": false,
"isEdit": false,
"password": null,
"passwordProtectionEnabled": false,
"primary": null,
"qrType": null,
"secondary": null,
"text": null,
"textColor": null
}
}
{
"message": "Unauthorized!"
}
{
error: true,
data: {
message: 'Qr Code Limit Exceeded for your current plan. Please upgrade!',
},
}
{
error: true,
data: {
message: `Link Limit Exceeded for your current plan. Please upgrade!`,
},
}
{
error: true,
data: {
message: 'Bio Page Limit Exceeded for your current plan. Please upgrade!',
},
}
{
error: true,
data: {
message: `Link Limit Exceeded for your current plan. Please upgrade!`,
},
}