Create a workspace bank rule
POST/api/v1/workspaces/:workspace_id/bank_rules
Creates a rule that applies to EVERY company of the workspace, unless that company is excluded from it. To create a rule bound to a single company, post to the company-scoped path instead - the path is what sets the precedence level, and it cannot be changed afterwards. An Idempotency-Key is accepted and optional: this write creates no provider-side effect and is safely replayable.
Request
Responses
- 201
- 401
- 403
- 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.
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. code is validation_failed for a missing name, a missing action.account_number, a valid_until before valid_from or a duplicate name, and invalid_argument for a value outside the published vocabulary - an unknown conditions or action key, an unknown enum value, a bank_account_id outside the rule's scope, or a description_matches that can only be a regular expression, is longer than 1024 characters or is blank once its accents are removed.