Docs

Get a flow definition by ID

GET
/flow_definitions/{flow_definition_id}

Returns one flow definition revision. Pass the id that publishFlowDefinition (POST /flow_definitions) or listFlowDefinitions (GET /flow_definitions) returns.

Authorization

headerAuthorizationBearer <token>

Scope: flow_definition.read

Path Parameters

flow_definition_id*string

The id that publishFlowDefinition (POST /flow_definitions) returns.

Response Body

The flow definition.

application/json
  1. response
id*string

The ID of the flow definition.

project_id*string

The ID of the project this flow definition belongs to.

flow_definition*

A flow definition is the configuration of one flow: the sequence of screens the login component (<zitadel-login>) walks a user through to sign in, register, recover access or similar. Each screen is a step. A step collects fields (inputs taken from properties of the user schema), offers actions (what the user can do, such as submit the form or follow a link) and may require gates (security checks, such as a captcha, that must pass before the server accepts the submission). Transitions say which step follows each action.

The definition is server-side configuration and is never sent to the frontend. The server evaluates it and returns the current step, with its fields, actions and gates, to the client.

Administrators create flow definitions, either as .zitadel/flows/ files that zitadel deploy publishes or through the API, and they are stored in the project/team configuration hierarchy. The server selects the matching definition from the purpose and audience when a flow starts with createFlow (POST /flows).

user_schema?|

The user schema this flow operates on: the same object getSchema (GET /schemas/{schema_id}) returns. Present only when the request asked for it with expand=user_schema; null when it was requested but the referenced schema no longer resolves or the caller may not read it.

created_at*string

When the flow definition was created.

Formatdate-time
updated_at*string

When the flow definition was last updated.

Formatdate-time
Example Request
import { configureZitadel, getApi } from "@zitadel/api/config";// In the browser, through the SDK proxy: the session cookie authenticates the call.const api = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));const flowDefinition = await api.getFlowDefinition("flowdef_01KWH8Q5NZT7F0N9WD3P2E4YM6");
Example Response
{  "id": "string",  "project_id": "string",  "flow_definition": {    "$schema": "string",    "name": "standard-login",    "user_schema": "string",    "purposes": {      "property1": "string",      "property2": "string"    },    "audience": {      "team_ids": [        "string"      ],      "app_ids": [        "string"      ]    },    "steps": [      {        "name": "string",        "fields": [],        "actions": [],        "gates": {},        "sso_providers": [],        "on_success": "create_user",        "complete": "redirect",        "transitions": {          "property1": {            "target": "string",            "action": "switch",            "purpose": "login"          },          "property2": {            "target": "string",            "action": "switch",            "purpose": "login"          }        }      }    ]  },  "user_schema": {    "id": "string",    "schema": {      "$schema": "https://json-schema.org/draft/2020-12/schema",      "objectType": "string",      "kind": "user-schema",      "metaSchema": "http://example.com",      "x-auth-methods": {        "password": {          "enabled": true        },        "passkey": {          "enabled": true        },        "magic_link": {          "enabled": true        },        "sso": {          "providers": [            "google"          ],          "enabled": true        },        "otp": {          "enabled": true        }      },      "x-identifier": "string",      "x-display": [        "string"      ],      "properties": {        "property1": {          "x-unique": "unspecified",          "x-claim": "string",          "x-audit": false,          "properties": {            "property1": {},            "property2": {}          }        },        "property2": {          "x-unique": "unspecified",          "x-claim": "string",          "x-audit": false,          "properties": {            "property1": {},            "property2": {}          }        }      }    },    "metadata": {      "created_at": "2019-08-24T14:15:22Z",      "in_use": true    }  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}

Was this helpful?