id and type are unchanged.startingPoint, and it must connect to another node. Node and edge IDs must be unique, and every edge must point at existing nodes. Also follow the builder's wiring rules, which the API does not check: a humanAgentNode may only be reached from a conditionNode; a conditionNode has exactly one outgoing edge and never leads to another conditionNode; an agentNode never connects directly to a knowledgeBaseNode. Typical shape: startingPoint → agentNode → conditionNode → humanAgentNode.curl --location --request PUT 'https://apigw.klinkcx.com/api/v1/ai-agents/6ad97ee52845b4f2c8daca55/flow' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-6-luna",
"nodes": [
{
"id": "start",
"type": "startingPoint",
"label": "Start",
"position": {
"x": 0,
"y": 0
}
},
{
"id": "agent-main",
"type": "agentNode",
"label": "Sales Assistant",
"position": {
"x": 320,
"y": 0
},
"instruction": "You are the sales assistant for Example Co. Reply in the customer'\''s language.\n\nGreet [contact name] and ask how you can help.\nOpening hours: Mon-Fri 9:00-18:00."
},
{
"id": "cond-human",
"type": "conditionNode",
"label": "Needs a human",
"position": {
"x": 640,
"y": 0
},
"instruction": "The customer asks to talk to a person, wants to place an order, or complains. Otherwise, no."
},
{
"id": "human",
"type": "humanAgentNode",
"label": "Sales team",
"position": {
"x": 960,
"y": 0
},
"instruction": "Tell the customer a sales specialist will join shortly."
}
],
"edges": [
{
"id": "e1",
"source": "start",
"target": "agent-main"
},
{
"id": "e2",
"source": "agent-main",
"target": "cond-human"
},
{
"id": "e3",
"source": "cond-human",
"target": "human"
}
]
}'{
"requestId": "string",
"data": {
"id": "string",
"status": "draft",
"version": "string",
"model": "string",
"savedAt": "string",
"nodes": [
{
"id": "string",
"type": "startingPoint",
"label": "string",
"position": {
"x": 0,
"y": 0
},
"instruction": "string",
"toolIds": [
"string"
],
"tools": [
{
"id": "string",
"name": "string",
"description": "string"
}
],
"providerTools": [
{
"id": "string",
"name": "string"
}
],
"knowledgeSourceIds": [
"string"
],
"vectorStoreIds": [
"string"
],
"correction": true,
"correctionGroupIds": [
"string"
],
"waitSeconds": 0
}
],
"edges": [
{
"id": "string",
"source": "string",
"target": "string",
"sourceHandle": "string",
"targetHandle": "string"
}
]
}
}