Resumen
Crea flujos de enlaces cortos, cargas, estadísticas y acceso de pago con la API de URLZ. Esta referencia separa las integraciones de servidor con clave API de las sesiones de cuenta autenticadas.
Servidor a servidor
Usa la clave API activa para crear y buscar enlaces desde un backend, una automatización o una herramienta interna.
apikey=YOUR_API_KEYSesión de cuenta
Usa una sesión Bearer para enlaces, cargas, estadísticas y monetización de la cuenta.
Authorization: Bearer …Inicio rápido
Crea tu primer enlace corto en tres pasos y consulta la referencia detallada para producción.
- 1Crear una cuenta
Abre el panel y activa un plan API.
- 2Copiar la clave API
Guárdala en tu servidor y no la expongas en código público.
- 3Enviar la solicitud
Envía el destino y lee result.short_url en la respuesta JSON.
curl -X POST "https://api.urlz.li/url/create" \
--data-urlencode "apikey=YOUR_API_KEY" \
--data-urlencode "fullUrl=https://example.com/private-report"
// Server-side JavaScript (Node.js)
const body = new URLSearchParams({
apikey: 'YOUR_API_KEY',
fullUrl: 'https://example.com/private-report'
});
const response = await fetch('https://api.urlz.li/url/create', {
method: 'POST',
body
});
const data = await response.json();
console.log(data.result.short_url);
$request = curl_init('https://api.urlz.li/url/create');
curl_setopt_array($request, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'apikey' => 'YOUR_API_KEY',
'fullUrl' => 'https://example.com/private-report',
]),
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($request), true, 512, JSON_THROW_ON_ERROR);
echo $data['result']['short_url'];
import requests
response = requests.post(
"https://api.urlz.li/url/create",
data={
"apikey": "YOUR_API_KEY",
"fullUrl": "https://example.com/private-report",
},
timeout=15,
)
response.raise_for_status()
print(response.json()["result"]["short_url"])
Autenticación
URLZ admite dos modos de autenticación. Elige el adecuado para tu integración.
Clave API
Para integraciones backend. Envía apikey en la URL o el formulario. La clave y la suscripción deben estar activas.
apikey=YOUR_API_KEYSesión Bearer
Para funciones de cuenta. Obtén un token en el endpoint de acceso y envíalo en Authorization.
Authorization: Bearer SESSION_TOKENNo publiques claves API, contraseñas ni tokens Bearer en JavaScript, registros móviles, control de versiones o repositorios públicos.
Índice de endpoints
Selecciona un endpoint para ver sus parámetros y ejemplos de solicitud y respuesta.
/url/createCrear un enlace corto
GET/url/listListar y filtrar enlaces
POST/mobile/v1/auth/login.phpAbrir una sesión de cuenta
POST/mobile/v1/shorten.phpCrear un enlace de cuenta
POST/mobile/v1/upload.phpSubir un archivo o foto
GET/mobile/v1/links.phpListar enlaces de la cuenta
GET/mobile/v1/clicks.phpConsultar estadísticas de clics
DELETE/mobile/v1/delete-link.phpEliminar un enlace
POST/mobile/v1/collaboration/configure.phpEnable URLZ Chat or URLZ Request
GET/mobile/v1/collaboration/chats.phpList link conversations
GET/mobile/v1/collaboration/requests.phpTrack document requests
POST/mobile/v1/monetization/links.phpCrear o convertir un enlace de pago
POST/mobile/v1/monetization/upload.phpCrear un archivo o foto de pago
GET/mobile/v1/monetization/links.phpListar enlaces de pago
GET/mobile/v1/monetization/transactions.phpListar ventas de enlaces de pago
Endpoints con clave API
Rutas estables de servidor a servidor para crear y buscar enlaces cortos.
/url/createCrear un enlace corto
Crea una URL corta con una clave API activa.
apikeyParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
apikey | string | Sí | — |
fullUrl | URL | Sí | — |
encrypt | string | No | "" |
password | string | No | "" |
curl -X POST "https://api.urlz.li/url/create" \
--data-urlencode "apikey=YOUR_API_KEY" \
--data-urlencode "fullUrl=https://example.com/report.pdf"
{
"result": {
"short_url": "https://urlz.li/7b3c2e5a",
"hash": "7b3c2e5a",
"date": "2026-11-02",
"time": "14:32:10"
}
}
/url/listListar y filtrar enlaces
Devuelve los enlaces de una clave API con filtros y paginación.
apikeyParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
apikey | string | Sí | — |
limit | integer (1–1000) | No | 100 |
offset | integer | No | 0 |
order | asc | desc | No | desc |
date | YYYY-MM-DD | No | — |
from_date | YYYY-MM-DD | No | — |
to_date | YYYY-MM-DD | No | — |
url_destination | string | No | — |
hash | string | No | — |
curl -G "https://api.urlz.li/url/list" \
--data-urlencode "apikey=YOUR_API_KEY" \
--data-urlencode "limit=25" \
--data-urlencode "order=desc"
{
"result": {
"filters": { "limit": 25, "offset": 0, "order": "desc" },
"total": 42,
"count": 25,
"items": [
{
"id": 1204,
"date": "2026-11-02",
"time": "14:32:10",
"destination": "https://example.com/report.pdf",
"hash": "7b3c2e5a",
"hash_retour": "https://urlz.li/7b3c2e5a"
}
]
}
}
Endpoints de cuenta
Enlaces de cuenta, cargas, estadísticas de clics y eliminación.
/mobile/v1/auth/login.phpAbrir una sesión de cuenta
Cambia las credenciales por un token de sesión Bearer.
Sin autenticaciónParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
email | Sí | — | |
password | string | Sí | — |
curl -X POST "https://api.urlz.li/mobile/v1/auth/login.php" \
-H "Content-Type: application/json" \
-d '{"email":"developer@example.com","password":"YOUR_PASSWORD"}'
{
"token": "SESSION_TOKEN",
"user": {
"id": 42,
"email": "developer@example.com",
"apiKey": "ACCOUNT_API_KEY",
"planActive": true
}
}
/mobile/v1/shorten.phpCrear un enlace de cuenta
Crea un enlace normal o protegido. El token Bearer es opcional salvo si se usa contraseña.
Token Bearer opcionalParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
url | URL | Sí | — |
password | string (min. 4) | No | — |
curl -X POST "https://api.urlz.li/mobile/v1/shorten.php" \
-H "Authorization: Bearer SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/private","password":"safe-pass"}'
{
"shortUrl": "https://urlz.li/Ab3dE91x",
"destination": "https://example.com/private",
"hash": "Ab3dE91x",
"protected": true
}
/mobile/v1/upload.phpSubir un archivo o foto
Sube un archivo permitido de hasta 10 MB y devuelve una URL corta.
Token Bearer opcionalParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
file | multipart file | Sí | — |
kind | photo | document | No | document |
password | string (min. 4) | No | — |
curl -X POST "https://api.urlz.li/mobile/v1/upload.php" \
-H "Authorization: Bearer SESSION_TOKEN" \
-F "file=@./photo.jpg" \
-F "kind=photo"
{
"shortUrl": "https://urlz.li/P8kLm21q",
"destination": "https://urlz.li/cloud/app/photo_….jpg",
"hash": "P8kLm21q",
"protected": false
}
/mobile/v1/links.phpListar enlaces de la cuenta
Lista enlaces, clics, protección y monetización de la cuenta.
BearerParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
limit | integer (1–100) | No | 100 |
offset | integer | No | 0 |
curl "https://api.urlz.li/mobile/v1/links.php?limit=25&offset=0" \
-H "Authorization: Bearer SESSION_TOKEN"
{
"items": [
{
"id": 1204,
"shortUrl": "https://urlz.li/7b3c2e5a",
"destination": "https://example.com/report.pdf",
"protected": false,
"monetized": true,
"clicks": 18
}
],
"total": 42,
"summary": { "totalLinks": 42, "totalClicks": 304, "clicksLast7Days": 28 }
}
/mobile/v1/clicks.phpConsultar estadísticas de clics
Devuelve clics, visitantes únicos, países principales y accesos paginados.
BearerParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
linkId | integer | Sí | — |
limit | integer (1–100) | No | 100 |
offset | integer | No | 0 |
curl "https://api.urlz.li/mobile/v1/clicks.php?linkId=1204&limit=25" \
-H "Authorization: Bearer SESSION_TOKEN"
{
"link": { "id": 1204, "shortUrl": "https://urlz.li/7b3c2e5a" },
"summary": {
"totalClicks": 18,
"uniqueVisitors": 14,
"clicksLast24Hours": 2,
"clicksLast7Days": 9
},
"countries": [{ "country": "France", "countryCode": "FR", "clicks": 8 }],
"items": []
}
/mobile/v1/delete-link.phpEliminar un enlace
Elimina solo un enlace propiedad de la cuenta autenticada.
BearerParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
hash | string | Sí | — |
curl -X DELETE "https://api.urlz.li/mobile/v1/delete-link.php" \
-H "Authorization: Bearer SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"hash":"7b3c2e5a"}'
{
"ok": true,
"message": "Link deleted."
}
URLZ Chat & Request
Add private conversations, collect requested documents, schedule reminders and track submissions.
/mobile/v1/collaboration/configure.phpEnable URLZ Chat or URLZ Request
Attach a private conversation and/or a document request to an existing account link. A Bearer session token or API key is accepted.
Bearer or API keyParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
hash | string | Sí | — |
chat.enabled | boolean | No | false |
request.enabled | boolean | No | false |
request.title | string | No | — |
request.items | string[] | No | [] |
request.recipients | email[] | No | [] |
request.deadline | ISO datetime | No | — |
request.paymentRequired | boolean | No | false |
curl -X POST "https://api.urlz.li/mobile/v1/collaboration/configure.php" \
-H "Authorization: Bearer SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"hash":"7b3c2e5a","chat":{"enabled":true},"request":{"enabled":true,"title":"Accounting documents","items":["Invoices","Bank statement"]}}'
{"featureId":14,"hash":"7b3c2e5a","chatEnabled":true,"requestEnabled":true}
/mobile/v1/collaboration/chats.phpList link conversations
Return chat-enabled links and message totals. Add id to retrieve messages.
BearerParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
id | integer | No | — |
after | integer | No | 0 |
curl "https://api.urlz.li/mobile/v1/collaboration/chats.php?id=14" \
-H "Authorization: Bearer SESSION_TOKEN"
{"items":[{"id":14,"hash":"7b3c2e5a","messageCount":3,"messages":[]}]}
/mobile/v1/collaboration/requests.phpTrack document requests
List requests, expected items, recipients, submissions and secure files. Add id for full detail.
BearerParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
id | integer | No | — |
curl "https://api.urlz.li/mobile/v1/collaboration/requests.php?id=14" \
-H "Authorization: Bearer SESSION_TOKEN"
{"items":[{"id":14,"title":"Accounting documents","recipients":1,"submissions":1,"files":2}]}
Endpoints de enlaces de pago
Crea accesos de pago y consulta ventas de una cuenta de creador autenticada.
/mobile/v1/monetization/links.phpCrear o convertir un enlace de pago
Crea una URL de pago o convierte un enlace existente en acceso de pago.
BearerParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
destination | URL | No | — |
existingLinkId | integer | No | — |
title | string (max. 180) | Sí | — |
description | string (max. 3000) | No | — |
price | decimal | Sí | — |
currency | EUR | USD | Sí | USD |
accessPolicy | permanent | timed | limited | No | permanent |
accessDurationHours | integer (1–8760) | No | 24 |
maxAccesses | integer (1–1000) | No | 1 |
locale | ISO 639-1 | No | en |
curl -X POST "https://api.urlz.li/mobile/v1/monetization/links.php" \
-H "Authorization: Bearer SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"destination":"https://example.com/private-course",
"title":"Private course access",
"description":"One-time access to the course.",
"price":"9.90",
"currency":"EUR",
"accessPolicy":"permanent",
"locale":"en"
}'
{
"id": 91,
"hash": "cd3ed9a4",
"shortUrl": "https://urlz.li/cd3ed9a4",
"paywallUrl": "https://urlz.li/en/pay/cd3ed9a4/",
"converted": false
}
/mobile/v1/monetization/upload.phpCrear un archivo o foto de pago
Guarda un archivo de forma privada y crea un enlace de pago. Máximo: 50 MB.
BearerParámetros
| Parámetro | Tipo | Obligatorio | Predeterminado |
|---|---|---|---|
file | multipart file | Sí | — |
kind | photo | file | No | file |
title | string (max. 180) | Sí | — |
description | string (max. 3000) | No | — |
price | decimal | Sí | — |
currency | EUR | USD | Sí | USD |
accessPolicy | permanent | timed | limited | No | permanent |
locale | ISO 639-1 | No | en |
curl -X POST "https://api.urlz.li/mobile/v1/monetization/upload.php" \
-H "Authorization: Bearer SESSION_TOKEN" \
-F "file=@./premium-photo.jpg" \
-F "kind=photo" \
-F "title=Premium event photo" \
-F "price=4.90" \
-F "currency=EUR"
{
"id": 92,
"hash": "e71f8a20",
"shortUrl": "https://urlz.li/e71f8a20",
"paywallUrl": "https://urlz.li/en/pay/e71f8a20/"
}
/mobile/v1/monetization/links.phpListar enlaces de pago
Devuelve enlaces de pago con ventas, ingresos brutos, netos y estado.
Bearercurl "https://api.urlz.li/mobile/v1/monetization/links.php" \
-H "Authorization: Bearer SESSION_TOKEN"
{
"items": [
{
"id": 91,
"shortUrl": "https://urlz.li/cd3ed9a4",
"kind": "url",
"priceMinor": 990,
"currency": "EUR",
"status": "active",
"sales": 4,
"grossMinor": 3960,
"netMinor": 3374
}
]
}
/mobile/v1/monetization/transactions.phpListar ventas de enlaces de pago
Devuelve pedidos, comisiones del procesador y URLZ, ingreso neto y fecha de liberación.
Bearercurl "https://api.urlz.li/mobile/v1/monetization/transactions.php" \
-H "Authorization: Bearer SESSION_TOKEN"
{
"items": [
{
"orderNumber": "LNK-20261102-8F3C21",
"grossMinor": 990,
"platformFeeMinor": 69,
"processorFeeMinor": 45,
"netMinor": 876,
"currency": "EUR",
"status": "paid",
"fundsAvailableAt": "2026-11-16 14:32:10",
"fundsStatus": "held"
}
]
}
Errores y códigos HTTP
Los endpoints modernos devuelven JSON con message; los de clave API usan error. Basa siempre la lógica en el estado HTTP.
{ "message": "A valid link is required." }{ "error": "Invalid API key" }La solicitud se completó.
Se creó el enlace o archivo.
JSON o sintaxis incorrectos.
Falta el token o ha caducado.
La clave, el plan o la cuenta no permite la acción.
El recurso no existe.
El estado solicitado entra en conflicto.
Faltan campos o son inválidos.
Reduce el ritmo y reintenta gradualmente.
Reintenta más tarde de forma idempotente.
Seguridad y límites
Aplica estas reglas en toda integración de producción.
- Usa únicamente HTTPS.
- Mantén privadas las claves API y renuévalas con regularidad.
- Valida y codifica los parámetros introducidos por usuarios.
- Usa paginación en listas y registros.
- Máximo recomendado: 10 solicitudes por segundo y clave.
Envía el endpoint, el estado HTTP y una solicitud depurada. Nunca incluyas credenciales.
