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

Crear API key

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

200Key information.Whoami
401Missing, invalid, expired or revoked key.Error
429Rate 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

200Resolution result.Resolved
400The request is not valid (`invalid_request`, `invalid_json`).Error
401Missing, invalid, expired or revoked key.Error
403The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy.Error
422Shortener could not be expanded.Error
429Rate 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
502Destination could not be checked right now.Error

GET /links/{id}/analytics

Link analytics. Click counts grouped by country, region, city or date.

Scope requerido: analytics:read

Parámetros

NombreEnTipoObligatorioDescripción
idpathstringSíLink id (24-character hex string).
groupByquery"country" | "region" | "city" | "date"No
fromquerystring (date-time)NoISO 8601 start date (inclusive).
toquerystring (date-time)NoISO 8601 end date (inclusive).

Respuestas

200Grouped clicks.Analytics
400The request is not valid (`invalid_request`, `invalid_json`).Error
401Missing, invalid, expired or revoked key.Error
403The key lacks the required scope (`insufficient_scope`), IP not allowed, or the account must accept the content policy.Error
404The link does not exist or belongs to another account.Error
429Rate 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

null

Respuestas

200JSON-RPC response (or array for batches).
202Only notifications were sent.
400Malformed JSON-RPC body.
401Missing, invalid, expired or revoked key.Error
429Rate 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"
}
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": {}
}