Short Links Management
This section documents the endpoints available for creating, managing, and tracking short links. Short links allow you to create branded redirects using custom domains with advanced routing rules (Geo-targeting, Device-targeting, etc.).
Base URL
https://api.multi-upload-tool.com/api/v1
Authentication
All requests require an API Token in the header:
x-api-key: YOUR_API_TOKEN
List Short Links
Retrieve a list of short links you have created.
Endpoint
GET /short-links
Query Parameters
No specific query parameters are strictly required, but the results are scoped to your user and optional team.
Example Request
curl -X GET "https://api.multi-upload-tool.com/api/v1/short-links" \
-H "x-api-key: YOUR_API_TOKEN"Example Response
[
{
"id": 101,
"slug": "my-campaign",
"url": "https://goleaf.link/my-campaign",
"destination": "https://mysite.com/landing",
"clicks": 150,
"isActive": true,
"createdAt": "2023-10-27T10:00:00.000Z"
}
]Create Short Link
Create a new short link with optional advanced routing rules.
Endpoint
POST /short-links
Content-Type
application/json
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The default destination URL where users will be redirected. |
domainId | integer | No | The ID of the custom domain to use (e.g. link.mybrand.com). If omitted, uses the default domain. Custom domains require a paid plan. |
slug | string | No | Custom alias for the link (e.g., summer-sale). If empty, one is generated. |
title | string | No | Metadata title for previews. |
description | string | No | Metadata description for previews. |
imageUrl | string | No | Metadata image URL for previews. |
useDeeplink | boolean | No | Whether to attempt deep linking app schemes (default: false). |
botProtection | boolean | No | Redirect bots to a safe URL instead of the money link (default: false). |
safeUrl | string | No | The URL to send bots to if protection is enabled. |
rules | array | No | List of advanced routing rules (see below). |
Rule Object Structure
Each rule object defines a condition and a destination. If the condition matches, the user is redirected to the specified destination.
Common Fields (All Rules)
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Rule type: geo, device, language, time, referer. |
destination | string | Yes | Where to redirect if the rule matches. |
priority | number | No | Order of execution (Higher numbers run first). If not set, defaults to last_priority + 1. If a priority already exists, all rules with equal or greater priority are incremented. |
Geo Rule (type: "geo")
Redirects based on the user’s country (IP-based).
| Field | Type | Required | Description |
|---|---|---|---|
countryCodes | string | Yes | Comma-separated ISO 3166-1 alpha-2 codes (e.g., US,FR,BE). |
Device Rule (type: "device")
Redirects based on the user’s device form factor and/or operating system.
| Field | Type | Required | Description |
|---|---|---|---|
devices | string | No | Comma-separated form factors: mobile, desktop, tablet. |
os | string | No | Comma-separated operating systems: ios, android, macos, windows, linux. |
Note: You can use
devices,os, or both. If both are provided, both conditions must match (AND logic). Example:devices="mobile"ANDos="ios"matches only iPhones (not iPads if considered tablet, and not Android phones).
Language Rule (type: "language")
Redirects based on the Accept-Language header.
| Field | Type | Required | Description |
|---|---|---|---|
languages | string | Yes | Comma-separated language codes (e.g., en,fr,es). |
Time Rule (type: "time")
Redirects during a specific time window.
| Field | Type | Required | Description |
|---|---|---|---|
startTime | string | Yes | ISO Date string (e.g. 2024-01-01T00:00:00Z). Start validity. |
endTime | string | Yes | ISO Date string. End validity. |
Referer Rule (type: "referer")
Redirects based on the source website (Referer header).
| Field | Type | Required | Description |
|---|---|---|---|
referers | string | Yes | Domain or keyword to match in Referer header (e.g. facebook.com). |
Example Request
curl -X POST "https://api.multi-upload-tool.com/api/v1/short-links" \
-H "x-api-key: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://mysite.com",
"slug": "promo-2024",
"domainId": 123,
"title": "Super Promo",
"botProtection": true,
"safeUrl": "https://google.com",
"rules": [
{
"type": "geo",
"destination": "https://mysite.com/fr",
"countryCodes": "FR,BE",
"priority": 10
},
{
"type": "device",
"destination": "https://mysite.com/app-download",
"devices": "mobile",
"os": "ios",
"priority": 5
}
]
}'Example Response
{
"id": 101,
"slug": "promo-2024",
"shortUrl": "https://goleaf.link/promo-2024",
"destination": "https://mysite.com",
"isActive": true
}Get Link Details
Retrieve full details of a specific link, including its stats and rules.
Endpoint
GET /short-links/:id
Example Request
curl -X GET "https://api.multi-upload-tool.com/api/v1/short-links/101" \
-H "x-api-key: YOUR_API_TOKEN"Example Response
{
"id": 101,
"slug": "promo-2024",
"destination": "https://mysite.com",
"clicks": 1250,
"rules": [
{ "type": "geo", "countryCodes": "FR", "destination": "..." }
],
"linkClicks": [
{ "country": "FR", "device": "mobile", "clickedAt": "..." }
]
}Update Short Link
Modify an existing short link. You can update metadata, destination, or replace the rules entirely.
Endpoint
PUT /short-links/:id
Body Parameters
Same as Create endpoint. Fields omitted will remain unchanged, but providing rules will replace the existing list of rules.
Example Request
curl -X PUT "https://api.multi-upload-tool.com/api/v1/short-links/101" \
-H "x-api-key: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"isActive": false,
"destination": "https://mysite.com/closed"
}'Delete Short Link
Permanently remove a short link. It will no longer redirect users.
Endpoint
DELETE /short-links/:id
Example Request
curl -X DELETE "https://api.multi-upload-tool.com/api/v1/short-links/101" \
-H "x-api-key: YOUR_API_TOKEN"Example Response
{
"success": true,
"message": "Link deleted"
}