curl --request POST \
--url https://api.example.com/api/save-flow.php \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"parent_id": {},
"node_type": "<string>",
"content": "<string>",
"options": [
{}
],
"metadata": {},
"order_position": 123,
"_import": true,
"json": [
{}
]
}
'{
"success": true,
"node_id": 123,
"error": "<string>",
"imported_nodes": 123
}Create or update a flow node
curl --request POST \
--url https://api.example.com/api/save-flow.php \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"parent_id": {},
"node_type": "<string>",
"content": "<string>",
"options": [
{}
],
"metadata": {},
"order_position": 123,
"_import": true,
"json": [
{}
]
}
'{
"success": true,
"node_id": 123,
"error": "<string>",
"imported_nodes": 123
}null to create a new node.null for root nodes."message" - Bot sends a message"question" - Bot asks a question"menu" - Multiple choice options"end" - Conversation endpointnode_type: "menu")Each option should have:label (string): Display textvalue (string): Option value/identifiervalidation (string): Validation type for questions ("text", "email", "phone", etc.)required (boolean): Whether response is mandatoryaction (string): Special action to triggertrue to enable bulk import mode_import: true)curl -X POST https://your-domain.com/api/save-flow.php \
-H "Content-Type: application/json" \
-d '{
"parent_id": null,
"node_type": "message",
"content": "¡Bienvenido a nuestro servicio!",
"order_position": 1
}'
{
"success": true,
"node_id": 42
}
{
"success": true,
"imported_nodes": 15
}
{
"success": false,
"error": "node_type is required"
}
{
"success": false,
"error": "Campo \"json\" requerido para importación"
}
{
"success": false,
"error": "JSON inválido"
}
| Status Code | Description |
|---|---|
| 200 | Node saved successfully |
| 400 | Invalid JSON |
| 405 | Method not allowed (only POST accepted) |
| 422 | Validation error (invalid node data) |
| 500 | Internal server error |
node_type is required and must be one of: message, question, menu, endcontent is required for all node typesoptions array is required when node_type is menuparent_id must reference an existing node (or be null for root)json field with array of nodes_import flag)FlowBuilderService->saveNode()FlowBuilderService->importFromJson()api/save-flow.php:11-44