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.
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.
# 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" }
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 403 | Forbidden — you don't have permission for this resource |
| 404 | Not found — the requested resource doesn't exist |
| 429 | Rate limit exceeded — slow down your requests |
| 500 | Server error — something went wrong on our end |
Rate Limits
Rate limits are applied per API key. Exceeding the limit returns 429 Too Many Requests.
| Plan | Requests / minute | Requests / day |
|---|---|---|
| Free | 30 | 500 |
| Pro | 120 | 5,000 |
| Business | 300 | Unlimited |
Returns a paginated list of all short links belonging to the authenticated user.
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number (default: 1) |
| limit | integer | No | Results per page, max 100 (default: 20) |
curl https://tinyzy.com/api/v1/links \ -H "Authorization: Bearer YOUR_API_KEY"
const res = await fetch('https://tinyzy.com/api/v1/links', { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }); const data = await res.json();
{ "status": "success", "data": [ { "id": 42, "slug": "abc123", "destination": "https://example.com/page", "short_url": "https://tnyzy.com/abc123", "clicks": 187, "status": "active", "created_at": "2025-03-01T10:00:00Z" } ], "meta": { "total": 84, "page": 1, "limit": 20 } }
Creates a new short link for the authenticated user. Returns the full link object including the generated short URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
| destination | string | Yes | The destination URL to redirect to |
| slug | string | No | Custom slug (auto-generated if omitted) |
| title | string | No | Internal label for the link |
| domain_id | integer | No | ID of a verified custom domain |
curl -X POST https://tinyzy.com/api/v1/links/create \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"destination":"https://example.com","title":"My Link"}'
const res = await fetch('https://tinyzy.com/api/v1/links/create', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ destination: 'https://example.com' }) });
{ "status": "success", "data": { "id": 43, "slug": "xyz789", "short_url": "https://tnyzy.com/xyz789", "destination": "https://example.com", "clicks": 0, "status": "active" } }
Retrieve full details of a single short link by its slug.
| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | The short link slug (e.g. abc123) |
curl https://tinyzy.com/api/v1/links/abc123 \ -H "Authorization: Bearer YOUR_API_KEY"
Update the destination URL, title, or slug of an existing short link.
| Parameter | Type | Required | Description |
|---|---|---|---|
| destination | string | No | New destination URL |
| title | string | No | New title / label |
| slug | string | No | New custom slug (must be unique) |
Permanently deletes a short link. This action cannot be undone. The slug becomes available for reuse.
Pauses a short link. Visitors will receive a 404 response instead of being redirected. The link and its data are preserved.
curl -X PATCH https://tinyzy.com/api/v1/links/abc123/pause \ -H "Authorization: Bearer YOUR_API_KEY"
Re-activates a paused short link. Visitors will be redirected normally again.
Returns click totals, referrers, countries, browsers, and devices for the specified link.
| Parameter | Type | Required | Description |
|---|---|---|---|
| period | string | No | 7d, 30d, 90d, all (default: 30d) |
{ "status": "success", "data": { "total_clicks": 1240, "unique_clicks": 890, "top_countries": [{"country":"US","clicks":540}], "top_referrers": [{"referrer":"google.com","clicks":320}] } }
Builds a UTM-tagged URL from the provided parameters. Optionally shortens the generated URL and returns the short link.
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Base URL to append UTM parameters to |
| source | string | Yes | utm_source — referrer (e.g. google) |
| medium | string | Yes | utm_medium — channel (e.g. cpc) |
| campaign | string | Yes | utm_campaign — campaign name |
| term | string | No | utm_term — paid keyword |
| content | string | No | utm_content — creative variant |
| shorten | boolean | No | If 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 }) });
{ "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" } }
Returns all custom domains registered by the authenticated user, including their verification and primary status.
{ "status": "success", "data": [ { "id": 3, "domain": "links.mybrand.com", "verified": true, "is_primary": true, "status": "active" } ] }
Registers a new custom domain. After adding, configure a CNAME record pointing to TinyZy, then call the verify endpoint.
| Parameter | Type | Required | Description |
|---|---|---|---|
| domain | string | Yes | Fully qualified domain name (e.g. links.yourbrand.com) |
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"
Triggers a DNS CNAME check. If the CNAME record is live and pointing correctly, the domain is marked as verified and activated.
{ "status": "success", "verified": true, "message": "Domain verified and activated" }
Generates a new API key for your account. The full key is only shown once — store it securely.
| Parameter | Type | Required | Description |
|---|---|---|---|
| label | string | No | A descriptive name for this key (e.g. Production App) |
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.
Permanently revokes an API key. Any application using this key will immediately lose API access.