Skip to content

Publish the KYC policy editor draft as the next policy version

POST/v1/kyc/policy/draft/publish

Requires 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

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

programme_idstring (uuid)required
flow_keystring
acknowledge_staleboolean

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

201

The newly published policy version.

idstringrequired
versionintegerrequired
definitionobjectrequired
+ show properties
required_inputsarray of stringrequired
required_signalsarray of stringrequired
bandsobjectrequired
+ show properties
approve_at_or_abovenumberrequired
reject_belownumberrequired
weightsobjectrequired
+ show properties

No properties.

provenance_weightsobject
+ show properties
face_matchobjectrequired
+ show properties
controllednumberrequired
submittednumberrequired
selfie_capture"any" | "controlled_only"
accepted_document_typesarray of "passport" | "national_id" | "residence_permit" | "driving_licence"
refer_onarray of stringrequired
reject_onarray of stringrequired
ttl_secondsintegerrequired
retention_secondsintegerrequired
step_orderarray of "details" | "document" | "selfie"
required_fieldsarray of string
optional_fieldsarray of string
field_orderarray of string
field_configobject
+ show properties

No properties.

rulesobject
+ show properties
min_ageinteger
allowed_nationalitiesarray of string
data_quality_checksobject
+ show properties
name_charactersboolean
date_of_birth_parseableboolean
minimum_ageboolean
document_expiryboolean
nationalityboolean
extra_required_inputsarray of "given_name" | "family_name" | "date_of_birth" | "nationality" | "document_number" | "document_expiry" | "document_issuing_state" | "address_line1" | "address_line2" | "address_city" | "address_region" | "address_postcode" | "address_country"
workflowobject
+ show properties
startstringrequired
nodesobjectrequired
+ show properties

No properties.

edgesarray of objectrequired
+ show properties
fromstringrequired
tostringrequired
whenstring
introobject
+ show properties
titlestringrequired
descriptionstring
button_textstring
level_snapshotsobject
+ show properties

No properties.

level_namesobject
+ show properties

No properties.

created_atstringrequired
capabilitiesobject
+ show properties
controlled_capturebooleanrequired
document_extractionbooleanrequired
flowobject
+ show properties
stepsarray of "details" | "document" | "selfie"required
fieldsarray of objectrequired
+ show properties
keystringrequired
requiredbooleanrequired
locked_byarray of string
input"text" | "dropdown" | "date"
hintstring
optionsarray of object
+ show properties
valuestringrequired
labelstring
rulesobjectrequired
+ show properties
min_ageinteger
allowed_nationalitiesarray of string
workflowobject
+ show properties
startstringrequired
nodesobjectrequired
+ show properties

No properties.

edgesarray of objectrequired
+ show properties
fromstringrequired
tostringrequired
whenstring
levelsarray of objectrequired
+ show properties
keystringrequired
display_namestringrequired
screensintegerrequired
flow_keystring
400

Validation error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
401

Authentication required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
403

Forbidden

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
404

No draft for this programme/flow and no referenced level's definition changed since, or differs from, the active version (code `no_draft`)

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
409

Idempotency-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`)

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
429

Too many policy writes from this caller — see Retry-After (shares POST /v1/kyc/policy's budget: every call mints an immutable policy version row)

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
500

Internal server error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring