Update a bank rule
PATCH/api/v1/bank_rules/:id
Updates the rule in place. Enabling and disabling is a PATCH of enabled rather than a separate endpoint. The precedence level is fixed at creation, so scope and company_id sent in the body are IGNORED rather than refused - which is what lets you read a rule and send the whole object back with one field changed. workspace_id is the exception - it is read by the shared workspace-grant gate, so echoing one your token holds no grant for is refused with 403. An Idempotency-Key is accepted and optional.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
The rule as it now stands.
The request carries no bearer token, or one that is invalid or expired. doorkeeper_authorize! is the first gate of the chain, so this is answered before the workspace, the company, the feature flag and the record are ever resolved - and before any Idempotency-Key is claimed.
The token does not hold the write scope this PATCH requires.
No rule with this id is reachable by the token's grants. One belonging to another workspace answers the same way.
You sent the optional Idempotency-Key and a call bearing it is still in flight - idempotency_request_in_progress. Nothing was written by THIS call. Once the first completes, the same key replays its stored response rather than conflicting.
The update was refused. Same two codes as the create - validation_failed for a broken invariant, invalid_argument for a value outside the published vocabulary. A body carrying NO accepted field is also refused here rather than answered 200.