Referencia de la API
Generada desde la especificación OpenAPI 3.1 de la API pública v1.
Servidor: https://lnk.ec/api/v1 · Autenticación: Bearer o cabecera X-Api-Key con una API key de lnk. · Descargar OpenAPI
- GET
/whoami - GET
/links - POST
/links - POST
/links/resolve - GET
/links/{id} - PATCH
/links/{id} - DELETE
/links/{id} - POST
/links/{id}/pause - POST
/links/{id}/resume - GET
/links/{id}/analytics - POST
/mcp
GET /whoami
Who am I. Returns the product, scopes, expiry and effective rate limits of the API key used in the request. Works with any valid key.
Scope requerido: Cualquier key válida
Respuestas
200 | Key information. | Whoami |
401 | Missing, invalid, expired or revoked key. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
GET /links
List links. Lists the links of the account, newest first, with cursor pagination.
Scope requerido: links:read
Parámetros
| Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
limit | query | integer | No | |
cursor | query | string | No | `nextCursor` of the previous page. |
status | query | "active" | "paused" | No | |
q | query | string | No | Free-text filter over title, destination and short code. |
Respuestas
200 | A page of links. | LinkList |
400 | The request is not valid (`invalid_request`, `invalid_json`). | Error |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
POST /links
Create a link. Creates a short link. Nested shorteners are expanded; unsafe domains are rejected. The account must have accepted the content policy once in the dashboard.
Scope requerido: links:write
Cuerpo de la petición
{
"url": "https://example.com",
"title": "string",
"accessLevel": "private"
}Respuestas
201 | The created link. | Link |
400 | The request is not valid (`invalid_request`, `invalid_json`). | Error |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
409 | Title already used by an active link. | Error |
422 | Destination not allowed or shortener could not be expanded. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
POST /links/resolve
Resolve a URL. Follows redirects and known shorteners and returns the final destination without creating anything.
Scope requerido: links:read
Cuerpo de la petición
{
"url": "https://example.com"
}Respuestas
200 | Resolution result. | Resolved |
400 | The request is not valid (`invalid_request`, `invalid_json`). | Error |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
422 | Shortener could not be expanded. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
502 | Destination could not be checked right now. | Error |
GET /links/{id}
Get a link. Returns one link by id.
Scope requerido: links:read
Parámetros
| Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
id | path | string | Sí | Link id (24-character hex string). |
Respuestas
200 | The link. | Link |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
404 | The link does not exist or belongs to another account. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
PATCH /links/{id}
Update a link. Changes title, destination or access level. The short code never changes. Send at least one field.
Scope requerido: links:write
Parámetros
| Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
id | path | string | Sí | Link id (24-character hex string). |
Cuerpo de la petición
{
"url": "https://example.com",
"title": "string",
"accessLevel": "private"
}Respuestas
200 | The updated link. | Link |
400 | The request is not valid (`invalid_request`, `invalid_json`). | Error |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
404 | The link does not exist or belongs to another account. | Error |
409 | Title already used. | Error |
422 | Destination not allowed. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
DELETE /links/{id}
Delete a link. Deletes a link. Its short code stops working.
Scope requerido: links:write
Parámetros
| Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
id | path | string | Sí | Link id (24-character hex string). |
Respuestas
200 | Deletion confirmation. | object |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
404 | The link does not exist or belongs to another account. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
POST /links/{id}/pause
Pause a link. Visitors stop being redirected until the link is resumed.
Scope requerido: links:write
Parámetros
| Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
id | path | string | Sí | Link id (24-character hex string). |
Respuestas
200 | The paused link. | Link |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
404 | The link does not exist or belongs to another account. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
POST /links/{id}/resume
Resume a link. Re-activates a paused link.
Scope requerido: links:write
Parámetros
| Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
id | path | string | Sí | Link id (24-character hex string). |
Respuestas
200 | The active link. | Link |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
404 | The link does not exist or belongs to another account. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
GET /links/{id}/analytics
Link analytics. Click counts grouped by country, region, city or date.
Scope requerido: analytics:read
Parámetros
| Nombre | En | Tipo | Obligatorio | Descripción |
|---|---|---|---|---|
id | path | string | Sí | Link id (24-character hex string). |
groupBy | query | "country" | "region" | "city" | "date" | No | |
from | query | string (date-time) | No | ISO 8601 start date (inclusive). |
to | query | string (date-time) | No | ISO 8601 end date (inclusive). |
Respuestas
200 | Grouped clicks. | Analytics |
400 | The request is not valid (`invalid_request`, `invalid_json`). | Error |
401 | Missing, invalid, expired or revoked key. | Error |
403 | The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy. | Error |
404 | The link does not exist or belongs to another account. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
POST /mcp
MCP endpoint (JSON-RPC 2.0). Remote Model Context Protocol server (Streamable HTTP, JSON response mode, no sessions). Send `initialize`, `tools/list` and `tools/call` messages; batches up to 50. `tools/list` only shows the tools the key's scopes allow. Notifications return `202`. GET returns `405`.
Scope requerido: Cualquier key válida
Cuerpo de la petición
nullRespuestas
200 | JSON-RPC response (or array for batches). | |
202 | Only notifications were sent. | |
400 | Malformed JSON-RPC body. | |
401 | Missing, invalid, expired or revoked key. | Error |
429 | Rate limit or daily quota exceeded (`rate_limited`, `daily_quota_exceeded`). `error.details.type` is `rate` or `daily`; `error.details.retryAfterSec` and `Retry-After` give the wait in seconds. | Error |
Esquemas
Error
{
"error": {
"code": "invalid_request",
"message": "string",
"status": 0
},
"requestId": "string"
}Link
{
"id": "string",
"shortCode": "aB3dE9",
"url": "https://lnk.ec/aB3dE9",
"longUrl": "https://example.com",
"title": "string",
"status": "active",
"accessLevel": "private",
"clicks": 0,
"createdAt": "2026-12-01T12:00:00.000Z"
}LinkList
{
"data": [
{
"id": "string",
"shortCode": "aB3dE9",
"url": "https://lnk.ec/aB3dE9",
"longUrl": "https://example.com",
"status": "active",
"accessLevel": "private",
"clicks": 0
}
],
"nextCursor": "string"
}CreateLink
{
"url": "https://example.com",
"title": "string",
"accessLevel": "private"
}UpdateLink
{
"url": "https://example.com",
"title": "string",
"accessLevel": "private"
}Resolved
{
"originalUrl": "string",
"finalUrl": "string",
"redirected": true,
"hops": [
"string"
]
}Analytics
{
"linkId": "string",
"groupBy": "country",
"from": "string",
"to": "string",
"total": 0,
"data": [
{}
]
}Whoami
{
"product": "lnk",
"key": {},
"account": {},
"limits": {}
}