API Documentation
Complete API reference for integrating Snipzr into your applications. Use our RESTful API to programmatically create, manage, and track short links.
Authorization
To access the API endpoints, you need to authenticate your requests using a Bearer token. Include the token in the Authorization header of your HTTP requests.
You can generate a token from your account settings.
Example of an Authorization header:
Authorization: Bearer YOUR_TOKEN_HERE
Getting Started
- Generate an API Token: Visit your account settings and generate a new API token
- Test the Connection: Use the
GET /zonesendpoint to verify your token works - Create Your First Link: Use the
POST /urlsendpoint to create a short link - Integrate: Incorporate the API into your application or workflow
Endpoints
POST /urls
Create a new short link.
API Endpoint:
POST https://api.snipzr.com/v1/urls
Request Body
| Parameter | Type | Description |
|---|---|---|
url | string | The original URL to be shortened (required) |
title | string | The title for the short link (optional) |
slug | string | Custom slug for the short link (optional) |
zoneDomain | string | Zone domain where the link will be created (required) |
Response
{
"url": {
"id": "string",
"slug": "string",
"url": "string",
"title": "string",
"zoneDomain": "string",
"hits": 0,
"isEnabled": true,
"createdAt": "string",
"updatedAt": "string",
"isRestricted": true,
"isUnsafe": true
}
}
cURL Command
curl -X POST https://api.snipzr.com/v1/urls \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"title": "Example Title",
"slug": "example-slug",
"zoneDomain": "snipzr.com"
}'
PATCH /urls/:slug
Update an existing short link.
API Endpoint:
PATCH https://api.snipzr.com/v1/urls/:slug
Request Body
| Parameter | Type | Description |
|---|---|---|
url | string | The new target URL for the short link (optional) |
title | string | The new title for the short link (optional) |
newSlug | string | New custom slug for the short link (optional) |
isEnabled | boolean | Enable or disable the short link (optional) |
Response
{
"url": {
"id": "string",
"slug": "string",
"url": "string",
"title": "string",
"zoneDomain": "string",
"hits": 0,
"isEnabled": true,
"createdAt": "string",
"updatedAt": "string",
"isRestricted": true,
"isUnsafe": true
}
}
cURL Command
curl -X PATCH https://api.snipzr.com/v1/urls/example-slug \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://new-example.com",
"title": "Updated Title",
"newSlug": "new-example-slug",
"isEnabled": true
}'
GET /urls
Get all short links with pagination support.
API Endpoint:
GET https://api.snipzr.com/v1/urls
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | number | Number of links per page (default: 10) |
page | number | Page number for pagination (default: 1) |
Response
{
"urls": [
{
"id": "string",
"slug": "string",
"url": "string",
"title": "string",
"zoneDomain": "string",
"hits": 0,
"isEnabled": true,
"createdAt": "string",
"updatedAt": "string",
"isRestricted": true,
"isUnsafe": true
}
],
"total": 1
}
cURL Command
curl -X GET https://api.snipzr.com/v1/urls \
-H "Authorization: Bearer YOUR_TOKEN"
GET /urls/:slug
Get a single short link by its slug.
API Endpoint:
GET https://api.snipzr.com/v1/urls/:slug
Response
{
"url": {
"id": "string",
"slug": "string",
"url": "string",
"title": "string",
"zoneDomain": "string",
"hits": 0,
"isEnabled": true,
"createdAt": "string",
"updatedAt": "string",
"isRestricted": true,
"isUnsafe": true
}
}
cURL Command
curl -X GET https://api.snipzr.com/v1/urls/example-slug \
-H "Authorization: Bearer YOUR_TOKEN"
DELETE /urls/:slug
Delete a single short link permanently.
API Endpoint:
DELETE https://api.snipzr.com/v1/urls/:slug
Response
{
"message": "string"
}
cURL Command
curl -X DELETE https://api.snipzr.com/v1/urls/example-slug \
-H "Authorization: Bearer YOUR_TOKEN"
GET /zones
Get available zones for link creation. Returns both global zones (provided by Snipzr) and user-owned custom zones.
API Endpoint:
GET https://api.snipzr.com/v1/zones
Response
{
"global": [
{
"domain": "string",
"name": "string",
"zoneType": "global",
"isEnabled": true,
"isDefault": true
}
],
"user": [
{
"domain": "string",
"name": "string",
"zoneType": "user",
"isEnabled": true,
"isDefault": false,
"tlsState": "provisioned",
"ownershipState": "verified"
}
]
}
cURL Command
curl -X GET https://api.snipzr.com/v1/zones \
-H "Authorization: Bearer YOUR_TOKEN"
Response Reference
HTTP Status Codes
The API returns standard HTTP status codes:
200: Success201: Created (for POST requests)400: Bad Request (validation errors)401: Unauthorized (invalid or missing token)404: Not Found429: Too Many Requests (rate limit exceeded)500: Internal Server Error
URL Object
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the short link |
slug | string | The short URL path (e.g., "example-slug") |
url | string | The destination URL where the short link redirects |
title | string | Optional title for organizing links |
zoneDomain | string | The domain used for the short link (e.g., "snipzr.com") |
hits | number | Number of times the short link has been accessed |
isEnabled | boolean | Whether the link is active (true) or disabled (false) |
createdAt | string | ISO timestamp of link creation |
updatedAt | string | ISO timestamp of last modification |
isRestricted | boolean | Whether the link is restricted by content policies |
isUnsafe | boolean | Whether the destination has been flagged as potentially unsafe |
Zone Object
| Field | Type | Description |
|---|---|---|
domain | string | The domain name (e.g., "snipzr.com") |
name | string | Display name for the zone |
zoneType | string | Either "global" (Snipzr-provided) or "user" (custom domain) |
isEnabled | boolean | Whether the zone is active |
isDefault | boolean | Whether this is the default zone for new links |
tlsState | string | SSL/TLS certificate status (user zones only) |
ownershipState | string | Domain verification status (user zones only) |
Support
Need help with the API?