Skip to main content

Create a new flow

Create a new flow instance from a template. Flows can be created in two modes: with or without initial inputs.

Request Parameters:

  • template: Template ID or name (retrieve available templates via GET /templates)
  • parameters: Template-specific configuration options (see template documentation)
  • additional: Optional custom metadata for user-specific information
  • inputs: Optional array of input files (images, prompts, etc.)

Behavior:

  • Without inputs: Flow is created in 'created' state, awaiting inputs via POST /flows/{flow_id}/inputs
  • With inputs: Flow automatically transitions to 'starting' state and begins execution

Input Format: Input files must be provided as data URIs with MIME type and base64-encoded content (e.g., 'data:image/png;base64,abc...') or as plain text prompts. Accepted MIME types depend on the template configuration.

Example Request:

{
"template": "model_generate_fromprompt",
"parameters": {
"quality": "high"
},
"inputs": [
{
"data": "A modern office chair",
"additional": null
}
],
"additional": null
}
info

This endpoint allows you to create a new flow.

Endpoint

POST https://flows.generio.ai/flows

Request Body

Properties

  • template (string)
  • parameters (any)
  • additional (any): Optional additional user data that is stored with flow.
  • inputs (any): Input assets, including data and optional additional information.

Responses

200

Successful Response

422

Validation Error

Code Examples

Copy and run these examples in your terminal or code editor. Make sure to replace YOUR_TOKEN with your actual authentication token.

curl -X POST "https://flows.generio.ai/flows" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"