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
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"
}
}
}
