curl -X POST https://snip.sa/api/urls \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"originalUrl": "https://example.com/very-long-url",
"customCode": "mylink",
"title": "My Custom Link",
"tags": ["marketing", "campaign"]
}'
const response = await axios.post('https://snip.sa/api/urls', {
originalUrl: 'https://example.com/very-long-url',
customCode: 'mylink',
title: 'My Custom Link',
tags: ['marketing', 'campaign']
}, {
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
}
});
response = requests.post(
'https://snip.sa/api/urls',
headers={
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
json={
'originalUrl': 'https://example.com/very-long-url',
'customCode': 'mylink',
'title': 'My Custom Link',
'tags': ['marketing', 'campaign']
}
)
{
"success": true,
"message": "URL created successfully",
"data": {
"url": {
"_id": "507f1f77bcf86cd799439011",
"originalUrl": "https://example.com/very-long-url",
"shortCode": "abc123",
"customCode": "mylink",
"title": "My Custom Link",
"tags": ["marketing", "campaign"],
"clickCount": 0,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z"
},
"domain": {
"id": "base",
"fullDomain": "laghhu.link",
"shortUrl": "https://laghhu.link"
}
}
}
URLs
Create URL
Create a new shortened URL with optional customization
POST
/
api
/
urls
curl -X POST https://snip.sa/api/urls \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"originalUrl": "https://example.com/very-long-url",
"customCode": "mylink",
"title": "My Custom Link",
"tags": ["marketing", "campaign"]
}'
const response = await axios.post('https://snip.sa/api/urls', {
originalUrl: 'https://example.com/very-long-url',
customCode: 'mylink',
title: 'My Custom Link',
tags: ['marketing', 'campaign']
}, {
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
}
});
response = requests.post(
'https://snip.sa/api/urls',
headers={
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
json={
'originalUrl': 'https://example.com/very-long-url',
'customCode': 'mylink',
'title': 'My Custom Link',
'tags': ['marketing', 'campaign']
}
)
{
"success": true,
"message": "URL created successfully",
"data": {
"url": {
"_id": "507f1f77bcf86cd799439011",
"originalUrl": "https://example.com/very-long-url",
"shortCode": "abc123",
"customCode": "mylink",
"title": "My Custom Link",
"tags": ["marketing", "campaign"],
"clickCount": 0,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z"
},
"domain": {
"id": "base",
"fullDomain": "laghhu.link",
"shortUrl": "https://laghhu.link"
}
}
}
Request Body
string
required
The long URL to shorten (must be valid HTTP/HTTPS URL)
string
Custom short code (alphanumeric, case-sensitive, 3-50 characters)
string
Title for the shortened URL (max 200 characters)
string
Description of the link (max 500 characters)
array
Array of tags for organization
string
ISO 8601 date when the link expires
string
Password protection for the link
string
Domain ID to use (“base” for default domain)
object
object
number
default:"302"
HTTP redirect type (301 or 302)
curl -X POST https://snip.sa/api/urls \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"originalUrl": "https://example.com/very-long-url",
"customCode": "mylink",
"title": "My Custom Link",
"tags": ["marketing", "campaign"]
}'
const response = await axios.post('https://snip.sa/api/urls', {
originalUrl: 'https://example.com/very-long-url',
customCode: 'mylink',
title: 'My Custom Link',
tags: ['marketing', 'campaign']
}, {
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
}
});
response = requests.post(
'https://snip.sa/api/urls',
headers={
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
json={
'originalUrl': 'https://example.com/very-long-url',
'customCode': 'mylink',
'title': 'My Custom Link',
'tags': ['marketing', 'campaign']
}
)
{
"success": true,
"message": "URL created successfully",
"data": {
"url": {
"_id": "507f1f77bcf86cd799439011",
"originalUrl": "https://example.com/very-long-url",
"shortCode": "abc123",
"customCode": "mylink",
"title": "My Custom Link",
"tags": ["marketing", "campaign"],
"clickCount": 0,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z"
},
"domain": {
"id": "base",
"fullDomain": "laghhu.link",
"shortUrl": "https://laghhu.link"
}
}
}
