Developer Documentation

API Reference

Enterprise-grade link infrastructure

View Endpoints Copy SDK Snippet

Endpoints List

Manage your short links, track performance metrics, and configure redirect rules through our secure REST interface. All requests require Bearer token authentication via the `Authorization` header.

POST

/v1/links/create

Generates a new short URL with custom alias support. Accepts `destination_url`, `expires_at`, and `geo_targeting` parameters. Returns a JSON object containing `short_url`, `link_id`, and `qr_code_svg`.

GET

/v1/links/{link_id}/analytics

Retrieves click-through data for a specific campaign. Supports `date_range`, `device_type`, and `referrer_source` query parameters. Response schema includes `total_clicks`, `unique_visitors`, and `conversion_rate`.

PUT

/v1/links/{link_id}/update

Modifies destination or redirect status for an active link. Requires `new_destination` and `preserve_history` flags. Returns updated `link_status` and `last_modified` timestamp.

Code Examples

Integrate HyperSnap into your deployment pipeline using our standardized request format. Examples below demonstrate link creation and payload validation.

HyperSnap API dashboard displaying real-time request logs and structured JSON response payloads
cURL

Create Short Link

curl -X POST https://api.hypersnap.io/v1/links/create \
  -H "Authorization: Bearer hs_live_8f9a2b1c4d5e" \
  -H "Content-Type: application/json" \
  -d '{
    "destination_url": "https://launch.hypersnap.io/q4-roadmap",
    "custom_alias": "q4map",
    "expires_at": "2024-12-31T23:59:59Z"
  }'
Python

Fetch Analytics

import requests

api_key = "hs_live_8f9a2b1c4d5e"
link_id = "lnk_7x9m2p4q"

response = requests.get(
    f"https://api.hypersnap.io/v1/links/{link_id}/analytics",
    headers={"Authorization": f"Bearer {api_key}"},
    params={"date_range": "last_30d", "device_type": "mobile"}
)

data = response.json()
print(f"Unique clicks: {data['unique_visitors']}")

Error Codes

HyperSnap returns standard HTTP status codes alongside structured JSON error payloads. Review common failure states below to streamline your error handling logic.

400 Bad Request

Invalid Payload Format

Triggered when `destination_url` lacks a valid scheme or exceeds 2048 characters. Response includes `error_code: MISSING_DESTINATION` and `retry_after: 0`.

401 Unauthorized

Expired API Key

Occurs when the Bearer token has been rotated or revoked in the HyperSnap dashboard. Response schema returns `error_code: AUTH_TOKEN_EXPIRED` and a `token_refresh_url`.

429 Too Many Requests

Rate Limit Exceeded

Applied after 1,200 requests per minute on the Enterprise tier. Headers include `X-RateLimit-Remaining` and `Retry-After`. Response body contains `error_code: RATE_LIMIT_HIT`.

Download OpenAPI Spec Contact Dev Support