---
title: "Change a company's bookkeeping agent settings"
method: PUT
path: "/accountant/companies/{customerId}/agent/settings"
tags: ["Accountant Portal"]
---

# Change a company's bookkeeping agent settings

`PUT /accountant/companies/{customerId}/agent/settings`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/agent/settings`
- Auth: HTTP bearer

Human super-admin only (SUPER_ADMIN_USER_IDS). Enabling a company is refused unless it is on the deployment allowlist, and grants the agent its assignment for that company. `initializeIfMissing: true` creates a disabled settings row only if absent, requires explicit positive limits and an allowlisted, non-PHI-bounded company, and never grants an assignment or overwrites a row. A concurrent or existing row returns 409 `AGENT_SETTINGS_ALREADY_CONFIGURED`. PHI-bounded or unreadable companies are refused. One patient-data company is refused in code whatever the allowlist says: enabling it or setting `phiRestricted: false` for it gets 403 `AGENT_PATIENT_DATA_COMPANY_REFUSED`, and every agent request for it gets the same refusal. `killSwitch: true` stops the agent's next write. Mounted only when the deployment enables the bookkeeping agent (default off); otherwise 404. The shared cloud-bookkeeping service token gets 404 here.

## Path parameters

- `customerId` string, uuid, required

## Request body

- union
  - BookkeepingAgentSettingsPatch
    - `enabled` boolean
    - `killSwitch` boolean
    - `phiRestricted` boolean
    - `maxRowsPerRun` integer
    - `maxAmountCentsPerRun` integer: Deprecated. Still accepted, stored and returned by the settings routes, and never read. No amount limits the agent; the row cap and the daily budget do.
    - `dailyBudgetMicros` integer: Micro-USD. At most 1,000,000 ($1.00 a day base cap; temporary allowances may raise effective cap).
  - BookkeepingAgentSettingsInitialize
    - `initializeIfMissing` true, required
    - `enabled` false, required
    - `phiRestricted` false, required
    - `maxRowsPerRun` integer, required
    - `maxAmountCentsPerRun` integer, required
    - `dailyBudgetMicros` integer, required: Micro-USD. At most 1,000,000 ($1.00 a day base cap; temporary allowances may raise effective cap).

## Response `200`

Success envelope

- object

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `409`: Settings already exist; initialization never changes them.
- `422`: Validation failed
- `503`: The PHI-bounded company flag could not be read.

## Changes

- **2026-11-28** `24ced4d421d8`: 2 info
  - the `oneOf[#/components/schemas/BookkeepingAgentSettingsInitialize]/dailyBudgetMicros` request property's max was increased from `100000.00` to `1000000.00`
  - the `oneOf[#/components/schemas/BookkeepingAgentSettingsPatch]/dailyBudgetMicros` request property's max was increased from `100000.00` to `1000000.00`
- **2026-11-26** `4a2098becaf9`: 2 warning
  - the `oneOf[#/components/schemas/BookkeepingAgentSettingsInitialize]/dailyBudgetMicros` request property's max was set to `100000.00`
  - the `oneOf[#/components/schemas/BookkeepingAgentSettingsPatch]/dailyBudgetMicros` request property's max was set to `100000.00`
- **2026-10-30** `0b1320f7196d`: 1 breaking, 6 warning, 3 info
  - the request's body type changed from `object` to no type
  - removed the request property `dailyBudgetMicros`
  - removed the request property `enabled`
  - removed the request property `killSwitch`
  - …6 more
- **2026-10-29** `e1fc804546d3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/agent/settings/put.md)

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) - [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) - [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/4f4c2d34276b?raw)
