Link brevi
Tutte le route dei link brevi, con per ciascuna un esempio di richiesta e la risposta restituita. Un link si indica con il suo identificativo o con il suo indirizzo personalizzato (slug).
- GET
/v1/linksElencare i link brevi - POST
/v1/linksAccorciare un indirizzo - GET
/v1/links/{id}Leggere un link breve - PATCH
/v1/links/{id}Modificare un link breve - DELETE
/v1/links/{id}Eliminare un link breve
Elencare i link brevi
GET/v1/links
I link brevi dello spazio di lavoro, dal più recente al più vecchio. Ambito Lettura.
?search=— cerca nella destinazione, nell'indirizzo personalizzato e nell'identificativo?tag=— identificativo di un tag: solo i link che lo portano?page=e?per_page=— paginazione, 50 per pagina per impostazione predefinita, 100 al massimo
curl "https://api.tinylink.fr/v1/links?search=promo" \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/links?search=promo', {
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links?search=promo');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/links?search=promo',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
data = response.json()
Risposte possibili
{
"data": [
{
"id": "6ac401093831b",
"type": "link",
"target_url": "https://exemple.fr/promo",
"slug": "promo",
"url": "https://tnlnk.fr/promo",
"status": "active",
"password_protected": false,
"restricted": false,
"tags": [],
"qr_code": null,
"created_at": "2026-10-05T21:56:57+02:00",
"edit_url": "https://app.tinylink.fr/shortener-edit?id=6ac401093831b"
}
],
"pagination": {
"page": 1,
"per_page": 50,
"total": 1,
"total_pages": 1
}
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Lettura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Accorciare un indirizzo
POST/v1/links
url è obbligatorio: un indirizzo web, un'e-mail o un telefono. La risposta è il link creato; url vi è l'indirizzo breve, target_url la destinazione. Ambito Scrittura.
url— la destinazione, 500 caratteri al massimoslug— l'indirizzo personalizzato: lettere, numeri,-,_e., 40 caratteri al massimopassword— protegge il link con una passwordtags— elenco di identificativi di tag dello spazio di lavoroqr_code—trueper il codice QR classico,"none"senza logo, oppure l'identificativo di un modello
curl -X POST https://api.tinylink.fr/v1/links \
-H "Authorization: Bearer tl_il_tuo_token" \
-H "Content-Type: application/json" \
-d '{
"url": "https://exemple.fr/promo",
"slug": "promo",
"qr_code": "none"
}'
const response = await fetch('https://api.tinylink.fr/v1/links', {
method: 'POST',
headers: {
Authorization: 'Bearer tl_il_tuo_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://exemple.fr/promo',
slug: 'promo',
qr_code: 'none',
}),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://exemple.fr/promo',
'slug' => 'promo',
'qr_code' => 'none',
]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.post(
'https://api.tinylink.fr/v1/links',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
json={
'url': 'https://exemple.fr/promo',
'slug': 'promo',
'qr_code': 'none',
},
)
data = response.json()
Risposte possibili
{
"id": "6ac401093831b",
"type": "link",
"target_url": "https://exemple.fr/promo",
"slug": "promo",
"url": "https://tnlnk.fr/promo",
"status": "active",
"password_protected": false,
"restricted": false,
"tags": [],
"qr_code": {
"png": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.png",
"svg": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.svg",
"template": "none",
"shape": "square",
"encoded_url": "https://tnlnk.fr/6ac401093831b&qr"
},
"created_at": "2026-10-05T21:56:57+02:00",
"edit_url": "https://app.tinylink.fr/shortener-edit?id=6ac401093831b"
} Il corpo non è un oggetto JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Numero di link brevi del piano raggiunto
{
"error": {
"code": "plan_limit_reached",
"message": "The link limit of the plan has been reached."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Scrittura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Indirizzo personalizzato già usato da una pagina o da un link
{
"error": {
"code": "slug_taken",
"message": "This slug is already taken.",
"details": {
"field": "slug"
}
}
} Campo obbligatorio assente o vuoto
{
"error": {
"code": "validation_failed",
"message": "The \"url\" field is required (a string).",
"details": {
"field": "url"
}
}
} Né indirizzo web, né e-mail, né telefono
{
"error": {
"code": "invalid_url",
"message": "This is not a valid web address, e-mail address or phone number.",
"details": {
"field": "url"
}
}
} Dominio segnalato come sospetto
{
"error": {
"code": "suspicious_url",
"message": "This address is on our list of suspicious domains and cannot be used.",
"details": {
"field": "url"
}
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Leggere un link breve
GET/v1/links/{id}
status vale active, pending_review (in fase di verifica, il link non reindirizza ancora) oppure blocked. Ambito Lettura.
curl https://api.tinylink.fr/v1/links/promo \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/links/promo', {
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links/promo');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/links/promo',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
data = response.json()
Risposte possibili
{
"id": "6ac401093831b",
"type": "link",
"target_url": "https://exemple.fr/promo",
"slug": "promo",
"url": "https://tnlnk.fr/promo",
"status": "active",
"password_protected": false,
"restricted": false,
"tags": [],
"qr_code": {
"png": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.png",
"svg": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.svg",
"template": "none",
"shape": "square",
"encoded_url": "https://tnlnk.fr/6ac401093831b&qr"
},
"created_at": "2026-10-05T21:56:57+02:00",
"edit_url": "https://app.tinylink.fr/shortener-edit?id=6ac401093831b"
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Lettura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Modificare un link breve
PATCH/v1/links/{id}
Invia solo i campi da cambiare: url (la destinazione), slug, password. null rimuove l'indirizzo personalizzato o la password. Cambiare la destinazione non cambia l'indirizzo breve. Ambito Scrittura.
curl -X PATCH https://api.tinylink.fr/v1/links/6ac401093831b \
-H "Authorization: Bearer tl_il_tuo_token" \
-H "Content-Type: application/json" \
-d '{"url":"https://exemple.fr/soldes"}'
const response = await fetch('https://api.tinylink.fr/v1/links/6ac401093831b', {
method: 'PATCH',
headers: {
Authorization: 'Bearer tl_il_tuo_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({ url: 'https://exemple.fr/soldes' }),
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links/6ac401093831b');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['url' => 'https://exemple.fr/soldes']),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.patch(
'https://api.tinylink.fr/v1/links/6ac401093831b',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
json={'url': 'https://exemple.fr/soldes'},
)
data = response.json()
Risposte possibili
{
"id": "6ac401093831b",
"type": "link",
"target_url": "https://exemple.fr/soldes",
"slug": "promo",
"url": "https://tnlnk.fr/promo",
"status": "active",
"password_protected": false,
"restricted": false,
"tags": [],
"qr_code": {
"png": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.png",
"svg": "https://content.tinylink.fr/QR_Code/QRCode_6ac4011f7a12f.svg",
"template": "none",
"shape": "square",
"encoded_url": "https://tnlnk.fr/6ac401093831b&qr"
},
"created_at": "2026-10-05T21:56:57+02:00",
"edit_url": "https://app.tinylink.fr/shortener-edit?id=6ac401093831b"
} Il corpo non è un oggetto JSON
{
"error": {
"code": "invalid_json",
"message": "The request body must be a JSON object."
}
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Scrittura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope.",
"details": {
"required_scope": "write"
}
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Indirizzo personalizzato già usato da una pagina o da un link
{
"error": {
"code": "slug_taken",
"message": "This slug is already taken.",
"details": {
"field": "slug"
}
}
} Nessun campo modificabile nel corpo
{
"error": {
"code": "validation_failed",
"message": "Nothing to update. Accepted fields: url, slug, password."
}
} Né indirizzo web, né e-mail, né telefono
{
"error": {
"code": "invalid_url",
"message": "This is not a valid web address, e-mail address or phone number.",
"details": {
"field": "url"
}
}
} Elemento bloccato dalla moderazione
{
"error": {
"code": "element_blocked",
"message": "This element is blocked by moderation and can no longer be modified."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Eliminare un link breve
DELETE/v1/links/{id}
Elimina il link, il suo codice QR e le sue statistiche: l'indirizzo breve smette di reindirizzare. Irreversibile. Ambito Eliminazione.
curl -X DELETE https://api.tinylink.fr/v1/links/6ac401093831b \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/links/6ac401093831b', {
method: 'DELETE',
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
console.log(response.status); // 204
$ch = curl_init('https://api.tinylink.fr/v1/links/6ac401093831b');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE); // 204
curl_close($ch);
import requests
response = requests.delete(
'https://api.tinylink.fr/v1/links/6ac401093831b',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
print(response.status_code) # 204
Risposte possibili
Senza contenuto
Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} Il token non ha l'ambito Eliminazione
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"delete\" scope.",
"details": {
"required_scope": "delete"
}
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
}