URL shortener API
Create and manage short links programmatically with a simple REST API. Authenticate with a Bearer key, create branded links with custom aliases, set expiration, and read click analytics — the same capabilities as the dashboard, over HTTP.
What you can do with the API
Anything you'd do by hand in the dashboard, you can automate: shorten URLs at scale, create branded links with custom back-halves, set expiration and passwords, organize links into folders, pull click analytics into your own reports, and subscribe to webhooks for link events. It's the foundation for automating campaigns, powering internal tools, and building short links into your own product.
Create a short link in one request
Send a POST to /api/v1/links with your destination URL. Only url is required; add an alias, domain, tags, expiration, or a password as you like.
curl -X POST https://u2l.ai/api/v1/links \
-H "Authorization: Bearer u2l_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/a/very/long/path",
"alias": "spring-sale",
"tags": ["campaign"]
}' {
"id": "lnk_…",
"shortLink": "https://u2l.ai/spring-sale",
"slug": "spring-sale",
"destination": "https://example.com/a/very/long/path",
"createdAt": "2026-01-01T00:00:00.000Z"
} Authentication
Generate an API key in the dashboard under Settings > API. Keys start with u2l_live_ and are sent as a Bearer token:
Authorization: Bearer u2l_live_... Keep your key server-side. Every response includes X-RateLimit-* headers so your client always knows where it stands against your plan's limits.
Core endpoints
The full reference lives in the developer docs and the OpenAPI 3.1 spec. The ones you'll reach for most:
| Method | Path | Purpose |
|---|---|---|
POST | /api/v1/links | Create a short link |
GET | /api/v1/links | List your links |
GET | /api/v1/links/:domain/:slug | Fetch one link |
PATCH | /api/v1/links/:domain/:slug | Update a link |
DELETE | /api/v1/links/:domain/:slug | Delete a link |
GET | /api/v1/analytics/:domain/:slug | Read a link's click analytics |
GET | /api/v1/domains | List your connected domains |
GET | /api/v1/account | Account info and usage |
Available on every plan, not just the top tier
A common frustration with other shorteners is that the API is locked to the highest plans. U2L includes an API key on every plan, including the free tier, so you can prototype and ship without an upgrade first. Request rates and creation velocity scale up as you move to higher plans, and the exact limits are always reflected in the response headers — no guessing.
URL shortener API FAQ
Is the URL shortener API free?+
API access is available on every plan, including the free tier, which includes an API key. Request rates and link-creation velocity scale per plan, so higher plans get higher limits, but you don't have to be on a paid tier to start building.
How do I authenticate?+
Every request uses a Bearer API key that looks like u2l_live_... You generate it in the dashboard under Settings > API and send it in the Authorization header: Authorization: Bearer u2l_live_...
Is there a rate limit?+
Yes. Limits are applied per plan on a per-minute and per-day basis, and every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers so your client can back off gracefully.
Can I set a custom alias or branded domain via the API?+
Yes. Pass an alias for a custom back-half, and pass your connected domain to brand the link. If you omit the domain, U2L picks a default; if you omit the alias, a slug is generated.
Can I read click analytics through the API?+
Yes. There's a per-link analytics endpoint plus an account stats endpoint, so you can pull click data into your own dashboards and reports.
Can links created via the API expire?+
Yes. Set an expiration and an optional redirect for after it expires, along with tags, a title, and password protection, all in the create request.
Is there an SDK?+
The API is plain JSON REST, so any HTTP client works — curl, fetch, requests, or Go's net/http. A public OpenAPI 3.1 spec is published under /developers, so you can also generate a typed client for your language of choice.
What can I do with the API besides creating links?+
List, update, and delete links; organize them into folders; manage connected domains; read analytics; and register webhooks so U2L can notify your systems on link events.
What format does the API return?+
JSON. Creating a link returns the short link, its slug, the destination, and metadata like the created timestamp and id.
How is this different from Bitly's or TinyURL's API?+
The main difference is access: U2L's API is available on every plan rather than gated behind higher tiers, and it exposes branded domains, analytics, and link controls through the same simple Bearer-key REST interface.
Start building with the API
Create a free account, generate a key under Settings > API, and shorten your first link with a single request.