Bulk-import links
Goal: create many links in a single request — useful for migrating an existing list of URLs.
Prerequisites: an API key (see Authentication).
Steps
1. Submit the batch
Send an array of link objects, up to 10,000 per request. Only long_url is required per item.
curl -X POST https://api-sandbox.slimlinkdev.com/api/v1/links/bulk
-H "X-API-Key: <API_KEY>"
-H "Content-Type: application/json"
-d '[
{
"long_url": "https://example.com/product/1",
"external_id": "12345",
"title": "Product 1"
},
{
"long_url": "https://example.com/product/2",
"domain_id": "f34fb1a7-3418-4705-a9e9-61e9175661ca",
"path": "my-custom-link",
"team": "team123",
"expired_at": "2025-12-31T23:59:59Z"
}
]'
Use external_id to record your own identifier for the link so you can cross-reference it later (it is not returned by the list/get endpoints, so keep a local mapping if you need to look links up by it).
2. Confirm the response
A 200 response confirms the batch was accepted. The response also carries rate-limit headers — see below.
Rate limits on this endpoint
Bulk creation is rate-limited per account on both a per-second and a per-minute basis; the exact numbers depend on your plan. Every response (including successful ones) includes:
X-RateLimit-Limit-Second: <n>
X-RateLimit-Remaining-Second: <n>
X-RateLimit-Limit-Minute: <n>
X-RateLimit-Remaining-Minute: <n>
If you exceed either limit, the request is rejected with 429 Too Many Requests and the same headers reflecting 0 remaining. Back off and retry once the window resets rather than retrying immediately.
Verify
List your links (see List and search your links) filtered by creation date, or fetch individual links by ID, to confirm they were created.
Common failures
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized |
Missing or invalid API key | Confirm you’re sending X-API-Key: <API_KEY>. |
422 validation error |
One or more items missing long_url, or invalid domain_id |
Validate every item has a non-empty long_url before submitting. |
429 Too Many Requests |
Per-second or per-minute rate limit exceeded for your account | Check X-RateLimit-Remaining-* headers and slow down; retry after the window resets. |
| Request rejected outright | Batch exceeds 10,000 items | Split into multiple requests of 10,000 or fewer. |