Create a flow (tenant:flows:write; tenant flows tenant:flows:admin; scoped flows tenant:flows:write and the owning module's manage)
POST /api/flows/v1/flows
Module: Flows · operationId: createFlow · Tag: Flows · Auth: access token (Authorization: Bearer <accessToken>)
A personal flow belongs to the caller and acts with the caller's permissions; a tenant flow acts as the service
account it names and needs tenant:flows:admin. The draft starts from yaml, from a template (filled with
params) or a skeleton with a manual trigger. A template made for a kind of scope (scope in
GET /api/flows/v1/templates) needs a scope of that kind (400 invalid, field scope); a tenant-wide
template may be created into any scope. An inline template is an immediate automation of its module and never
a flow (400 invalid, field template).
With scope the flow belongs to a desk space or forge project: owner must be tenant and
serviceAccountId is required (400 invalid), and instead of tenant:flows:admin the module that owns the
scope must let the caller manage it – 404 when the caller may not view the scope, 403 forbidden when they
view but may not manage it, 503 scope_unavailable when the module cannot answer. The scope of a flow never
changes; keys stay unique per tenant.
Request body
application/json (required)
name(string, required): Display name (max length 200)owner(string, required):personalortenant(one ofpersonal,tenant)key(string): Lower case letters, digits and dashes; default derived from the nameparams(object): The values of the template's parameters by key (only withtemplate:400 invalid, fieldparams). A parameter left out takes its default; a wrong one is400 invalidwith the fieldparams.<key>– seerenderFlowTemplate.scope(string): What the flow belongs to:desk:space:<id>orforge:project:<id>(the id a lower-case UUID). Only withowner: tenant; the owning module decides who sees and manages the flow. (max length 160)serviceAccountId(string (uuid)): Tenant flows: the service account the flow acts astemplate(string): The key of a durable template fromGET /api/flows/v1/templates: the draft starts from its definition, filled with the new flow's key and name and the values ofparams. Not together withyaml, an unknown key and an inline template:400 invalid, fieldtemplate. (max length 63)yaml(string): The first draft
Example:
{
"name": "Kritische Tickets melden",
"owner": "personal",
"params": {
"priorities": [
"hoch",
"kritisch"
],
"recipients": [
"creator"
]
},
"template": "kritische-tickets-melden"
}
Responses
- 201 Created (
application/json) - 400 Invalid input (
invalid);fieldnames the first invalid field,details.fieldsevery one. (application/json) - 401 Missing, invalid or expired token (no body).
- 403 The token lacks the permission or has no active tenant (
forbidden). Also:person_required(a service-account key on personal flows or the task inbox),live_test_forbidden,forbidden_grant,starter_excluded. (application/json) - 404 The record does not exist in the token's tenant – or it belongs to a scope the caller may not view (a scoped flow stays hidden). (
application/json) - 409 The state does not allow it: version_conflict (reload), no_changes, archived, key_taken, flow_disabled, flow_tripped, task_closed, run_finished. (
application/json) - 503 A dependency is not available:
scope_unavailable(the module that owns a flow's scope did not answer who may see and manage it – nothing of a scoped flow is shown or changed),identity_unavailable(HR),ai_unavailable,ai_failed. (application/json)
Fields of the 201 answer:
flow(Flow)archived(boolean): Whether the flow is archivedcanEdit(boolean): Whether the caller may change the draft and publish (a scoped flow: the owning module lets the caller manage the scope and the token holds tenant:flows:write or admin)createdAt(string (date-time)): When the flow was createdcreatedBy(string): E-mail of the creatordescription(string): Description from the definitionenabled(boolean): Whether the published version's triggers start runsid(string (uuid)): Flow idkey(string): Unique per tenant; sub-flows call a flow by itname(string): Display nameowner(string):personal(acts as its creator) ortenant(acts as its service account) (one ofpersonal,tenant)ownerEmail(string): Personal flows: the owner; tenant flows: who created itpausedReason(string): Why runs stopped by themselves (owner_inactive, permission_lost, tripped)publishedNumber(integer): The live versionscope(string): What the flow belongs to –desk:space:<id>orforge:project:<id>; absent for a tenant or personal flow. The owning module decides who sees and manages a scoped flow ("Scoped flows").serviceAccountId(string (uuid)): Tenant flows: the account it acts asupdatedAt(string (date-time)): When the flow was changed lastupdatedBy(string): E-mail of who changed the flow lastversion(integer): Send it with changes
validation(Validation)diagnostics(array of Diagnostic, required): Findings of the validatorcode(string, required): Stable code, e.g.unknown_port,invalid_assignee,mail_option_not_allowed(a mail node setsmandatoryormailChannelin a personal or scoped flow)message(string, required): Human-readable explanationseverity(string, required): Errors block publishing (one oferror,warning)col(integer): Column in the YAML (1-based)line(integer): Line in the YAML (1-based)nodeId(string): The node the finding is aboutparams(object):mail_option_not_allowed:option(mandatoryormailChannel)path(string): Dotted path in the definition
permissions(array of array of string, required): The any-of permission groups of the actions and events the flow usesvalid(boolean, required): False when a finding has severityerrorports(object): The output ports of every node that parsed, by node id (the builder's handles)
Example 201 answer:
{
"flow": {
"archived": false,
"canEdit": true,
"createdAt": "2026-11-18T09:02:11Z",
"createdBy": "sophie.huber@muster-it.example",
"enabled": false,
"id": "5e7a9c1b-3d5f-4a7b-8c9d-1e3f5a7b9c0d",
"key": "kritische-tickets-melden",
"name": "Kritische Tickets melden",
"owner": "personal",
"ownerEmail": "sophie.huber@muster-it.example",
"updatedAt": "2026-11-18T09:02:11Z",
"updatedBy": "sophie.huber@muster-it.example",
"version": 1
},
"validation": {
"diagnostics": [],
"permissions": [
[
"desk:read",
"desk:write",
"desk:admin"
]
],
"valid": true
}
}
Example request
curl -X POST 'https://api.mbcom.cloud/api/flows/v1/flows' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"name":"Kritische Tickets melden","owner":"personal","params":{"priorities":["hoch","kritisch"],"recipients":["creator"]},"template":"kritische-tickets-melden"}'