Start or abort a flow
This endpoint allows to control the flow execution. Allowed actions are 'start' (to start a flow) or 'abort' (to stop and abort a started flow).
Endpoint
PATCHhttps://flows.generio.ai/flows/{flow_id}
Parameters
flow_id (required)
- Location: path
- Type: string
- Example:
string
Request Body
Schema
{
"action": "string"
}
- action (string): Action to perform on the flow, e.g., 'start' or 'abort'.
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 PATCH "https://flows.generio.ai/flows/{flow_id}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "string"
}'
wget --method=PATCH \
--header="Authorization: Bearer YOUR_TOKEN" \
--header="Content-Type: application/json" \
--body-data='{
"action": "string"
}' \
"https://flows.generio.ai/flows/{flow_id}" -O -
import requests
url = "https://flows.generio.ai/flows/{flow_id}"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
payload = {
"action": "string"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
const url = "https://flows.generio.ai/flows/{flow_id}";
const payload = {
"action": "string"
};
fetch(url, {
method: "PATCH",
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}";
$jsonData = <<<'JSON'
{
"action": "string"
}
JSON;
$data = json_decode($jsonData, true);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
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);