Documentation menu

Developer API · resource

AI flows

WhatsApp AI chatbot designs: persona (`system`), knowledge (`flowDesign`), trigger keywords and assignment rules.

Scope ai-flows:read for reads · ai-flows:write for changes

Operations

GET/v1/ai-flowsList — see list
POST/v1/ai-flowsCreate — see create
GET/v1/ai-flows/{id}Read — see get
PATCH/v1/ai-flows/{id}Update — see update
DELETE/v1/ai-flows/{id}Delete — see delete
Minimal create
curl -X POST https://api2.djcsystem.com/v1/ai-flows \
  -H "Authorization: Bearer $DJC_TOKEN" -H "Content-Type: application/json" \
  -d '{ "name": "…" }'

Fields

Fields you may send on create. Updatable marks fields accepted by PATCH. Anything not listed is server-owned or hidden.

FieldTypeOn createUpdatable
namestringrequiredyes
statusenum(active|inactive)optionalyes
keywordsarray<string>optionalyes
systemstringoptionalyes
flowDesignstringoptionalyes
disableAIbooleanoptionalyes
collectDataOneAtATimebooleanoptionalyes
dataFieldsarray<object>optionalyes
roundRobinbooleanoptionalyes
autoAssignmentIdsarray<string>optionalyes
forwardNumbersstringoptionalyes
forwardMessagestringoptionalyes
pinnedbooleanoptionalyes
whoCanEditenum(everyone|only me)optionalyes

Filters & sorting

Filterablestatuspinnedtype
Sortabledate
Default orderdate:desc

Child: blocks

Nodes of the follow-up sequence (Sequences Design canvas). Connect them with `relations`.

GET/v1/ai-flows/{id}/blocks
POST/v1/ai-flows/{id}/blocks
GET/v1/ai-flows/{id}/blocks/{childId}
PATCH/v1/ai-flows/{id}/blocks/{childId}
DELETE/v1/ai-flows/{id}/blocks/{childId}
FieldTypeOn createUpdatable
namestringrequiredyes
blockTypeenum(sequential|textNode|questionNode|labelNode|assignLeadNode|stopFlowNode|telegramNotificationNode|whatsappNotificationNode)requiredno
messagestringoptionalyes
descriptionstringoptionalyes
positionobjectoptionalyes
orderIdnumberoptionalyes
timenumberoptionalyes
timeUnitenum(seconds|minutes|hours|days)optionalyes
statusenum(active|inactive)optionalyes
waitForReplybooleanoptionalyes
replyTimenumberoptionalyes
replyTimeUnitenum(seconds|minutes|hours|days)optionalyes
dataFieldsarray<object>optionalyes
questionNoReplyReaskbooleanoptionalyes
questionNoReplyTimenumberoptionalyes
questionNoReplyTimeUnitenum(seconds|minutes|hours|days)optionalyes
questionNoReplyRetryCountnumberoptionalyes
questionIrrelevantReplyReaskbooleanoptionalyes
questionIrrelevantReplyRetryCountnumberoptionalyes
questionAskOneAtATimebooleanoptionalyes
labelsarray<object>optionalyes
selectedMembersarray<string>optionalyes
roundRobinbooleanoptionalyes
overrideAssignmentbooleanoptionalyes
whatsappNotificationPhonesarray<string>optionalyes
whatsappNotificationAssignedUsersbooleanoptionalyes

Filterable: blockTypeorderIdstatus

  • Set `orderId: 0` on exactly one block — that is where the sequence starts. Other blocks default to 999.
  • `position` is canvas coordinates; space nodes ~350px apart horizontally so they do not overlap.
  • `sequential` sends `message` then waits `time`/`timeUnit` before following its outgoing relation; `textNode` is the same with reply handling; `questionNode` collects `dataFields` from the customer.

Child: relations

Edges between blocks. Creating one also records the target on the source block's `targetNodeId`, as the canvas does.

GET/v1/ai-flows/{id}/relations
POST/v1/ai-flows/{id}/relations
GET/v1/ai-flows/{id}/relations/{childId}
DELETE/v1/ai-flows/{id}/relations/{childId}
FieldTypeOn createUpdatable
sourceNodeIdstringrequiredno
targetNodeIdstringrequiredno
sourceHandleIdstringoptionalno

Filterable: sourceNodeIdtargetNodeId

  • Create blocks first, then relations. One outgoing relation per handle is typical for a linear sequence.
  • `sourceHandleId` must be an output of the SOURCE block type: sequential/notification → SEQUENTIAL; questionNode → SEQUENTIAL (data collected) | NO_REPLY | IRRELEVANT; textNode → SEQUENCE (immediately) | REPLIED | NO_REPLY. assignLeadNode, labelNode and stopFlowNode are terminal.
  • Omit `sourceHandleId` to use the type's default (textNode defaults to REPLIED). A wrong handle is rejected with 400 and `details.allowedHandles`.

Good to know

  • `system` is the chatbot personality prompt; `flowDesign` is free-text knowledge the bot answers from.
  • Deleting a flow does not delete its knowledge records — remove them via `knowledge-records` with `filter[flowId]`.