Customers · API reference
Workflows
Find the workflows a key can run, and create new ones from a list of steps.
- List workflows —
GET /workflows - Create a workflow —
POST /workflows
GETList workflows#
GET https://app.sushibelt.ai/api/v1/workflows
Lists the workflows this key can run, newest change first. Only your team's workflows are listed. If the key is limited to certain workflows, only those are listed. There is no pagination: every workflow is returned.
Needs an API key with the workflows:read scope. See Scopes.
Example request#
Set SUSHIBELT_API_KEY to your key first, and replace each YOUR_… value.
curl "https://app.sushibelt.ai/api/v1/workflows" \
-H "Authorization: Bearer $SUSHIBELT_API_KEY"Responses#
- 200 OK — The workflows this key can run. An empty list means the team has none, or the key may run none.
- 401 Unauthorized — The key is missing, malformed, unknown, revoked or expired. Message:
Unauthorized. - 403 Forbidden — The key does not have the
workflows:readscope. Message:Scope not permitted for this key. - 429 Too many requests — Too many requests with this key. By default a key may make 60 requests a minute. Wait for the number of seconds in
Retry-After. Message:Rate limit exceeded. Headers:Retry-After.
| Name | Description |
|---|---|
workflowsarray of WorkflowSummary · Required | No description. |
workflows[].idstring (uuid) · Required | Pass this to Run a workflow. |
workflows[].namestring · Required | No description. |
workflows[].descriptionstring or null · Required | No description. |
workflows[].statusstring or null · Required | One of: draft, active, archived. |
workflows[].updated_atstring or null (date-time) · Required | No description. |
{
"workflows": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "string",
"description": "string",
"status": "draft",
"updated_at": "2026-09-29T12:00:00Z"
}
]
}POSTCreate a workflow#
POST https://app.sushibelt.ai/api/v1/workflows
Creates a workflow from a list of steps. Sushibelt turns the steps into a canvas graph for you. The workflow belongs to an agent: pass agentId to add it to an existing agent, or projectId to create a new agent for it. Keys limited to certain workflows cannot create workflows.
Needs an API key with the workflows:write scope. See Scopes.
Request body#
Give exactly one of agentId and projectId.
| Name | Description |
|---|---|
namestring · Required | The workflow's name. |
agentIdstring (uuid) · Optional | Add the workflow to this agent. |
projectIdstring (uuid) · Optional | Create a new agent in this project and add the workflow to it. |
agentNamestring · Optional | The new agent's name, when you pass projectId. Defaults to name. |
stepsarray of WorkflowStep · Required | No description. |
steps[].keystring · Required | A name for this step, unique within the request. Other steps refer to it in inputs. |
steps[].typestring · Required | The node type. One of 55 values; see the list below. |
steps[].labelstring · Optional | The name shown on the canvas. Defaults to the node type's name. |
steps[].configobject · Optional | The node's settings; the fields depend on the node type. Set apiInputKey on a TextEntry or PromptBuilder step to let a run replace its value. |
steps[].inputsarray of one of: string, WorkflowStepInput · Optional | The steps this step reads from. A step key alone connects first output to first input. |
steps[].inputs[].fromstring · Required | The key of the step to connect from. |
steps[].inputs[].sourceHandlestring · Optional | The output handle on that step. |
steps[].inputs[].targetHandlestring · Optional | The input handle on this step. |
Example request#
Set SUSHIBELT_API_KEY to your key first, and replace each YOUR_… value.
curl -X POST "https://app.sushibelt.ai/api/v1/workflows" \
-H "Authorization: Bearer $SUSHIBELT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Fox portrait",
"projectId": "00000000-0000-0000-0000-000000000000",
"steps": [
{
"key": "subject",
"type": "TextEntry",
"config": {
"text": "a red fox",
"apiInputKey": "subject"
}
},
{
"key": "image",
"type": "DiffusionWorker",
"inputs": [
"subject"
]
},
{
"key": "preview",
"type": "ImageGallery",
"inputs": [
"image"
]
}
]
}'Responses#
- 201 Created — The workflow was created.
- 400 Bad request — The request is missing something: a name, at least one step, or exactly one of
agentIdandprojectId. Messages:name is required,steps is required,Provide exactly one of agentId or projectId. - 401 Unauthorized — The key is missing, malformed, unknown, revoked or expired. Message:
Unauthorized. - 403 Forbidden — The key does not have the
workflows:writescope, or it is limited to certain workflows. Messages:Scope not permitted for this key,This key is not permitted to create workflows. - 404 Not found — The agent or project does not exist in your team. Message:
Agent or project not found. - 422 Unprocessable content — The steps do not make a valid workflow: an unknown node type, a repeated step key, an input that names no step, or a graph that fails validation (the reasons are listed in
errors). Messages:Unknown node type: "Foo",Workflow validation failed. - 429 Too many requests — Too many requests with this key. By default a key may make 60 requests a minute. Wait for the number of seconds in
Retry-After. Message:Rate limit exceeded. Headers:Retry-After. - 500 Server error — Something failed on our side. Message:
Server error: ….
| Name | Description |
|---|---|
workflowIdstring (uuid) · Required | No description. |
agentIdstring (uuid) · Required | No description. |
projectIdstring (uuid) · Required | No description. |
stepsCountinteger · Required | No description. |
{
"workflowId": "00000000-0000-0000-0000-000000000000",
"agentId": "00000000-0000-0000-0000-000000000000",
"projectId": "00000000-0000-0000-0000-000000000000",
"stepsCount": 1
}| Name | Description |
|---|---|
errorstring · Required | What went wrong, in plain words. |
| Name | Description |
|---|---|
errorstring · Required | Always Workflow validation failed. |
errorsarray of any · Required | No description. |