REST API

Developer API

Create, manage, and track short links programmatically. Simple REST endpoints with Bearer token authentication and JSON responses.

Bearer Token
JSON Responses
HTTPS Required
9 Endpoints
BASE URL https://tinyzy.com/api/v1/
API Reference

Overview

The TinyZy API is a RESTful service that lets you create and manage short links, UTM-tagged URLs, custom domains, and API keys from your own applications.

All API requests must be made over HTTPS. HTTP requests will be rejected. The API returns JSON for all responses, including errors.

Base URL: https://tinyzy.com/api/v1/
All endpoints below are relative to this base URL.

Authentication

All API endpoints (except API Key management) use Bearer token authentication. Include your API key in every request header.

Generate your API key from Dashboard → Account → API Keys. Keep it secret — treat it like a password.
# Include this header in every API request
Authorization: Bearer YOUR_API_KEY

Error Codes

All errors follow a consistent JSON structure. HTTP status codes reflect the error type.

{
  "status":  "error",
  "message": "Human-readable description of what went wrong"
}
StatusMeaning
200Success
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid API key
403Forbidden — you don't have permission for this resource
404Not found — the requested resource doesn't exist
429Rate limit exceeded — slow down your requests
500Server error — something went wrong on our end

Rate Limits

Rate limits are applied per API key. Exceeding the limit returns 429 Too Many Requests.

PlanRequests / minuteRequests / day
Free30500
Pro1205,000
Business300Unlimited

Links

UTM Builder
POST /utm/build Build a UTM-tagged URL

Builds a UTM-tagged URL from the provided parameters. Optionally shortens the generated URL and returns the short link.

ParameterTypeRequiredDescription
urlstringYesBase URL to append UTM parameters to
sourcestringYesutm_source — referrer (e.g. google)
mediumstringYesutm_medium — channel (e.g. cpc)
campaignstringYesutm_campaign — campaign name
termstringNoutm_term — paid keyword
contentstringNoutm_content — creative variant
shortenbooleanNoIf true, creates a short link for the UTM URL
curl -X POST https://tinyzy.com/api/v1/utm/build \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/sale",
    "source": "newsletter",
    "medium": "email",
    "campaign": "spring-2025",
    "shorten": true
  }'
const res = await fetch('https://tinyzy.com/api/v1/utm/build', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://example.com/sale',
    source: 'newsletter', medium: 'email',
    campaign: 'spring-2025', shorten: true
  })
});
200 OK
{
  "status": "success",
  "data": {
    "utm_url": "https://example.com/sale?utm_source=newsletter&utm_medium=email&utm_campaign=spring-2025",
    "parameters": { "utm_source":"newsletter", "utm_medium":"email", "utm_campaign":"spring-2025" },
    "short_url": "https://tnyzy.com/utm45",
    "slug": "utm45"
  }
}

Custom Domains
GET /domains List custom domains

Returns all custom domains registered by the authenticated user, including their verification and primary status.

200 OK
{
  "status": "success",
  "data": [
    {
      "id": 3,
      "domain": "links.mybrand.com",
      "verified": true,
      "is_primary": true,
      "status": "active"
    }
  ]
}
POST /domains Add a custom domain

Registers a new custom domain. After adding, configure a CNAME record pointing to TinyZy, then call the verify endpoint.

ParameterTypeRequiredDescription
domainstringYesFully qualified domain name (e.g. links.yourbrand.com)
After adding, create a CNAME DNS record pointing your domain to tinyzy.com, then call the verify endpoint.
DELETE /domains/{id} Remove a domain

Removes a custom domain. Links using this domain will stop redirecting. Use the raw numeric ID returned from the list endpoint.

curl -X DELETE https://tinyzy.com/api/v1/domains/3 \
  -H "Authorization: Bearer YOUR_API_KEY"
POST /domains/{id}/verify Verify DNS & activate

Triggers a DNS CNAME check. If the CNAME record is live and pointing correctly, the domain is marked as verified and activated.

200 OK
{
  "status": "success",
  "verified": true,
  "message": "Domain verified and activated"
}

API Key Management
These endpoints use session authentication (you must be logged in via the dashboard), not a Bearer token. They are intended for managing your API keys from the web interface.
POST /api-keys/create Generate an API key

Generates a new API key for your account. The full key is only shown once — store it securely.

ParameterTypeRequiredDescription
labelstringNoA descriptive name for this key (e.g. Production App)
GET /api-keys/list List your API keys

Returns all API keys for your account. Only the masked version of each key is returned — the full key is only shown at creation time.

POST /api-keys/delete/{id} Revoke an API key

Permanently revokes an API key. Any application using this key will immediately lose API access.

Revoking a key is immediate and permanent. Update your applications before revoking keys they depend on.