Skip to Content

Bulk Create Links

Create multiple short links in a single request. Supports up to 50 links per call.

POST /api/v1/links/bulk

Authentication

Required.

Request Body

ParameterTypeRequiredDescription
linksarrayYesArray of link objects (1-50 items)
ParameterTypeRequiredDescription
urlstringYesDestination URL
custom_aliasstringNoCustom short code
titlestringNoDisplay title
passwordstringNoPassword protection
expires_atstringNoExpiration (ISO 8601)

Response

Returns partial results — some links may succeed while others fail. Check both success and failed arrays.

Examples

curl -X POST https://snipurl.click/api/v1/links/bulk \ -H "Authorization: Bearer snip_live_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "links": [ {"url": "https://example.com/page-1", "title": "Page One"}, {"url": "https://example.com/page-2", "custom_alias": "page-2"}, {"url": "https://example.com/page-3"}, {"url": "https://example.com/page-4", "password": "secret"}, {"url": "https://example.com/page-5", "expires_at": "2025-12-31T00:00:00Z"} ] }'
const links = [ { url: 'https://example.com/page-1', title: 'Page One' }, { url: 'https://example.com/page-2', custom_alias: 'page-2' }, { url: 'https://example.com/page-3' }, ]; const response = await fetch('https://snipurl.click/api/v1/links/bulk', { method: 'POST', headers: { 'Authorization': 'Bearer snip_live_your_key_here', 'Content-Type': 'application/json', }, body: JSON.stringify({ links }), }); const { data } = await response.json(); console.log(`Created: ${data.success.length}, Failed: ${data.failed.length}`);
import requests links = [ {'url': 'https://example.com/page-1', 'title': 'Page One'}, {'url': 'https://example.com/page-2', 'custom_alias': 'page-2'}, {'url': 'https://example.com/page-3'}, ] response = requests.post( 'https://snipurl.click/api/v1/links/bulk', headers={'Authorization': 'Bearer snip_live_your_key_here'}, json={'links': links}, ) data = response.json()['data'] print(f"Created: {len(data['success'])}, Failed: {len(data['failed'])}")

Response (201 Created):

{ "success": true, "data": { "success": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "short_code": "a8Kx2m", "short_url": "https://snipurl.click/a8Kx2m", "original_url": "https://example.com/page-1", "title": "Page One", "created_at": "2025-06-24T10:00:00.000Z" }, { "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "short_code": "page-2", "short_url": "https://snipurl.click/page-2", "original_url": "https://example.com/page-2", "title": "Page 2 - Example", "created_at": "2025-06-24T10:00:00.000Z" }, { "id": "a87ff679-a2f3-e710-ab34-946655440001", "short_code": "Nq9pR4", "short_url": "https://snipurl.click/Nq9pR4", "original_url": "https://example.com/page-3", "title": "Page 3 - Example", "created_at": "2025-06-24T10:00:00.000Z" } ], "failed": [] } }

Partial Failure Example

If some links fail (e.g., alias taken), others still succeed:

{ "success": true, "data": { "success": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "short_code": "a8Kx2m", "short_url": "https://snipurl.click/a8Kx2m", "original_url": "https://example.com/page-1", "title": "Page One", "created_at": "2025-06-24T10:00:00.000Z" } ], "failed": [ {"index": 1, "error": "Alias already taken"} ] } }

Error Responses

StatusCodeDescription
400VALIDATION_ERRORInvalid request body or exceeds 50 links
403FORBIDDENAdding these links would exceed your link limit

Notes

  • Failed links do not affect successful ones (non-transactional)
  • The index in the failed array corresponds to the position in your input array (0-based)
  • Title auto-fetching runs for each link, which may slow down large batches
Last updated on