Create a company bank rule
POST/api/v1/workspaces/:workspace_id/companies/:company_id/bank_rules
Creates a rule bound to this one company. A company rule OUTRANKS every workspace rule whatever its priority, and it can never be excluded - it already applies to exactly one company, so its excluded_company_ids is always empty. An Idempotency-Key is accepted and optional.
Request
Responses
- 201
- 401
- 403
- 404
- 409
- 422
The rule was created.
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 holds no grant for this workspace, or no such workspace exists.
No company with this id belongs to the resolved workspace.
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 rule was refused - a missing name, a missing action.account_number, a valid_until before valid_from or a duplicate name give validation_failed; a value outside the published vocabulary gives invalid_argument.