Upload input asset for a flow
This endpoint allows to add input assets to a created flow. The assets are expected as data with the structure MIME-Type + Base64 (e.g., 'data:image/png;base64,abc...'). Important: assets 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 assets. Additional data is optional and can be used to store user-specific information attached to the input asset (and copied to the output asset).
Endpoint
POSThttps://flows.generio.ai/flows/{flow_id}/inputs
Parameters
flow_id (required)
- Location: path
- Type: string
Request Body
Schema
- data (string): Base64 encoded data (e.g., 'data:image/png,base64;...')
- additional (any): Optional additional user data that is stored with flow.
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" \
-d '{}'
wget --method=POST \
--header="Authorization: Bearer YOUR_TOKEN" \
--header="Content-Type: application/json" \
--body-data='{}' \
"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"
}
payload = {}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://flows.generio.ai/flows/{flow_id}/inputs";
const payload = {};
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}/inputs";
$jsonData = <<<'JSON'
{}
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);