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 informationinputs: 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
- Schema
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
- wget
- Python
- JavaScript
- PHP
curl -X POST "https://flows.generio.ai/flows" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
wget --header="Authorization: Bearer YOUR_TOKEN" \
"https://flows.generio.ai/flows" -O -
import requests
url = "https://flows.generio.ai/flows"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
const url = "https://flows.generio.ai/flows";
fetch(url, {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
<?php
$url = "https://flows.generio.ai/flows";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_TOKEN",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>