Upload input file for a flow
This endpoint allows to add files (primarily images) to a created flow. The images are expected as MIME-Type + Base64 (e.g., 'data:image/png;base64,abc...'). Allowed types are image/png, image/jpg, image/tiff, and image/bmp. Important: images can only be added to a created flow that has not been started yet. After a flow has been started, it is not possible to add more input files. Additional data is optional and can be used to store user-specific information attached to the input file.
Endpoint
POSThttps://flows.generio.ai/flows/{flow_id}/input
Parameters
flow_id (required)
- Location: path
- Type: string
- Example:
string
Request Body
Schema
{
"file_data": "string"
}
- file_data (string): Base64 encoded data of the file to be uploaded (e.g., 'data:image/png,base64;...')
- additional (any): Optional additional data for the input file.
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}/input" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"file_data": "string"
}'
wget --method=POST \
--header="Authorization: Bearer YOUR_TOKEN" \
--header="Content-Type: application/json" \
--body-data='{
"file_data": "string"
}' \
"https://flows.generio.ai/flows/{flow_id}/input" -O -
import requests
url = "https://flows.generio.ai/flows/{flow_id}/input"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
payload = {
"file_data": "string"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://flows.generio.ai/flows/{flow_id}/input";
const payload = {
"file_data": "string"
};
fetch(url, {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
<?php
$url = "https://flows.generio.ai/flows/{flow_id}/input";
$jsonData = <<<'JSON'
{
"file_data": "string"
}
JSON;
$data = json_decode($jsonData, true);
$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"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);