Skip to content

Create a velocity control on a programme

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

Requires an API client bearer token.

Places a rolling-window velocity rule on this programme (`scope`/`scope_id` are derived from the path; a body that sets either is rejected). Requires an Idempotency-Key header.

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.

Request body

window"hour" | "day" | "month"required
max_countinteger
max_amountstring

Example

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

Responses

201

The created velocity control.

window"hour" | "day" | "month"required
max_countinteger
max_amountstring
idstringrequired
400

Validation error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
401

Authentication required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
403

Forbidden

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
404

Programme not found

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
409

Idempotency-Key reused with a different payload

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
422

The body set scope or scope_id (both are derived from the path), or named neither max_count nor max_amount

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
500

Internal server error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring