API Documentation
Manage redirects, routing rules, domains and click stats from scripts, CI pipelines, or your own tools.
Getting started
The API lives at https://app.urlpath.cloud and speaks JSON. Every request is
authenticated with a personal API token: create one under
My Profile → API tokens. Tokens are shown once at
creation (they start with rtk_) — store them somewhere safe, and revoke old ones
from the same page. Treat a token like a password: anyone holding it can do everything you can.
Plan requirement: API access comes with paid plans — the Free plan does not
include it. On a Free plan, token creation is locked and requests return 403; upgrading
unlocks the API immediately (existing tokens resume on their own).
Send the token on every request:
Authorization: Bearer rtk_YOUR_TOKEN_HERE Content-Type: application/json
Rate limit: 300 requests per minute per token by default. When you hit it, requests
return 429 with a Retry-After header telling you how long to wait —
back off and retry rather than loop. (The operator can raise, lower, or disable this.)
Permissions are identical to the web UI. A token can only see and change what its account can see and change there — your own redirects, domains shared with you through a project (within whatever the project owner allows their staff), and everything if you're an app admin. Writes are recorded in the audit trail marked "(via API token)", exactly like clicks of a button would be.
Read-only tokens: when creating a token on My Profile you can tick
read-only — perfect for dashboards and monitoring scripts. A read-only token can use
every GET endpoint below, but any write returns 403.
Redirects
GET/api/redirects.php — list
Returns every redirect visible to the account — yours, plus everything on domains shared with you through a project. Optional parameters:
?limit=page size, 1–500 (default 100)?offset=rows to skip, for paging (offset+limitwalks the full set)?status=activeorpaused?source_domain=exact domain name, e.g.go.example.com
The response includes total (matching rows before paging), plus the applied limit and offset.
curl -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \ "https://app.urlpath.cloud/api/redirects.php?limit=100&offset=0&status=active"
{
"redirects": [
{
"id": 12,
"source_domain": "go.example.com",
"source_path": "/offer",
"target_url": "https://example.com/sale",
"redirect_type": 301,
"status": "active",
"click_count": 941,
"routing_rules": [ { "rule_type": "country", "match_value": "DE", "target_url": "https://example.com/de" } ],
...
}
],
"total": 87,
"limit": 100,
"offset": 0
}
Add ?id=123 to fetch exactly one redirect instead.
POST/api/redirects.php — create
JSON body. Required: source_domain and target_url. Everything else is optional.
curl -X POST -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"source_domain": "go.example.com", "source_path": "/offer",
"target_url": "https://example.com/sale", "redirect_type": 302}' \
https://app.urlpath.cloud/api/redirects.php
The full created redirect is returned (including its new id).
POST bulk create
Send {"bulk": [ ... ]} with up to 100 redirect objects to create them in one call.
Each item is validated exactly like a single create; the loop continues past per-item failures
(duplicate, invalid target, limit reached) and reports every result.
curl -X POST -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"bulk": [
{"source_domain": "go.example.com", "source_path": "/a", "target_url": "https://example.com/a"},
{"source_domain": "go.example.com", "source_path": "/b", "target_url": "https://example.com/b"}
]}' \
https://app.urlpath.cloud/api/redirects.php
{
"created": 2,
"failed": 0,
"results": [
{ "ok": true, "redirect": { "id": 13, ... } },
{ "ok": true, "redirect": { "id": 14, ... } }
]
}
Writable fields
| Field | Values | Notes |
|---|---|---|
source_domain | domain name | The domain must be one you can use (yours, or shared with you via a project). |
source_path | path or "" | A leading / is added automatically; "" = catch-all for the whole domain. |
target_url | full URL | Must be a valid http(s):// URL. |
redirect_type | 301 / 302 | Permanent vs temporary. |
forward_path, forward_query, include_www | true / false | Path & query forwarding, www. inclusion. |
status | "active" / "paused" | Paused links stop redirecting. |
note | free text | Internal only. |
starts_at, ends_at | date string / null | Schedule window — anything PHP's strtotime() parses ("2026-09-01 09:00", "+1 week"); null or "" clears. |
split_target_url, split_percent | URL + 1–100 / null | A/B traffic split; set or clear both together. |
meta_title | text, ≤255 chars | Browser-tab / search / social title for the Bio, For Sale, or Branded page this redirect serves. |
meta_description | text, ≤500 chars | Search & social description for those pages. |
og_image | full URL / null | Social share image (og:image) shown when the link is shared. |
meta_robots_noindex | true / false | Hide the page from search engines (noindex, nofollow). |
mode | "bio" / "redirect" | Create a Bio Page instead of a redirect (target_url becomes optional). "sale" is not API-manageable yet. See Bio pages via the API below. |
owner_id | account id | Admin tokens only — silently ignored otherwise. |
Bio pages via the API (multi-page bio sites)
Send "mode": "bio" with a nested bio object to create a bio page —
or to convert an existing redirect into one. Each bio page lives at its own source_path
(a home page at "", extra pages at paths like "/about"), and pages sharing a
domain automatically get a nav panel linking each other — set nav_position to
"top" or "side" to turn it on. Publishing or updating a bio page also submits
it to IndexNow (Bing, Yandex, Seznam, Naver) so search engines pick it up in minutes.
curl -X POST -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"source_domain": "mybrand.com", "source_path": "/about", "mode": "bio",
"bio": {"title": "About me", "text": "The longer story.",
"theme_color": "#7c3aed", "layout": "classic", "nav_position": "top",
"links": [{"label": "My site", "url": "https://mybrand.com"}]}}' \
https://app.urlpath.cloud/api/redirects.php
bio fields: title, text, avatar_url,
theme_color (#rrggbb), layout (classic/bold/minimal/grid),
nav_position (none/top/side), links (array of
{label, url, icon?}). On updates every field is optional — send only what changes;
converting a bio page back to a plain redirect is a console-UI operation. GET responses for bio pages
echo the whole bio object back.
PUTPATCH/api/redirects.php?id=123 — update
Partial: send only the fields you want to change; everything else is left alone.
curl -X PUT -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"status": "paused"}' \
"https://app.urlpath.cloud/api/redirects.php?id=12"
DELETE/api/redirects.php?id=123 — delete
curl -X DELETE -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \ "https://app.urlpath.cloud/api/redirects.php?id=12"
Returns 204 No Content. Deleting is soft: the redirect moves to the account's Trash for 30 days (it 404s to the API and stops serving immediately), then the nightly purge removes it and its click history permanently. Restores happen in the console's Trash page.
Routing rules
Country- and device-based rules are a child of a redirect and have their own endpoint. A second
POST for the same redirect + type + match value just updates the target — rules are
unique per combination, same as in the UI.
| Call | Purpose |
|---|---|
GET/api/routing-rules.php?redirect_id=12 | List the redirect's rules. |
POST/api/routing-rules.php | Add/update a rule: redirect_id, rule_type ("country" | "device"), match_value ("DE" or "Desktop"/"Mobile"/"Tablet"), target_url. |
DELETE/api/routing-rules.php?id=456 | Delete one rule by its own id. |
Domains
GET/api/domains.php
The domains this account can build on — the same list the Domains page offers — including the
node.ip addresses to point DNS at. Read-only: adding/removing domains stays in the UI.
curl -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \ https://app.urlpath.cloud/api/domains.php
{
"domains": [
{
"domain_name": "go.example.com",
"source": "added",
"project_name": null,
"fallback_url": null,
"redirect_count": 3,
"location": "US East",
"node": { "label": "us-east-2", "ipv4": "203.0.113.10", "ipv6": "..." }
}
]
}
Click statistics
GET/api/stats.php?id=123&days=7
Click summary for one redirect. days (1–90, default 7) controls the daily series.
Bot visits are excluded everywhere; unique_visitors counts distinct stored client IPs,
which is a floor if this deployment truncates stored IPs for privacy.
curl -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \ "https://app.urlpath.cloud/api/stats.php?id=12&days=30"
{
"redirect": { "id": 12, "source_domain": "go.example.com", "source_path": "/offer" },
"days": 30,
"total_clicks": 941,
"bots_total": 37,
"unique_visitors": 655,
"last_click": "2026-08-31 09:14:02",
"series": [ { "date": "2026-08-02", "clicks": 21 }, ... ]
}
QR codes
GET/api/qr.php?id=123
PNG QR code encoding the redirect's short URL
(https://source_domain + source_path). Add &download=1 for a
Content-Disposition attachment. Returns image/png directly.
curl -H "Authorization: Bearer rtk_YOUR_TOKEN_HERE" \ -o qr.png "https://app.urlpath.cloud/api/qr.php?id=12"
Webhooks (outbound)
Rather than polling, you can have us POST signed JSON to your endpoint whenever a redirect you own is created, updated, or deleted. Register endpoints and manage secrets on Webhooks in the console. Deliveries go out within five minutes; failures retry at 5, 20, 60, and 240 minutes (5 attempts), and every delivery is signed so your receiver can authenticate it:
X-Urlpath-Event: redirect.created
X-Urlpath-Delivery: 1234 (queue id — dedupe on this)
X-Urlpath-Timestamp: 1769340000
X-Urlpath-Signature: sha256=HMAC_SHA256(secret, "1769340000.{raw body}")
The body is one JSON object: {"id": 1234, "event": "redirect.created", "timestamp": 1769340000,
"created_at": "…", "data": { "id": 456, "source_domain": "example.com", "source_path": "/sale",
"target_url": "…", "redirect_type": 301, "status": "active", "redirect_mode": "redirect", "updated_at": "…" }}.
Respond 2xx to acknowledge. Reject deliveries older than ~10 minutes and replay/forgery
attacks die in the same check. Endpoints must be public https URLs.
redirect.health (2026-11-26): fires when a redirect's target fails or passes its
periodic health check (checked every few hours; targets can also show "blocked" when they resolve
to an internal address). The data object carries the same redirect fields as above plus
a health block: {"status": "healthy", "previous_status": "broken",
"http_code": 200, "checked_at": "…"} — status is one of
healthy / broken / unreachable / blocked. Subscribe via the Webhooks page.
Errors
Every error is JSON: {"error": "human-readable message"}.
| Status | Meaning |
|---|---|
400 | Bad request — missing/invalid fields; the message says which. |
401 | Missing, malformed, invalid, or revoked token. |
404 | No such redirect/rule — also returned for things that exist but aren't visible to your token, so ids can't be probed. |
429 | Rate limit exceeded — wait for the Retry-After seconds, then retry. |
405 | Wrong HTTP method for the endpoint. |
Good to know
- Send
Content-Type: application/jsonon writes; bodies are JSON, responses are JSON. - Actions taken through the API are audit-logged with your account and marked "(via API token)" — visible in My Activity.
- Ids are internal and stable; build integrations around them, not around paths.
- Need something the API doesn't cover? Ask us through Support — real people, real answers.