Update a flow
Partially updates a flow. Changes take effect on the next call; calls already in progress keep the graph they began with.
Omitted fields keep their values. An explicit null clears description, start_agent_id and summary_prompt, and empties the two after-call id lists.
Supplying graph replaces the whole canvas — send it whole, not as a delta.
Cross-field rules are evaluated against the merged result, so a patch that only moves the start agent must still name an agent the stored graph contains.
If-Match is optional but recommended; a stale strong tag returns 412 with the current ETag. Archived flows reject updates with 409 flow_archived. Requires the flows entitlement.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
id*stringuuidIf-Match?stringOptional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource.
application/json- body
Omitted fields are unchanged; at least one field must be supplied. Explicit null clears description, start_agent_id and summary_prompt, and empties the two after-call id lists. graph and summary_enabled reject null. Supplying graph REPLACES the whole canvas. Cross-field rules are evaluated against the merged result, so a patch that only moves the start agent must still name an agent the stored graph contains. Maximum encoded body size is 1048576 bytes.
1 <= propertiesname?string1 <= length <= 200slug?string^[a-z0-9]+(?:-[a-z0-9]+)*$2 <= length <= 64description?|length <= 2000start_agent_id?|uuidgraph?The flow canvas as supplied on write. Sending it REPLACES the stored graph whole; it is never merged edge by edge.
summary_enabled?booleansummary_prompt?|length <= 50000extraction_object_ids?array<>|items <= 100webhook_config_ids?array<>|items <= 100The updated flow.
application/json- response
A named graph of existing agents joined by agent-to-agent handoffs. The same representation is returned for a single flow and for each element of a list page. A flow owns the graph, the start agent and an after-call override; prompt, model and voice configuration stays on each member agent's own version. Flows are not versioned — resource_version feeds the strong ETag that PATCH's If-Match is checked against.
id*stringuuidorg_id*stringuuidslug*string^[a-z0-9]+(?:-[a-z0-9]+)*$2 <= length <= 64name*string1 <= length <= 200description?stringAbsent when no description is set.
length <= 2000start_agent_id?stringThe agent that ANSWERS a call routed at this flow; the graph's edges take over from there. Must be one of the agents on the canvas. Absent when the flow has no start agent yet, in which case the flow cannot be targeted by a number, a job or a call.
uuidgraph*The flow canvas — the agents on it and the handoffs between them.
agent_count*integerDerived count of graph.nodes, so a list page can show each flow's shape.
0 <= valuehandoff_count*integerDerived count of graph.edges.
0 <= valuesummary_enabled*booleanAfter-call override. These four fields REPLACE every member agent's own after-call configuration for calls that run inside the flow.
summary_prompt?stringAbsent when no override prompt is set.
length <= 50000extraction_object_ids*array<>items <= 100webhook_config_ids*array<>items <= 100resource_version*integerMonotonic row version maintained by the database, never by the handler. It is the value behind the strong ETag.
int640 <= valuearchived_at?stringAbsent unless the flow has been archived.
date-timecreated_at*stringdate-timeupdated_at*stringdate-timecurl -X PATCH 'https://api.kejue.co/v1/flows/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{ "name": "Support front door", "graph": { "nodes": [ { "id": "triage", "agent_id": "11111111-1111-4111-8111-111111111111", "x": 0, "y": 0 } ], "edges": [] }}'{ "id": "33333333-3333-4333-8333-333333333333", "org_id": "44444444-4444-4444-8444-444444444444", "slug": "support-front-door", "name": "Support front door", "start_agent_id": "11111111-1111-4111-8111-111111111111", "graph": { "nodes": [ { "id": "triage", "agent_id": "11111111-1111-4111-8111-111111111111", "x": 0, "y": 0, "agent_slug": "triage", "agent_name": "Triage" } ], "edges": [] }, "agent_count": 1, "handoff_count": 0, "summary_enabled": true, "extraction_object_ids": [], "webhook_config_ids": [], "resource_version": 4, "created_at": "2026-09-15T09:00:00Z", "updated_at": "2026-09-15T10:20:00Z"}