Skip to main content

API Reference

The complete, always-current API reference is generated from the API's OpenAPI 3.1 specification and served directly by the API.

Interactive Swagger UI​

Browse and try every endpoint — with request/response schemas, auth, and examples — in the hosted Swagger UI:

https://api.short.leonai.io/api/v1/docs

Open the full API Reference (Swagger UI) →

Machine-readable spec​

The canonical OpenAPI document lives at:

https://api.short.leonai.io/api/v1/openapi.json

Use it to generate clients, run contract tests, or import into Postman / Insomnia:

# Download the spec
curl -o leonai-openapi.json https://api.short.leonai.io/api/v1/openapi.json

# Example: generate a client with openapi-generator
npx @openapitools/openapi-generator-cli generate \
-i https://api.short.leonai.io/api/v1/openapi.json \
-g typescript-fetch \
-o ./leonai-client
SDKs

TypeScript and Python SDKs with retries, rate-limit parsing, auto-pagination and typed errors are on the way. Until they are published, a client generated from the spec is the typed option.

Base URL & versioning​

All versioned endpoints live under the /api/v1 prefix on the API host. Short links and public QR images are served from the redirect host at the root (/:shortCode, /:shortCode/qr).

EnvironmentBase URL
Productionhttps://api.short.leonai.io
Local developmenthttp://localhost:8080

Endpoint tags​

The reference is organized by tag:

TagWhat's inside
LinksCreate, list, get, update, delete, bulk import, export, and per-link stats
FoldersNested folders and link-to-folder assignment
AnalyticsLink/account analytics, real-time stats, CSV exports, and conversion reports
ConversionsRecord conversions for revenue attribution (Business+, API key only)
SharesPublic, PII-free shareable analytics tokens
PixelsRetargeting pixels and per-link attachment (Business+)
BrandingWhite-label branding for public pages (Enterprise)
ImportsOne-click Bitly import
DomainsCustom domains — manual DNS verification and one-click Cloudflare auto-connect
RoutingSmart routing rules (geo / device / time / A/B) per link (Business+)
WebhooksWebhook endpoints, HMAC-signed deliveries, and delivery logs
Bio PagesLink-in-bio pages, items, publishing, and public resolution
QR CodesPublic QR image generation for short links
AISlug suggestions, link insights (Business+), anomaly detection, provider status
PublicUnauthenticated endpoints: redirects, link previews, public bio pages
AuthSignup, login, tokens, email verification, password reset
2FATOTP two-factor: setup, enable, disable, verify, status
UsersAccount data export, deletion, and consent (GDPR/CCPA)
API KeysProgrammatic access keys and scopes
BillingSubscription, checkout, invoices, and portal — Sumit (OfficeGuy), USD
TeamsTeam collaboration, members, invites, and RBAC roles
Billing provider

Billing runs on Sumit / OfficeGuy (US dollars, VAT invoices). The legacy Stripe integration has been removed. See the Billing guide.

See Authentication for headers, Errors for the error envelope, and the coverage map for a checklist of every endpoint and webhook event documented here.