---
title: "Save accounts"
method: POST
path: "/bus/accounts"
tags: ["bus"]
---

# Save accounts

`POST /bus/accounts`

Saves the provided accounts to the database.

## Request body

- object
  - `accounts` Account[]
    - `id` string — The account's ID
    - `cleanShutdown` boolean — Whether the account has been cleanly shutdown. If not, the account will require a sync with the host.
    - `hostKey` string — The host's public key
    - `balance` string — The account's balance as expected by the worker
    - `drift` string — The accumulated drift between the worker's expected balance and the host's actual balance. Used to track if a host is trying to cheat the renter over time.
    - `owner` string — The owner of the account that manages it. This is the id of the worker that maintains the account.
    - `requiresSync` boolean — Whether the account requires a sync with the host. This is usually the case when the host reports insufficient balance for an account that the worker still believes to be funded.

## Response `200`

Successfully saved accounts

## Other responses

- `400` — Malformed request
- `500` — Internal server error

## Changes

- **2025-10-16** `fede87b22e1c` — 1 breaking, 1 warning
  - added `#/components/schemas/AccountID` to the `accounts/items/id` request property `allOf` list
  - removed `#/components/schemas/PublicKey` from the `accounts/items/id` request property `allOf` list
- **2024-12-18** `922f156353c9` — 1 breaking, 1 info
  - removed the media type `text/plain` for the response with the status `500`
  - api tag `bus` added
- **2024-12-12** `be2f724d7cd4` — 1 breaking
  - removed the media type `text/plain` for the response with the status `200`
- **2024-12-11** `d9b66ab40419` — 1 info
  - endpoint added
- **2024-12-09** `f062c35d8f47` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/siafoundation/apis/renterd-api/changes/bus/accounts/post.md)

---

[API](https://skmtc.dev/siafoundation/apis/renterd-api.md) · [All operations](https://skmtc.dev/siafoundation/apis/renterd-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/siafoundation/renterd-api/revisions/184a3d5207da/schema)
