Skip to content
LA CRYPTADOCS / 01

API conventions

Tenant namespace, formats, errors, pagination, and idempotency.

API conventions

Base and namespace

Examples start from:

https://crm.lacrypta.ar/api/organizations/{organizationSlug}

Public operations for an Event also use this namespace. Do not replace the slug with an ID or rely on tenant headers supplied by a client.

Formats

  • JSON uses Content-Type: application/json.
  • Dates and times use ISO 8601; interpret timestamps without an offset as UTC only when the schema says so.
  • Fields ending in _sats are integer satoshi amounts.
  • Slugs are lowercase and stable; entity IDs are usually UUIDs.
  • Omitting a field and sending it as null can have different effects in a partial update.

Responses and errors

A 2xx response confirms that the HTTP operation completed; later work such as message delivery or payment reconciliation may continue asynchronously.

Errors commonly include:

{
  "error": "machine_readable_code",
  "detail": "Optional human context"
}

Use the HTTP status first, then error. Do not depend on translated text. Each operation’s reference identifies additional fields such as conflict, pagination, or per-recipient results.

StatusGeneral meaning
400Invalid JSON, parameters, or transition
401No valid session or credential
403Invalid origin/CSRF or explicitly forbidden action
404Resource is not visible in the current tenant and role
409Identity, capacity, state, or uniqueness conflict
422Syntactically valid data that cannot be processed
429Rate limit; honor Retry-After when present
500/503Temporary service or provider failure

Pagination

Three contracts are common:

  • page + page_size, with total, page, and page_size.
  • limit + offset, with total, limit, and offset.
  • page + limit, with a pagination object.

Do not interchange styles between endpoints. Apply maximum limits and filters exactly as shown in the OpenAPI reference.

Idempotency and retries

  • Reads are safe to retry.
  • Payment and settlement flows protect against double application, but clients should retain the original order or invoice identifier.
  • Confirmation and check-in return states such as already_* when a repeat is safe.
  • For bulk sends, read the state before repeating: a disconnect does not mean no message was sent.
  • Never automatically retry DELETE, transfers, or destructive resets without checking current state.

Cache and real time

SSE events are signals to update the interface, not a definitive ledger. When one arrives, read the corresponding resource again. See Real-time updates with SSE.