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

# Saved accounts and monitoring

> Save an account once, then send its id. It keeps its policy and remembers committed loss sales.

Saving is optional. A saved account gives you three things:

* **A standing policy.** It is the default for every later request on the account. The request's goal and policy are laid over it.
* **Wash-sale memory.** Loss sales you [commit](https://docs.abacuslabs.ai/concepts/commits.md) count in every later check.
* **Monitoring settings.** Stored with the account. Event delivery is not live yet (see [Monitoring](#monitoring)).

## Save an account

| How | Returns |
| - | - |
| `save: true` on `POST /v1/proposals` | `ids.saved_account_id`. The account keeps the standing parts of the policy Abacus Labs solved ([what is kept](https://docs.abacuslabs.ai/concepts/policy.md#what-a-saved-account-keeps)). |
| `save: true` on `POST /v1/analyze` | `ids.saved_account_id`. |
| `POST /v1/accounts` with the account and an optional `policy` | The saved account. |
| `POST /v1/accounts/{id}/save` on an inline account | The saved account, with the same `id`. It no longer expires. A saved account comes back as it is. |

After that, send `"account_id": "acct_7f3a"` on proposals and trade checks (or `"account": {"id": "acct_7f3a"}` on any call) instead of the holdings.

> [!NOTE]
>
> A saved account keeps the `id` you send. An account sent without an `id` gets a new Abacus Labs id (`acct_...`). Saving counts the account as a [portfolio](https://docs.abacuslabs.ai/credits.md#portfolios) this month.

```bash theme={null}
curl -s https://api.abacuslabs.ai/v1/accounts \
  -H "Authorization: Bearer $ABACUS_API_KEY" -H "Content-Type: application/json" \
  -d '{"id": "acct_7f3a", "broker": "public", "tax_type": "taxable", "cash": 3000,
       "positions": [{"symbol": "NVDA", "quantity": 300, "lots": [
         {"id": "NVDA-2023-02-10", "quantity": 200, "cost_basis": 9000, "acquired_date": "2023-02-10"},
         {"id": "NVDA-2026-09-01", "quantity": 100, "cost_basis": 17000, "acquired_date": "2026-09-01"}]}],
       "policy": {"tax": {"rates": {"short_term": 0.37, "long_term": 0.20}}}}'
```

## Manage accounts

| Call | What it does |
| - | - |
| `POST /v1/accounts` | Save an account. `201`. |
| `GET /v1/accounts` | This key's accounts: saved ones, and inline ones still inside their 24 hours (`inline: true`, `expires_at`). `?saved=true` leaves the inline ones out. |
| `GET /v1/accounts/{id}/holdings` | The account priced now (1 credit). See [Holdings](#holdings). |
| `POST /v1/accounts/{id}/save` | Keep an inline account. |
| `GET /v1/accounts/{id}` | One account, with its current `snapshot_id` and `version`. |
| `PATCH /v1/accounts/{id}` | Change `cash`, `positions`, `rules`, `history`, `tax_rates`, `name` or `policy`. `rules` is merged; other fields are replaced. `history_append` adds trades to the history. Each change is a new version with a new `snapshot_id`. |
| `DELETE /v1/accounts/{id}` | Delete the account. Its commits stay. |

```bash theme={null}
curl -s -X PATCH https://api.abacuslabs.ai/v1/accounts/acct_7f3a \
  -H "Authorization: Bearer $ABACUS_API_KEY" -H "Content-Type: application/json" -d '{"cash": 5000}'
```

`POST` answers `201` with the saved account; `PATCH` answers `200` with the new version. A saved account comes back in Abacus Labs' stored form, not the form you sent. Lots are `{id, qty, cost, date, broker_id}` with `cost` **per share**; `broker_id` is the lot id you sent (the one to name at the broker); `type` is the tax type; `history` holds the trades Abacus Labs knows about (your `recent_trades` and committed fills). This is `GET /v1/accounts/acct_7f3a` after the `PATCH` above and the commit with fills in [Commits](https://docs.abacuslabs.ai/concepts/commits.md#fills):

```json theme={null}
{ "id": "acct_7f3a", "name": "acct_7f3a", "type": "taxable", "cash": 10048.35,
  "positions": [ { "symbol": "NVDA", "lots": [
      { "id": "NVDA-2023-02-10", "qty": 200.0, "cost": 45.0, "date": "2023-02-10", "broker_id": "NVDA-2023-02-10" },
      { "id": "NVDA-2026-09-01", "qty": 69.0, "cost": 170.0, "date": "2026-09-01", "broker_id": "NVDA-2026-09-01" } ] } ],
  "history": [ { "symbol": "NVDA", "side": "sell", "qty": 31.0, "price": 162.85, "date": "2026-11-15", "realized": -221.65, "note": "fill fill_0 of cmt_108eecb4b6f9" } ],
  "rules": { "whole_shares": true, "max_position": null, "max_sector": null, "min_cash": 0.0, "wash_sale_accounts": [] },
  "broker": "public", "created": "2026-11-15T20:56:05Z", "updated": "2026-11-15T20:56:29Z",
  "policy": { "tax": { "rates": { "short_term": 0.37, "long_term": 0.2 } } },
  "snapshot_id": "snap_e22e...", "version": 3 }
```

`GET /v1/accounts` answers `{"accounts": [...]}`, the three demo accounts and any inline accounts included. `DELETE` answers `{"deleted": "acct_7f3a"}`.

## Holdings

`GET /v1/accounts/{id}/holdings` prices the account now. It runs no risk model and no AI step, and costs 1 credit. The answer has the [shared shape](https://docs.abacuslabs.ai/concepts/results.md) with one `holdings` block: per position `qty`, `price`, `value`, `weight`, `sector`, `cost_basis`, `unrealized` and `lots`; and `cash`, `positions_value` and `value` for the account.

```bash theme={null}
curl -s https://api.abacuslabs.ai/v1/accounts/acct_demo_etf/holdings -H "Authorization: Bearer $ABACUS_API_KEY"
```

For risk, tracking error, exposures or tax, ask [analyze](https://docs.abacuslabs.ai/concepts/analysis.md).

## Keep it current

A saved account is only as good as its holdings. Update it after trades: send `fills` with the [commit](https://docs.abacuslabs.ai/concepts/commits.md), or `PATCH` the positions and cash from the broker. Fetch lots from the broker on the day you trade; broker lot ids can change after a partial sale.

## Monitoring

> [!WARNING]
>
> Not live yet. Abacus Labs stores the `monitor` settings and sets up a watch on the account, but scheduled checks and webhook delivery do not run in production yet. Do not rely on events. To check an account, call analyze or propose on it.

`monitor` in the account's policy (on a proposal with `save: true`, on `POST /v1/accounts`, or with `PATCH`) takes:

| Field | Default | Meaning |
| - | - | - |
| `webhook` | required | The https URL to post events to. |
| `secret` | none | Signs each delivery (HMAC-SHA256 of the body, in `X-Abacus-Signature: sha256=<hex>`). Shown as `"set"` when you read the account. |
| `harvest` | `true` | Tell me when a loss is worth harvesting. |
| `drift` | none | Tell me when the account drifts this far from its target (a fraction). |
| `rule_break` | `true` | Tell me when a holding breaks one of the account's rules (`max_position`, `max_sector`, `min_cash`). |

Reference: [Save](https://docs.abacuslabs.ai/api-reference/accounts/save-an-account.md), [List](https://docs.abacuslabs.ai/api-reference/accounts/list-accounts.md), [Get](https://docs.abacuslabs.ai/api-reference/accounts/get-an-account.md), [Update](https://docs.abacuslabs.ai/api-reference/accounts/update-an-account.md), [Delete](https://docs.abacuslabs.ai/api-reference/accounts/delete-an-account.md).


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