Reurl API
Base URL: https://api.reurl.to.
Generate API tokens in the dashboard at app.reurl.to.
Authentication
A token can be sent in a header, JSON body, form body, or query string. Header authentication is recommended for production systems.
Authorization: Bearer reurl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
X-Reurl-Token: reurl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
"token": "reurl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"target_url": "https://example.com"
}
Account tokens
Free accounts can keep up to 3 active API tokens. Token management requires dashboard login by email or GitHub; API tokens cannot create, rename, or revoke other tokens.
GET /tokens
POST /tokens
PATCH /tokens/:id
DELETE /tokens/:id
These endpoints use the browser session cookie from app.reurl.to. They do not accept account API tokens.
Short links
List links
curl https://api.reurl.to/links \
-H "Authorization: Bearer reurl_xxx"
Create a link
curl -X POST https://api.reurl.to/links \
-H "Authorization: Bearer reurl_xxx" \
-H "Content-Type: application/json" \
-d '{"target_url":"https://example.com","code":"launch"}'
Create with form data
curl -X POST https://api.reurl.to/links \
-F "token=reurl_xxx" \
-F "target_url=https://example.com" \
-F "code=launch"
Disable a link
curl -X PATCH https://api.reurl.to/links/LINK_ID \
-H "Authorization: Bearer reurl_xxx" \
-H "Content-Type: application/json" \
-d '{"is_active":false}'
Delete a link
curl -X DELETE https://api.reurl.to/links/LINK_ID \
-H "Authorization: Bearer reurl_xxx"
QR codes
curl https://api.reurl.to/links/LINK_ID/qr \
-H "Authorization: Bearer reurl_xxx"
Plans
The current free plan allows 5 short links and 3 active API tokens. Paid plan fields are already reserved server-side through account entitlements.
Login protection
Email-code login is protected by Cloudflare Turnstile when TURNSTILE_SECRET is configured on the backend. The widget uses action turnstile-spin-v2, and the backend verifies the token before sending email.