Quickstart: create your first short link
By the end of this guide you’ll have created a short link and fetched it back by ID. Time: ~5 minutes.
Prerequisites
- A Slimlink account with API credentials generated from the customer portal.
- An API key (
X-API-Keyheader) — see Authentication.
1. Create a short link
curl -X POST https://api-sandbox.slimlinkdev.com/api/v1/links/
-H "X-API-Key: <API_KEY>"
-H "Content-Type: application/json"
-d '{
"longUrl": "https://example.com/promo/spring-sale-2026",
"title": "Spring Sale 2026"
}'
Expected response:
{
"data": {
"id": "06a447a7-5734-48b0-9dab-021576f0e0d1",
"path": "zgdssgd",
"shortUrl": "https://short.link/zgdssgd",
"longUrl": "https://example.com/promo/spring-sale-2026",
"title": "Spring Sale 2026",
"domain": "06a447a7-5734-48b0-9dab-021576f0e0d1",
"tags": [],
"totalNumberOfClick": 0,
"createdAt": "2026-04-30T10:15:30.123Z",
"updatedAt": null,
"expiredAt": null
},
"error_code": null,
"message": "Request successful"
}
Save the id from the response — you’ll use it next.
2. Verify it worked
Fetch the link back by ID to confirm it was created:
curl https://api-sandbox.slimlinkdev.com/api/v1/links/06a447a7-5734-48b0-9dab-021576f0e0d1
-H "X-API-Key: <API_KEY>"
This returns the same link object shown above. shortUrl is the link you can share and click; visiting it redirects to longUrl.
Where to go next
- Shorten a URL with custom options — custom path, domain, tags, expiration
- Bulk-import links
- Read click analytics
- Key Concepts — understand the Link and Domain entities