Upload input asset to a flow
Add input assets to a created flow that hasn't started yet.
Requirements:
- Flow must be in 'created' state (not yet started)
- Input MIME type must match template's allowed input types
Input Format:
Assets must be provided as data URIs with structure: data:[MIME-type];base64,[base64-data]
- Images:
data:image/png;base64,iVBORw0KGgo... - Text prompts: Plain text string without data URI prefix
For detailed examples and helper functions on how to format and upload input assets, see: https://docs.generio.ai/examples
Additional Metadata:
Optional additional field can store custom metadata that will be:
- Attached to the input asset
- Copied to corresponding output assets
- Useful for tracking or identifying specific inputs/outputs
Use Case: This endpoint is used when flows are created without initial inputs (via POST /flows). After adding all required inputs, start the flow using PATCH /flows/{flow_id} with action 'start'.
Restrictions: Once a flow has started, no additional inputs can be added.
This endpoint allows you to upload input asset to a flow.
Endpoint
POST https://flows.generio.ai/flows/{flow_id}/inputs
Parameters
flow_id (required)
- Location: path
- Type: string
Request Body
- Schema
Properties
- data (string): Base64 encoded data (e.g., 'data:image/png,base64;...')
- additional (any): Optional additional user data that is stored with flow.
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/{flow_id}/inputs" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
wget --header="Authorization: Bearer YOUR_TOKEN" \
"https://flows.generio.ai/flows/{flow_id}/inputs" -O -
import requests
url = "https://flows.generio.ai/flows/{flow_id}/inputs"
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/{flow_id}/inputs";
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/{flow_id}/inputs";
$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;
?>