Skip to main content

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

  1. Generate an API Token: Visit your account settings and generate a new API token
  2. Test the Connection: Use the GET /zones endpoint to verify your token works
  3. Create Your First Link: Use the POST /urls endpoint to create a short link
  4. 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

ParameterTypeDescription
urlstringThe original URL to be shortened (required)
titlestringThe title for the short link (optional)
slugstringCustom slug for the short link (optional)
zoneDomainstringZone 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

ParameterTypeDescription
urlstringThe new target URL for the short link (optional)
titlestringThe new title for the short link (optional)
newSlugstringNew custom slug for the short link (optional)
isEnabledbooleanEnable 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

ParameterTypeDescription
limitnumberNumber of links per page (default: 10)
pagenumberPage 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: Success
  • 201: Created (for POST requests)
  • 400: Bad Request (validation errors)
  • 401: Unauthorized (invalid or missing token)
  • 404: Not Found
  • 429: Too Many Requests (rate limit exceeded)
  • 500: Internal Server Error

URL Object

FieldTypeDescription
idstringUnique identifier for the short link
slugstringThe short URL path (e.g., "example-slug")
urlstringThe destination URL where the short link redirects
titlestringOptional title for organizing links
zoneDomainstringThe domain used for the short link (e.g., "snipzr.com")
hitsnumberNumber of times the short link has been accessed
isEnabledbooleanWhether the link is active (true) or disabled (false)
createdAtstringISO timestamp of link creation
updatedAtstringISO timestamp of last modification
isRestrictedbooleanWhether the link is restricted by content policies
isUnsafebooleanWhether the destination has been flagged as potentially unsafe

Zone Object

FieldTypeDescription
domainstringThe domain name (e.g., "snipzr.com")
namestringDisplay name for the zone
zoneTypestringEither "global" (Snipzr-provided) or "user" (custom domain)
isEnabledbooleanWhether the zone is active
isDefaultbooleanWhether this is the default zone for new links
tlsStatestringSSL/TLS certificate status (user zones only)
ownershipStatestringDomain verification status (user zones only)

Support

Need help with the API?