Safety Flows

Safety flows provide task-based account verification and safety workflows.

Safety Flow Task Object

A safety flow task describes the current task assigned to the user.

Safety Flow Task Structure
FieldTypeDescription
task_idstringThe ID of the task
task_typeintegerThe type of task
assignment_idstringThe ID of the task assignment
ui_componentsafety flow UI component objectThe UI component used to complete the task
flow_contextsafety flow context objectThe context of the flow containing the task
Safety Flow Task Type
ValueNameDescription
-1REFRESH_APPRequires the client to refresh
3EMAIL_VERIFICATIONRequires email verification
9AGE_VERIFICATIONRequires age verification
10PARENTAL_CONSENT_CONNECTIONRequires a Family Center parental connection

Safety Flow UI Component Object

A safety flow UI component identifies the interface and configuration for a task.

Safety Flow UI Component Structure
FieldTypeDescription
componentsafety flow component objectThe component rendered for the task

Safety Flow Component Object

A safety flow component contains a component type and type-specific configuration.

Safety Flow Component Structure
FieldTypeDescription
typestringThe component type
data?objectType-specific component data
Safety Flow Component Type
ValueDescription
email_verificationAn email verification component
phone_verificationA phone verification component
generic_call_to_actionA generic call-to-action component
refresh_appA client refresh component
age_verificationAn age verification component
parental_consent_connectionA Family Center parental connection component

For a parental_consent_connection component, the component object may additionally contain link_code, link_code_expires_at, and pending_requests. Each pending request contains parent_id, parent_username, parent_avatar, and created_at fields.

Safety Flow Context Object

A safety flow context identifies the flow and its ordered tasks.

Safety Flow Context Structure
FieldTypeDescription
flow_idstringThe ID of the flow
tasksarray[object]The ordered tasks, each containing a task_type integer

Endpoints

Get Safety Flow Task

GET/safety-flows/task

Returns the current safety flow task object. Returns a 204 empty response when there is no current task.

Advance Safety Flow Task

POST/safety-flows/task

Submits data for the current task. Returns a safety flow task object on success.

JSON Params
FieldTypeDescription
task_idstringThe ID of the task
flow_idstringThe ID of the flow
dataobjectComponent-specific submission data

For components without input, data contains { "type": "empty" }.

Example JSON Params
{
"task_id": "01J56Q1VQY9Q8X2V7H7N9P4BZA",
"flow_id": "01J56Q0SD5F4M3J6TBQX8X8Z2C",
"data": {
"type": "empty"
}
}