Step 4: Create a flow definition for registration

POST {{apiPath}}/environments/{{envID}}/flowDefinitions

Request Body

{"name"=>"Registration-Flow-Definition_{{$timestamp}}", "enabled"=>true, "trigger"=>{"type"=>"SIGN_ON_POLICY", "next"=>"registrationForm"}, "stepDefinitions"=>{"createUser"=>{"type"=>"USER_CREATE", "configuration"=>{"population"=>{"id"=>"{{registrationFormPopID}}"}, "lifecycle"=>{"status"=>"VERIFICATION_REQUIRED"}}, "input"=>{"user"=>{"username"=>"${steps.registrationForm.outputs.formData.user.username}", "email"=>"${steps.registrationForm.outputs.formData.user.email}", "password"=>"${steps.registrationForm.outputs.formData.user.password}"}}, "outlets"=>{"SUCCEEDED"=>{"next"=>"verifyEmail", "displayName"=>"Succeeded", "description"=>"The user was successfully created"}}, "displayName"=>"Create User", "description"=>"This step creates the user with the account information that was collected by the registration form. The user's lifecycle status is set to 'VERIFICATION_REQUIRED', which requires the user to verify their account before they can authenticate with PingOne.", "iconUrl"=>"data:image/svg+xml,%3Csvg width='22' height='22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M6,10V7H4V10H1V12H4V15H6V12H9V10M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12Z' /%3E%3C/svg%3E"}, "verifyEmail"=>{"type"=>"USER_ACCOUNT_VERIFY", "input"=>{"user"=>{"id"=>"${steps.createUser.outputs.user.id}"}}, "outlets"=>{"VERIFIED"=>{"next"=>"completeFlow", "displayName"=>"Verified", "description"=>"The account was successfully verified"}}, "displayName"=>"Verify Email", "description"=>"This step presents an account verification form to the user. The user will be able to authenticate with PingOne once they have successfully verified their account.", "iconUrl"=>"data:image/svg+xml,%3Csvg width='22' height='22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M23.5 17L18.5 22L15 18.5L16.5 17L18.5 19L22 15.5L23.5 17M13 18H3V8L11 13L19 8V13H21V6C21 4.9 20.1 4 19 4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H13V18M19 6L11 11L3 6H19Z' /%3E%3C/svg%3E"}, "registrationForm"=>{"type"=>"FORM", "configuration"=>{"form"=>{"id"=>"{{registrationFormID}}"}}, "input"=>{"formData"=>{"user"=>{"username"=>"${flow.inputs.parameters.loginHint}"}}}, "outlets"=>{"SUBMITTED"=>{"next"=>"createUser", "displayName"=>"Submitted", "description"=>"The user submitted the form"}}, "displayName"=>"Registration Form", "description"=>"This step presents a registration form to the user to collect their account information. The 'username' field will be pre-populated with the value of the 'loginHint' request parameter, if present.", "iconUrl"=>"data:image/svg+xml,%3Csvg width='22' height='22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M15 5H18L16.5 7L15 5M5 2H19C20.11 2 21 2.9 21 4V20C21 21.11 20.11 22 19 22H5C3.9 22 3 21.11 3 20V4C3 2.9 3.9 2 5 2M5 4V8H19V4H5M5 20H19V10H5V20M7 12H17V14H7V12M7 16H17V18H7V16Z' /%3E%3C/svg%3E"}, "completeFlow"=>{"type"=>"COMPLETE_FLOW", "configuration"=>{"result"=>"COMPLETE"}, "input"=>{"context"=>{"amr"=>["pwd"], "user"=>{"id"=>"${steps.createUser.outputs.user.id}"}}}, "displayName"=>"Complete Flow", "description"=>"This step redirects the browser to the URI defined by the 'redirectUri' request parameter, if present. The URI needs to be whitelisted in the trigger configuration in order to redirect to a location outside of PingOne.", "iconUrl"=>"data:image/svg+xml,%3Csvg width='22' height='22' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z' /%3E%3C/svg%3E"}}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring