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`, `no_signal_enabled`) 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. With NO draft, publish republishes the active definition with fresh level snapshots when a level its workflow references has changed its definition since that version was published (`definition_updated_at` on `KycLevelSummary` is newer than the version) or when the level's stored definition differs from the active version's snapshot of it (a rename or an archive alone counts as neither); otherwise it 404s with code `no_draft`. 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. A draft carrying a `workflow` publishes with a snapshot of every level it references (`level_snapshots`, `level_names`); it is refused 409 `level_unavailable` (`levels` names them) when a referenced level is missing or archived, and 400 `invalid_workflow` (`problems`) for any other problem with the graph. 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
No properties.
+ show properties− hide properties
+ show properties− hide properties
+ show properties− hide properties
No 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
+ show properties− hide properties
No properties.
+ show properties− hide properties
+ show properties− hide properties
400Validation error
401Authentication required
403Forbidden
404No draft for this programme/flow and no referenced level's definition changed since, or differs from, the active version (code `no_draft`)
409Idempotency-Key reused with a different payload, the active policy moved past the draft's base version (code `draft_stale` — retry with `acknowledge_stale: true`), or a level the workflow references is missing or archived (code `level_unavailable`, `levels`)
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