Publish the KYC policy editor draft as the next policy version
/v1/kyc/policy/draft/publishRequires an API client bearer token.
Mints the programme's next KYC policy version from its saved editor draft (`PUT .../draft`), then deletes the draft. Uses the SAME compose-layer validation and error codes as `POST /v1/kyc/policy` (`eligibility_rules_owned`, `unknown_detail_field`, `field_in_both_lists`, `invalid_rule`, `invalid_field_config`, `selfie_capture_unsatisfiable`) plus `unknown_flow` for a `flow_key` naming no flow and `flow_archived` for one naming a retired flow. Requires Idempotency-Key; an identical retry returns the SAME version and does not double-delete the draft. 404s if no draft exists for this programme/flow. 409s with code `draft_stale` if the active policy moved past the version the draft was opened against — retry with `acknowledge_stale: true` to publish the draft on top of the newer active policy instead. Requires the programme_admin role and shares `POST /v1/kyc/policy`'s tightest rate-limit class.
Parameters
Header parameters
| Name | Required | Description |
|---|---|---|
| Idempotency-Key | required | Client-chosen. An identical retry with the same key returns the stored response; reusing the key with a different payload returns 409. |
Request body
Example
curl -X POST https://api.rigid.fi/v1/kyc/policy/draft/publish \
-H "Authorization: Bearer $RIGID_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"programme_id": "uuid"
}'Responses
201The newly published policy version.
+ show properties− hide properties
+ show properties− hide properties
+ show properties− hide properties
No properties.
+ show properties− hide properties
+ show properties− hide properties
+ show properties− hide properties
No properties.
+ show properties− hide properties
+ show properties− hide properties
+ show properties− hide properties
+ show properties− hide properties
+ show properties− hide properties
+ show properties− hide properties
400Validation error
401Authentication required
403Forbidden
404No draft for this programme/flow
409Idempotency-Key reused with a different payload, or the active policy moved past the draft's base version (code `draft_stale` — retry with `acknowledge_stale: true`)
429Too many policy writes from this caller — see Retry-After (shares POST /v1/kyc/policy's budget: every call mints an immutable policy version row)
500Internal server error