Fold a duplicate account into the one that survives
Requires manage:bank_accounts on both accounts.
Direction is not interchangeable. The account in the path is the one
that goes away; target_bank_account_id is the one that survives, and it
must be the record the bank actually writes to. A source that carries a
bank connection is refused with 422 — merging the connected record away
would archive it while the PSD2 sync kept writing new transactions to it,
re-creating the duplicate-IBAN split on an account the UI now hides.
Both must belong to this workspace and carry the same IBAN. Every transaction, statement and document referencing the source is repointed at the target, and the source is archived. Nothing is deleted and nothing is deduplicated — putting the rows on one account is what lets a later statement import absorb hand-entered transactions instead of duplicating them.
The source may be archived or soft-deleted; the target may not be. The workspace’s default account cannot be merged away.
Authentication
JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.
Lucanto API key. Two prefixes:
lct_pat_<random><checksum>— personal access token (owner: User)lct_live_<random><checksum>— workspace token, live data
Issue keys at /settings/api_keys (personal) or
/:workspace_id/settings/api_keys (workspace). Plaintext token is
shown once and never again.
Path parameters
The record’s numeric id or its public_id
(doc_01h455vb4pex5vsknk084sn02q). The bare UUID form of the
public_id is still accepted but deprecated.
Headers
Client-supplied unique key (recommended: UUID v4) for safe
retries. Within 24 hours, repeating the same key with the same
request (method, path, query, body) replays the original
response instead of re-executing the action — once the action
has run, a 5xx included; a request stopped before it ran is not
stored. Reusing
a key with a different request returns
422 idempotency_key_conflict (IETF draft §2.7).
