API reference

Authentication endpoints

Esta guía todavía no está traducida a tu idioma: se muestra en inglés.

Every API call is authenticated with an API token sent as a bearer credential. This page explains the token types, the scopes and the endpoints that manage tokens.

Sending the token

GET /api/documents HTTP/1.1
Host: api.legalcloud.info
Authorization: Bearer lc_...

Tokens are created in the dashboard (Organization → API) — see Generating API tokens — or through the endpoints below.

Token types

TypeUse
applicationCalls the API within its scopes.
documentOpens a single document on /d/{hash}; it cannot call any other endpoint.

Scopes

Every endpoint lists the scope it requires. An application token carries all the permissions of the member who created it, or a narrower list:

documents:read, documents:write, sites:read, sites:write, resources:read, resources:write, organization:read, organization:write.

A request without the required scope is rejected with 403 and "code": "SCOPE_FORBIDDEN".

Token endpoints

These endpoints require the organization:read or organization:write scope.

MethodPathDescription
GET/api/account/tokensList the tokens of your organization
POST/api/account/tokensCreate a token
DELETE/api/account/tokens/{id}Revoke a token
DELETE/api/account/tokens/{id}/permanentDelete a revoked token permanently
POST/api/account/tokens/{id}/regenerateRevoke a token and create a new one with the same label and expiry
POST/api/account/tokens/{id}/revealReveal the plain token (owner)
GET/api/account/api-usageQuota and 30-day usage
GET/api/account/api-usage/callsLog of recent API calls

Create a token

curl -X POST https://api.legalcloud.info/api/account/tokens \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
           "label": "marketing-site-prod",
           "type": "application",
           "scopes": ["documents:read"],
           "expiresAt": "2027-01-01T00:00:00Z"
         }'

The response contains the new token. For a document token pass "type": "document" and "documentId".

Regenerate a token

curl -X POST https://api.legalcloud.info/api/account/tokens/{id}/regenerate \
     -H "Authorization: Bearer YOUR_TOKEN"

The old token stops working immediately and the response carries the new one.

Token errors

StatuscodeMeaning
401TOKEN_MISSINGNo token was sent
401TOKEN_INVALIDThe token does not exist
401TOKEN_REVOKEDThe token was revoked
401TOKEN_EXPIREDThe token passed its expiry date
403SCOPE_FORBIDDENThe token lacks the required scope

Security

  • Keep application tokens on your server; never ship them in browser code.
  • Use the narrowest scopes and an expiry date when possible.
  • Regenerate a token immediately if you suspect a leak.

Next steps

Última actualización: 2026-10-27

Regístrate GRATIS de por vida, sin tarjeta de crédito

Crear cuenta gratis