> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/api-reference/advanced/flows.md).

# Flows

## List flows for the tenant

> Returns every flow declared in \`server/flows.yml\`, ordered by name.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Flows"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.flow:read"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"FlowListItem":{"required":["name","stepCount","type"],"type":"object","properties":{"name":{"type":"string","description":"Name of the flow, unique within the tenant."},"type":{"type":"string","description":"Type of the flow, e.g. `userRegistration`."},"stepCount":{"type":"integer","description":"Number of steps the flow executes.","format":"int32"}},"additionalProperties":false,"description":"Flow returned by the list endpoint."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/flows":{"get":{"tags":["Flows"],"summary":"List flows for the tenant","description":"Returns every flow declared in `server/flows.yml`, ordered by name.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Flows returned.","content":{"text/plain":{"schema":{"type":"array","items":{"description":"Flow returned by the list endpoint.","$ref":"#/components/schemas/FlowListItem"}}},"application/json":{"schema":{"type":"array","items":{"description":"Flow returned by the list endpoint.","$ref":"#/components/schemas/FlowListItem"}}},"text/json":{"schema":{"type":"array","items":{"description":"Flow returned by the list endpoint.","$ref":"#/components/schemas/FlowListItem"}}}}},"409":{"description":"The stored flows file cannot be parsed.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Create a flow

> Appends a new flow to \`server/flows.yml\`. Step types are validated against the step types\
> registered by the loaded extensions, and the resulting configuration is parsed back before it is\
> written, so a malformed step is rejected instead of breaking the tenant.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Flows"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.flow:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CreateFlowRequest":{"required":["name","steps"],"type":"object","properties":{"name":{"minLength":1,"type":"string","description":"Name of the flow. Must start with a lowercase letter and contain only letters, digits, hyphens or\nunderscores, from 2 to 50 characters."},"type":{"type":["null","string"],"description":"Type of the flow. Defaults to `userRegistration` when omitted."},"steps":{"type":"array","items":{"description":"One step of a flow.","$ref":"#/components/schemas/FlowStepDefinition"},"description":"Steps executed by the flow, in order. May be empty."}},"additionalProperties":false,"description":"Request body to create a flow."},"FlowStepDefinition":{"required":["type"],"type":"object","properties":{"type":{"minLength":1,"type":"string","description":"Type of the step, e.g. `mail`, `sms`, `pass` or `script`."}},"additionalProperties":{},"description":"One step of a flow."},"FlowDefinition":{"required":["name","steps","type"],"type":"object","properties":{"name":{"type":"string","description":"Name of the flow."},"type":{"type":"string","description":"Type of the flow."},"steps":{"type":"array","items":{"description":"One step of a flow.","$ref":"#/components/schemas/FlowStepDefinition"},"description":"Steps executed by the flow, in order."}},"additionalProperties":false,"description":"Full definition of a flow, returned by the get/create/save endpoints."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/flows":{"post":{"tags":["Flows"],"summary":"Create a flow","description":"Appends a new flow to `server/flows.yml`. Step types are validated against the step types\nregistered by the loaded extensions, and the resulting configuration is parsed back before it is\nwritten, so a malformed step is rejected instead of breaking the tenant.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"Request body to create a flow.","$ref":"#/components/schemas/CreateFlowRequest"}},"text/json":{"schema":{"description":"Request body to create a flow.","$ref":"#/components/schemas/CreateFlowRequest"}},"application/*+json":{"schema":{"description":"Request body to create a flow.","$ref":"#/components/schemas/CreateFlowRequest"}}},"required":true},"responses":{"201":{"description":"Flow created.","content":{"text/plain":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}},"application/json":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}},"text/json":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}}}},"400":{"description":"Name, flow type or a step is invalid.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"A flow with this name already exists, or the stored flows file cannot be parsed.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Get a flow

> Returns the type and the ordered steps of the flow identified by name. Step\
> configuration is returned exactly as stored, including step types this deployment does not know about.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Flows"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.flow:read"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"FlowDefinition":{"required":["name","steps","type"],"type":"object","properties":{"name":{"type":"string","description":"Name of the flow."},"type":{"type":"string","description":"Type of the flow."},"steps":{"type":"array","items":{"description":"One step of a flow.","$ref":"#/components/schemas/FlowStepDefinition"},"description":"Steps executed by the flow, in order."}},"additionalProperties":false,"description":"Full definition of a flow, returned by the get/create/save endpoints."},"FlowStepDefinition":{"required":["type"],"type":"object","properties":{"type":{"minLength":1,"type":"string","description":"Type of the step, e.g. `mail`, `sms`, `pass` or `script`."}},"additionalProperties":{},"description":"One step of a flow."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/flows/{name}":{"get":{"tags":["Flows"],"summary":"Get a flow","description":"Returns the type and the ordered steps of the flow identified by name. Step\nconfiguration is returned exactly as stored, including step types this deployment does not know about.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Flow returned.","content":{"text/plain":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}},"application/json":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}},"text/json":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}}}},"404":{"description":"Flow not found.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"The stored flows file cannot be parsed.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Save a flow

> Replaces the steps of an existing flow, leaving every other flow in \`server/flows.yml\` untouched.\
> The flow cannot be renamed: the name in the route is authoritative.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Flows"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.flow:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"SaveFlowRequest":{"required":["steps"],"type":"object","properties":{"type":{"type":["null","string"],"description":"Type of the flow. Keeps the currently stored type when omitted."},"steps":{"type":"array","items":{"description":"One step of a flow.","$ref":"#/components/schemas/FlowStepDefinition"},"description":"Steps executed by the flow, in order. Replaces the stored steps entirely."}},"additionalProperties":false,"description":"Request body to save an existing flow."},"FlowStepDefinition":{"required":["type"],"type":"object","properties":{"type":{"minLength":1,"type":"string","description":"Type of the step, e.g. `mail`, `sms`, `pass` or `script`."}},"additionalProperties":{},"description":"One step of a flow."},"FlowDefinition":{"required":["name","steps","type"],"type":"object","properties":{"name":{"type":"string","description":"Name of the flow."},"type":{"type":"string","description":"Type of the flow."},"steps":{"type":"array","items":{"description":"One step of a flow.","$ref":"#/components/schemas/FlowStepDefinition"},"description":"Steps executed by the flow, in order."}},"additionalProperties":false,"description":"Full definition of a flow, returned by the get/create/save endpoints."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/flows/{name}":{"put":{"tags":["Flows"],"summary":"Save a flow","description":"Replaces the steps of an existing flow, leaving every other flow in `server/flows.yml` untouched.\nThe flow cannot be renamed: the name in the route is authoritative.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"Request body to save an existing flow.","$ref":"#/components/schemas/SaveFlowRequest"}},"text/json":{"schema":{"description":"Request body to save an existing flow.","$ref":"#/components/schemas/SaveFlowRequest"}},"application/*+json":{"schema":{"description":"Request body to save an existing flow.","$ref":"#/components/schemas/SaveFlowRequest"}}},"required":true},"responses":{"200":{"description":"Flow saved.","content":{"text/plain":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}},"application/json":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}},"text/json":{"schema":{"description":"Full definition of a flow, returned by the get/create/save endpoints.","$ref":"#/components/schemas/FlowDefinition"}}}},"400":{"description":"Flow type or a step is invalid.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Flow not found.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"The stored flows file cannot be parsed.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Delete a flow

> Removes the flow from \`server/flows.yml\`. Refused with a conflict while any layout under\
> \`layouts/\` still references the flow by name, because that would leave the whole tenant\
> configuration invalid.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Flows"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.configuration.flow:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/flows/{name}":{"delete":{"tags":["Flows"],"summary":"Delete a flow","description":"Removes the flow from `server/flows.yml`. Refused with a conflict while any layout under\n`layouts/` still references the flow by name, because that would leave the whole tenant\nconfiguration invalid.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Flow deleted."},"400":{"description":"The resulting configuration is invalid.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Flow not found.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"The flow is still referenced by one or more layouts, or the stored flows file cannot be parsed.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.thewalletcrew.io/api-reference/advanced/flows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
