Links
Create, list, update, and delete short links. QR codes use the same endpoints with type: "QR".
POST
/api/v1/linksCreate a new short link or QR code.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | Required | The destination URL to shorten |
| domain | string | Optional | Domain for the short link (default: "u2l.ai") |
| alias | string | Optional | Custom slug. Auto-generated if omitted |
| title | string | Optional | A user-friendly title for the link |
| tags | string[] | Optional | Array of tags for categorizationPro+ |
| folderId | string | Optional | Folder ID to organize the link intoPro+ |
| type | string | Optional | "SL" (short link) or "QR" (QR code). Default: "SL" |
| permanent | boolean | Optional | 301 (true) or 302 (false) redirect. Default: true |
| password | string | Optional | Password-protect the linkAdvanced+ |
| expiresAt | number | Optional | Unix timestamp (ms) when the link expiresAdvanced+ |
| customOg | object | Optional | Custom social preview: { title, description, image }Advanced+ |
| abTest | object | Optional | A/B testing: { enabled, destinationB, splitPercentage }Advanced+ |
Create a short link
curl -X POST https://u2l.ai/api/v1/links \
-H "Authorization: Bearer u2l_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/my-page",
"alias": "my-link",
"title": "My Marketing Link",
"tags": ["marketing", "q1"]
}'201 Created
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"shortLink": "https://u2l.ai/my-link",
"domain": "u2l.ai",
"slug": "my-link",
"destination": "https://example.com/my-page",
"title": "My Marketing Link",
"tags": ["marketing", "q1"],
"hasPassword": false,
"expiresAt": null,
"permanent": true,
"type": "SL",
"createdAt": "2026-02-11T10:00:00.000Z",
"updatedAt": "2026-02-11T10:00:00.000Z",
"folderId": null,
"clicks": 0
}GET
/api/v1/linksList all links with pagination, filtering, and sorting. Returns links across all domains by default.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | number | Optional | Page number (default: 1) |
| limit | number | Optional | Items per page, max 100 (default: 25) |
| type | string | Optional | Filter by type: "SL" or "QR" |
| domain | string | Optional | Filter by domain |
| folderId | string | Optional | Filter by folder ID |
| tag | string | Optional | Filter by tag |
| search | string | Optional | Search in slug, destination, and title |
| sort | string | Optional | Sort field: "createdAt", "clicks", or "title" |
| order | string | Optional | "asc" or "desc" (default: "desc") |
List links
curl "https://u2l.ai/api/v1/links?page=1&limit=25&sort=createdAt&order=desc" \
-H "Authorization: Bearer u2l_live_your_api_key"200 OK
{
"links": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"shortLink": "https://u2l.ai/my-link",
"domain": "u2l.ai",
"slug": "my-link",
"destination": "https://example.com/my-page",
"title": "My Marketing Link",
"tags": ["marketing", "q1"],
"hasPassword": false,
"expiresAt": null,
"permanent": true,
"type": "SL",
"createdAt": "2026-02-11T10:00:00.000Z",
"updatedAt": "2026-02-11T10:00:00.000Z",
"folderId": null,
"clicks": 142
}
],
"pagination": {
"page": 1,
"limit": 25,
"total": 142,
"totalPages": 6,
"hasMore": true
}
}GET
/api/v1/links/{domain}/{slug}Retrieve a single link by its domain and slug.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| domain | string | Required | The link's domain (e.g., "u2l.ai") |
| slug | string | Required | The link's slug (e.g., "my-link") |
Get a link
curl "https://u2l.ai/api/v1/links/u2l.ai/my-link" \
-H "Authorization: Bearer u2l_live_your_api_key"200 OK
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"shortLink": "https://u2l.ai/my-link",
"domain": "u2l.ai",
"slug": "my-link",
"destination": "https://example.com/my-page",
"title": "My Marketing Link",
"tags": ["marketing", "q1"],
"hasPassword": false,
"expiresAt": null,
"permanent": true,
"type": "SL",
"createdAt": "2026-02-11T10:00:00.000Z",
"updatedAt": "2026-02-11T10:00:00.000Z",
"folderId": null,
"clicks": 142
}PATCH
/api/v1/links/{domain}/{slug}Update an existing link. Only send the fields you want to change.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| domain | string | Required | The link's domain (e.g., "u2l.ai") |
| slug | string | Required | The link's slug (e.g., "my-link") |
Request Body (all fields optional)
| Name | Type | Required | Description |
|---|---|---|---|
| destination | string | Optional | New destination URL |
| title | string | Optional | Updated title |
| tags | string[] | Optional | Updated tags arrayPro+ |
| password | string | Optional | Set or update passwordAdvanced+ |
| expiresAt | number | Optional | Updated expiration timestampAdvanced+ |
| permanent | boolean | Optional | Update redirect type |
| customOg | object | Optional | Update social previewAdvanced+ |
| abTest | object | Optional | Update A/B testing configAdvanced+ |
Update a link
curl -X PATCH "https://u2l.ai/api/v1/links/u2l.ai/my-link" \
-H "Authorization: Bearer u2l_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"destination": "https://example.com/new-page",
"title": "Updated Title"
}'200 OK
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"shortLink": "https://u2l.ai/my-link",
"domain": "u2l.ai",
"slug": "my-link",
"destination": "https://example.com/new-page",
"title": "Updated Title",
"tags": ["marketing", "q1"],
"hasPassword": false,
"expiresAt": null,
"permanent": true,
"type": "SL",
"createdAt": "2026-02-11T10:00:00.000Z",
"updatedAt": "2026-02-11T12:30:00.000Z",
"folderId": null,
"clicks": 142
}DELETE
/api/v1/links/{domain}/{slug}Permanently delete a link. This removes it from both the edge cache and the database.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| domain | string | Required | The link's domain (e.g., "u2l.ai") |
| slug | string | Required | The link's slug (e.g., "my-link") |
Delete a link
curl -X DELETE "https://u2l.ai/api/v1/links/u2l.ai/my-link" \
-H "Authorization: Bearer u2l_live_your_api_key"200 OK
{
"message": "Link deleted successfully"
}