Connect Mercury
connect_mercuryConnects the org to Mercury from a read-only, scoped API token the user created in their Mercury settings (Mercury uses a token, not OAuth — there is no redirect). The token is validated against Mercury's accounts endpoint and stored ONLY if it works; an invalid token stores nothing and returns an error. This grants READ access only — balances and transactions — it cannot move money. The token is sensitive: it is vault-encrypted at rest and never returned, logged, or echoed. Optionally include the per-account webhook signing secret (from where the webhook was created in Mercury) to enable live transaction events.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org_id | No | Optional. Defaults to the organisation the authenticated API key is bound to, so you normally omit it and never need to ask the user for their organisation UUID. If provided, it must match the key’s org or the request is rejected. | 0e91146d-511c-469f-bdee-5c867b26ae0d |
| actor_id | No | Optional. Defaults to the organisation entity (correct for an org-scoped key). If provided, it must be an entity belonging to this organisation — arbitrary UUIDs are rejected, so the audit trail cannot be attributed to someone else. | |
| api_token | Yes | The read-only Mercury API token to validate and store. Sensitive — never logged. | |
| webhook_secret | No | Optional per-account webhook signing secret to enable live event verification. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connected | Yes | ||
| account_ids | Yes | ||
| business_name | Yes |