> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluz.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Spend account activity history

> Every event Fluz records on a spend account — creation, renames, default changes, images, closure, ownership, and access — and how each one appears in objectChangeHistory.

A spend account's activity history shows how the account was created, every rename, default switch, and closure, and who was given access to it. Read it with `objectChangeHistory` and `objectType: SPEND_ACCOUNTS`.

<Info>
  **Prerequisites:** a user access token with the `VIEW_OBJECT_CHANGE_HISTORY` scope, and the `userCashBalanceId` of a spend account on the account. For an OAuth grant restricted to specific spend accounts, only those spend accounts are available. See [Activity history overview](/features/activity-history) for the full query, response fields, and access rules.
</Info>

```graphql theme={null}
query {
  objectChangeHistory(
    objectType: SPEND_ACCOUNTS
    objectId: "b7c6d5e4-f3a2-4b1c-9d8e-7f6a5b4c3d2e"
  ) {
    changeType
    change
    createdAt
    subjectUserId
    actor { userId system applicationId applicationName }
  }
}
```

***

## Creation

The spend account records `OBJECT_CREATED`, with `change: {}`, when it's opened. Spend accounts are opened directly, and also automatically when another action needs one.

| How the spend account was created | `actor` | `subjectUserId` |
| - | - | - |
| [`createUserCashBalance`](/features/create-spend-accounts) | The calling user and the connected application | — |
| [`registerUser`](/user-registration) creates the new user's default spend account | The calling user and the connected application | The new user |
| [`registerBusiness`](/business-registration) creates a spend account on the business account | The calling user and the connected application | — |
| The first deposit to an account that has no spend account | The depositing user | — |
| The first scheduled deposit to an account that has no spend account | `system: "scheduled-task-handler"` | The user the deposit is for |
| A deposit by Fluz support to an account that has no spend account | `system: "cms"` | The user the deposit is for |
| A share recipient is registered to receive a shared card | The sender and the connected application | The recipient |
| An embedded widget sets up the account | The user, or `system: "fluz-web-unified"` | — |
| The Fluz web or mobile app, including registration | The signed-in user | — |
| Fluz support | `system: "cms"` | The spend account's user |
| Business onboarding, or converting a business account | `system: "business-service"` | The account owner, on conversion |

***

## Changes

A change records one `FIELD_CHANGED` event per field, with `change: { "field", "old", "new" }`.

| `field` | `old` / `new` | Recorded when |
| - | - | - |
| `nickname` | The previous and new nickname | [`updateUserCashBalance`](/features/edit-spend-accounts), or the Fluz app. |
| `image` | The previous and new image URL, or `null` | The image is changed in the Fluz app. |
| `is_default` | `true` or `false` | A spend account becomes, or stops being, the default, in the Fluz app or by Fluz support. |
| `primary_funding_source`, `backup_funding_source` | `true` or `false` | The spend account is chosen as, or replaced as, the primary or backup payment method in the Fluz web app. |
| `status` | The previous status, for example `ACTIVE` → `CLOSED` | [`closeUserCashBalance`](/features/close-spend-accounts), closing the account in the Fluz app, or removing a person and closing their spend accounts in the Fluz app. |

### Default changes

Switching the default touches two spend accounts, and each records its own event:

* The previous default records `is_default`: `true` → `false`.
* The new default records `is_default`: `false` → `true`. A spend account that's created as the default may not record this event, because it was created that way.

Closing the default spend account in the Fluz web app also records `is_default`: `true` → `false` on the closed account, and `false` → `true` on the spend account that replaces it.

***

## Ownership and access

A spend account's ownership, access, and invite events follow the shared rules in [Ownership and access](/features/activity-history#ownership-and-access).

* **Owner.** Spend accounts created in the Fluz app record `OWNER_ASSIGNED` for the owner picked, or for the creator if no one was picked. It's also recorded when you call [`assignObjectOwner`](/api-reference/mutations/assign-object-owner) with `objectType: SPEND_ACCOUNTS`. See [Create a wallet for an authorized user](/create-wallet-for-authorized-user). [`transferObjectOwner`](/api-reference/mutations/transfer-object-owner) records `OWNER_TRANSFERRED`.
* **Access.** Changing the spend accounts an authorized user can use, in the Fluz app, records `ACCESS_GRANTED`, `ACCESS_LEVEL_CHANGED`, or `ACCESS_REVOKED` on each spend account whose access changed. `subjectUserId` is the authorized user.
* **Access requests.** A request for access to the spend account records `APPROVAL_REQUESTED`, then `APPROVAL_APPROVED`, `APPROVAL_DECLINED`, or `APPROVAL_EXPIRED`. The `approval_type` is `ACCOUNT_ACCESS` and the `approval_code` is `100004` or `100005`. See [Approvals](/features/activity-history#approvals).

***

## Systems you can see

| `actor.system` | What it does |
| - | - |
| `transactional-graph-service` | Creates a business spend account through the API when the caller can't be resolved to a user. |
| `business-service` | Creates spend accounts during business onboarding and account conversion. |
| `fluz-web-unified` | Creates a spend account during embedded widget setup when no user is signed in. |
| `scheduled-task-handler` | Creates a spend account for a scheduled deposit to an account that has none. |
| `approvals-service` | Records expired access requests and decisions made through an approval link that names no approver. |
| `cms` | Fluz support. |

***

## What isn't recorded

* Balances, and the money that moves through the account: deposits, withdrawals, transfers, and spend. Use [Transaction activity](/features/transactions-details-overview) for those.
* Requests for payment instructions, status letters, and other account documents.

## Next steps

<CardGroup cols={2}>
  <Card title="Activity history overview" icon="history" href="/features/activity-history">
    The query, response fields, actors, approvals, and access levels.
  </Card>

  <Card title="Spend accounts" icon="wallet" href="/features/spend-accounts">
    Create, edit, and close the spend accounts that appear in this history.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.