Skip to content

Create a business velocity control

POST/v1/businesses/{id}/velocity-controls

Requires an API client bearer token.

Stores a windowed count or amount limit shared by every business card of the business, the membership or the card group it names: one counter for all of them. scope and scope_id name the business itself, one of its memberships or one of its card groups; any other scope_id is 400 scope_not_of_business. A body naming neither max_count nor max_amount is 422. Requires an Idempotency-Key. An API client names its acting person in X-Rigid-Acting-Person (400 acting_person_required without it); the person needs an active membership of the business with can_grant_cards, else 403 acting_person_not_permitted (403 admin_kyc_not_complete when the KYC of the admin no longer holds). Every call with a well-formed body and an Idempotency-Key not already used with a different body, allowed or refused, writes one audit intent with the API client, the asserted person, the business and the decision. While the `business-cards` release flag is off for the mode of the caller this route answers 404 to every authenticated, well-formed request not replaying an outcome stored while it was on, as if absent.

Parameters

Path parameters

NameRequiredDescription
idrequired

Header parameters

NameRequiredDescription
Idempotency-Keyrequired

Client-chosen. An identical retry with the same key returns the stored response; reusing the key with a different payload returns 409.

X-Rigid-Acting-Personoptional

Request body

window"hour" | "day" | "month"required
max_countinteger
max_amountstring
scope"business" | "membership" | "card_group"required
scope_idstring (uuid)required

Example

curl -X POST https://api.rigid.fi/v1/businesses/{id}/velocity-controls \
  -H "Authorization: Bearer $RIGID_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "window": "hour",
  "scope": "business",
  "scope_id": "uuid"
}'

Responses

201

Create a business velocity control — the stored control, with its scope.

window"hour" | "day" | "month"required
max_countinteger
max_amountstring
idstringrequired
scope"business" | "membership" | "card_group"required
scope_idstringrequired
400

scope_not_of_business; invalid_body; acting_person_required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
401

Authentication required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
403

Forbidden

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
404

Business not found, or the business routes are not released

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
409

Idempotency-Key reused with a different payload; business_closed

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
422

control_restricts_nothing: the body names no restriction

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
500

Internal server error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring