# Account management by API

Profile, settings, balances, people, documents, notifications, limits, support and audit with a customer key.

A customer-level key can run most of the account, not only payments: everything a member does in **Settings** of the web app except the controls that must stay with a signed-in person. Each area has one `read` and one `write` scope, so a key holds only what its job needs. Every call sends `X-Tenant-Id` = your customer id.

```sh
export WIREBLOOM_API_URL=https://api.staging.banking.wirebloom.com/v1
export WIREBLOOM_CUSTOMER_ID=<your customer id>
auth=(-H "Authorization: Bearer $WIREBLOOM_API_KEY" -H "X-Tenant-Id: $WIREBLOOM_CUSTOMER_ID")
```

## Scopes for account management

| Scope                       | Reaches                                                                                                                                                                                 |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account:read`              | profile, settings, addresses, low-balance alerts, approval policies and approved domains (read), account identifiers, limits, fee charges, support requests, complaints, closure status |
| `account:write`             | profile, settings, addresses, alerts, enabled currencies, open and rename balances, favourites, support requests, complaints                                                            |
| `people:read`               | people, custom roles, teams, invitations, primary-owner transfers (read)                                                                                                                |
| `people:write`              | invite, change role, deactivate and reactivate people; custom roles; resend or revoke invitations                                                                                       |
| `documents:read`            | documents, downloads and document requests                                                                                                                                              |
| `documents:write`           | upload documents, fulfil document requests                                                                                                                                              |
| `transactions:write`        | transaction labels, annotations and attachments                                                                                                                                         |
| `notifications:read`        | notifications                                                                                                                                                                           |
| `notifications:write`       | mark notifications read                                                                                                                                                                 |
| `audit:read`                | audit events and audit exports                                                                                                                                                          |
| `cards:read`, `cards:write` | every card of the account and its transactions; issue, activate, freeze and unfreeze (where the operator offers cards)                                                                  |
| `crypto:read`               | Crypto positions, activity and statements (where the operator offers Crypto); reading orders included; placing quotes and orders stays in the app                                       |

The [scope catalogue](/scopes) lists every operation per scope from the contract.

## Profile, settings and balances

Read the profile with [getCustomer](/reference/tenants#getCustomer) and the settings with [getCustomerSettings](/reference/tenants#getCustomerSettings). Updates of versioned resources need `If-Match` with the `ETag` of your last read (`428` without it, `412` when it is stale):

```sh
etag=$(curl -s -D - -o /dev/null "$WIREBLOOM_API_URL/customers/$WIREBLOOM_CUSTOMER_ID/settings" "${auth[@]}" \
  | awk -F': ' 'tolower($1)=="etag" {print $2}' | tr -d '\r')
curl -X PATCH "$WIREBLOOM_API_URL/customers/$WIREBLOOM_CUSTOMER_ID/settings" "${auth[@]}" \
  -H "If-Match: $etag" -H "Content-Type: application/json" \
  -d '{ "lowBalanceAlertsEnabled": true }'
```

Every settings field can be changed by key except `stepUpPaymentThreshold`, the amount above which a person must confirm a payment with a step-up: a key sending it gets `422` with `errors[].code` `field_session_only`. Change it from a signed-in session in the web app.

Open a new balance with [createBalance](/reference/accounts#createBalance) (`account:write`), rename it with [updateBalance](/reference/accounts#updateBalance), and set a low-balance alert with [createLowBalanceAlert](/reference/tenants#createLowBalanceAlert):

```sh
curl -X POST "$WIREBLOOM_API_URL/balances" "${auth[@]}" \
  -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
  -d '{ "currency": "USD", "name": "US suppliers", "withAccountDetails": true }'
```

## People and roles

List members with [listPeople](/reference/tenants#listPeople) (`people:read`). Invite with [invitePerson](/reference/tenants#invitePerson) (`people:write`):

```sh
curl -X POST "$WIREBLOOM_API_URL/customers/$WIREBLOOM_CUSTOMER_ID/people" "${auth[@]}" \
  -H "Content-Type: application/json" \
  -d '{ "email": "j.doe@example.com", "firstName": "Jane", "lastName": "Doe", "role": "cust_member" }'
```

A key cannot hand out control of the account:

- The target role must be below owner and admin and must not be able to approve. Inviting, re-assigning or reactivating someone into a role that manages people, settings, the primary owner, API keys or webhooks, or that approves anything, is `422` with `errors[].code` `role_not_allowed_for_key`. The same rule applies to custom roles a key creates or edits.
- Invitations by key go only to addresses on your approved domains. With no approved domains the invite is `422` `invitation_domains_required`; another domain is `422` `domain_not_approved`. Approved domains themselves are edited only in the web app.
- Invites and invitation resends by key are limited to 10 a minute per key (`429` [`rate-limited`](/errors#rate-limited) above, with `Retry-After`).
- Every invite, role change, deactivation and reactivation by key emails every owner of the account, naming the key and what it did. The audit log records the key.

Invitations ([resendInvitation](/reference/tenants#resendInvitation), [revokeInvitation](/reference/tenants#revokeInvitation)) follow the same scopes. Teams are read by key ([listTeams](/reference/tenants#listTeams), `people:read`) but created, changed and deleted only in the app: teams decide who approves in approval tiers.

## Documents and document requests

Upload in three steps: [uploadDocument](/reference/activity#uploadDocument) declares the file (`kind`, `fileName`, `contentType`, `size`, `sha256`) and returns a pre-signed `PUT` (`upload.url`, `upload.headers`, valid about 15 minutes); you `PUT` the bytes there; [completeDocumentUpload](/reference/activity#completeDocumentUpload) verifies them and starts the malware scan. A document can be downloaded or referenced only after the scan. Answer a request from your operator with [fulfilDocumentRequest](/reference/activity#fulfilDocumentRequest) (`documents:write`); read them with [listDocumentRequests](/reference/activity#listDocumentRequests) (`documents:read`).

## Transactions, notifications, limits and support

- Label and annotate transactions for your ledger: [createAnnotation](/reference/activity#createAnnotation), attachments with [createAttachment](/reference/activity#createAttachment) and [deleteTransactionAttachment](/reference/activity#deleteTransactionAttachment) (`transactions:write`). Deleting an attachment by its own id (`DELETE /attachments/{attachmentId}`) carries no API-key scope in this contract version, so it is not available to keys: remove the attachment from its transaction instead.
- Read notifications ([listNotifications](/reference/notifications#listNotifications)) and mark them read ([markNotificationRead](/reference/notifications#markNotificationRead), [markAllNotificationsRead](/reference/notifications#markAllNotificationsRead)). Notification preferences belong to each person across every account they belong to, so they are changed in the app, not by key.
- Read your limits ([getOwnLimits](/reference/limits#getOwnLimits)) and fee charges ([listFeeCharges](/reference/fees#listFeeCharges)) with `account:read`. Limits are set by your operator.
- Raise a support request ([createSupportRequest](/reference/tenants#createSupportRequest)) or a complaint ([submitComplaint](/reference/tenants#submitComplaint)) with `account:write`.

## Audit

[listAuditEvents](/reference/operator-ops#listAuditEvents) and [exportAuditEvents](/reference/operator-ops#exportAuditEvents) (`audit:read`) return your account's audit trail, including every action taken by a key (with the key id):

```sh
curl -X POST "$WIREBLOOM_API_URL/audit-events/exports" "${auth[@]}" \
  -H "Content-Type: application/json" \
  -d '{ "format": "csv", "from": "2026-11-01T00:00:00Z", "to": "2026-11-18T00:00:00Z" }'
```

The export answers `202` with a `Job`: poll `Location` ([getJob](/reference/activity#getJob); the scope that created the job also polls it) until it succeeds, then download the CSV from `resultUrl` ([Pagination](/docs/pagination)).

## What stays in the app

Approval decisions, approval-policy and approved-domain edits, primary-owner transfers, account closure, API keys, MFA, passwords and sessions, notification preferences, team changes, Crypto quotes and orders, card PIN and card details, card replacement and termination, Crypto payout addresses and payouts are never available to a key. A key calling one gets `403`. Some rules apply to single fields: `PATCH …/settings` by key refuses `stepUpPaymentThreshold` with `422` and `errors[].code` `field_session_only`.

The operations kept to the app on purpose are listed, with the reason, on [session-only operations](/session-only). Any operation without an API-key scope badge in the [reference](/reference) is not available to keys either.
