Create rule
Create a new rule in your workspace using POST /dev/v1/rule. The request body must include name and type. The type determines which other fields are required:
type = simpleRule—customInput,conditions(startNode+nodes),action(then/else),settings, optionalfirstCustomInput. LeavedecisionTablerows/properties/results empty or null for a pure simple rule.type = decisionTable—customInput,conditions,decisionTable(firstRow,firstProperty,firstResult,rows,properties,results),action.then.outputData,policy,settings. Do not useruleSet/ruleChainfor the table itself.type = ruleSet—ruleSet(array of rule IDs),ruleSetPolicy,firstRuleChain,ruleChain,settings.conditions/decisionTableare typically empty.
A minimal stub (only name, type, dataSetId) is not sufficient to create a working rule. You need the full payload shape Nected expects—the same structure you see when you get a rule by id (minus top-level id / checksum on create).
Create a new rule. Request body must include name and type (simpleRule, decisionTable, or ruleSet).
Use the Examples dropdown for a complete, copy-paste-ready payload per type. Create returns data.id and data.checksum (see 201 response example).
Dev API key (Nected-API-Key header)
Branch name (optional)
Request body for Create rule. Must include name and type. type is one of simpleRule, decisionTable, or ruleSet.
The high-level shape is the same for all types, but which fields you fill vs. leave blank depends on the rule type.
Shared fields (all types)
name(string, required): Rule name.type(string, required): One ofsimpleRule,decisionTable,ruleSet.description(string, optional).dataSetId(string, optional): ID of the dataset used by the rule (when applicable).customInput(object, optional): Map of custom input definitions keyed by input name.settings(object, optional): Common runtime settings (isEnabled, api, schedule, cache, dateFormat, timezone, etc.).dependencyMap(array, optional): Reserved for advanced use; usually empty on create.
When type = simpleRule
- Typically filled:
conditions,action,customInput,settings,firstCustomInput(optional). - Should be empty / null:
decisionTable.rows,decisionTable.properties,decisionTable.resultsfor pure simple rules. - Rule set fields:
ruleSet,ruleSetPolicy,firstRuleChain,ruleChain,policyare not used for evaluation of a puresimpleRule.
When type = decisionTable
- Must be filled:
decisionTable(firstRow, firstProperty, firstResult, rows, properties, results),action.then.outputData,policy. - Usually filled:
customInput,settings,firstCustomInput. - Must be empty / null:
ruleSet,ruleSetPolicy,firstRuleChain,ruleChain.
When type = ruleSet
- Must be filled:
ruleSet,ruleSetPolicy,firstRuleChain,ruleChain. - Usually filled:
customInput,settings. - Must be empty / null:
conditions,decisionTable, action output/actionNode fields as appropriate.
Canonical files: Create/create_SR.json, Create/create_decisiontable.json, Create/create_ruleset.json, and examples/ for GET/PATCH mirrors.
Rule name
Rule type; payload shape depends on this.
Required for type decisionTable
Created. Returns data.id (entity ID) and data.checksum.
Success response for Create rule (POST). Same for all rule types.
Bad Request
Internal Server Error
POST /dev/v1/rule HTTP/1.1
Host: api.nected.ai
Nected-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 4853
{
"name": "SK",
"description": "",
"type": "simpleRule",
"dataSetId": "80fb4b28-a738-4805-8db0-bf85f582d696",
"customInput": {
"creditApplication": {
"attribute": "",
"config": {},
"dataType": "list",
"executedValue": [
1,
2,
3,
4,
5,
6,
7,
8
],
"isCaseSensitive": false,
"isNullable": false,
"isOptional": false,
"name": "creditApplication",
"next": "",
"previous": "",
"query": null,
"schemaId": "",
"sourceType": ""
}
},
"conditions": {
"startNode": "rule_01",
"nodes": {
"rule_01": {
"attribute": "",
"children": [
"rule_02",
"rule_lswwurgx5l42kpg243i",
"rule_lswwus1llct3jfcvlv"
],
"dataType": "",
"leftNode": null,
"name": "",
"nodeType": "group",
"operator": "and",
"parent": "",
"query": "",
"returnType": "",
"rightNode": null,
"siblingIndex": 1,
"sourceType": "",
"value": null
},
"rule_02": {
"attribute": "",
"children": null,
"dataType": "numeric",
"leftNode": [
"rule_03"
],
"name": "",
"nodeType": "condition",
"operator": "gt",
"parent": "rule_01",
"query": "",
"returnType": "",
"rightNode": [
"rule_lswwukzuldj735ysb4p"
],
"siblingIndex": 1,
"sourceType": "",
"value": null
},
"rule_03": {
"attribute": "completed_login",
"children": null,
"dataType": "numeric",
"leftNode": null,
"name": "",
"nodeType": "params",
"operator": "",
"parent": "rule_02",
"query": "",
"returnType": "",
"rightNode": null,
"siblingIndex": 1,
"sourceType": "dataSet",
"value": null
},
"rule_lswwukzuldj735ysb4p": {
"attribute": "",
"children": null,
"dataType": "numeric",
"leftNode": null,
"name": "",
"nodeType": "constant",
"operator": "",
"parent": "rule_02",
"query": "",
"returnType": "",
"rightNode": null,
"siblingIndex": 1,
"sourceType": "",
"value": 4
},
"rule_lswwurgx5l42kpg243i": {
"attribute": "",
"children": null,
"dataType": "numeric",
"leftNode": [
"rule_lswwurgxrexpopu417o"
],
"name": "",
"nodeType": "condition",
"operator": "gt",
"parent": "rule_01",
"query": "",
"returnType": "",
"rightNode": [
"rule_lswwux5tlfi56uuaevo"
],
"siblingIndex": 2,
"sourceType": "",
"value": null
},
"rule_lswwurgxrexpopu417o": {
"attribute": "visited_pricing",
"children": null,
"dataType": "numeric",
"leftNode": null,
"name": "",
"nodeType": "params",
"operator": "",
"parent": "rule_lswwurgx5l42kpg243i",
"query": "",
"returnType": "",
"rightNode": null,
"siblingIndex": 2,
"sourceType": "dataSet",
"value": null
},
"rule_lswwus1llct3jfcvlv": {
"attribute": "",
"children": null,
"dataType": "numeric",
"leftNode": [
"rule_lswwus1lsagp6xufxgk"
],
"name": "",
"nodeType": "condition",
"operator": "gt",
"parent": "rule_01",
"query": "",
"returnType": "",
"rightNode": [
"rule_lswwv2c03lctzifevlq"
],
"siblingIndex": 3,
"sourceType": "",
"value": null
},
"rule_lswwus1lsagp6xufxgk": {
"attribute": "time_spent",
"children": null,
"dataType": "numeric",
"leftNode": null,
"name": "",
"nodeType": "params",
"operator": "",
"parent": "rule_lswwus1llct3jfcvlv",
"query": "",
"returnType": "",
"rightNode": null,
"siblingIndex": 3,
"sourceType": "dataSet",
"value": null
},
"rule_lswwux5tlfi56uuaevo": {
"attribute": "",
"children": null,
"dataType": "numeric",
"leftNode": null,
"name": "",
"nodeType": "constant",
"operator": "",
"parent": "rule_lswwux5tlfi56uuaevo",
"query": "",
"returnType": "",
"rightNode": null,
"siblingIndex": 1,
"sourceType": "",
"value": 1
},
"rule_lswwv2c03lctzifevlq": {
"attribute": "",
"children": null,
"dataType": "numeric",
"leftNode": null,
"name": "",
"nodeType": "constant",
"operator": "",
"parent": "rule_lswwv2c03lctzifevlq",
"query": "",
"returnType": "",
"rightNode": null,
"siblingIndex": 1,
"sourceType": "",
"value": 60
}
}
},
"action": {
"then": {
"firstOutputData": "Prospect_Quality",
"firstActionNode": "",
"outputData": {
"Address": {
"attribute": "NULL",
"dataType": "string",
"executedValue": "Value",
"name": "Address",
"next": "",
"returnType": "",
"schemaId": "b8b7adeb-071a-4c6c-9163-7901852c1c55",
"source": "systemVar",
"value": null
},
"Prospect_Quality": {
"attribute": "",
"dataType": "string",
"executedValue": "High Intent",
"name": "Prospect_Quality",
"next": "Address",
"returnType": "",
"schemaId": "",
"source": "",
"value": "High Intent"
}
},
"actionNode": {}
},
"else": {
"firstOutputData": "",
"firstActionNode": "actionData_1",
"outputData": {},
"actionNode": {
"actionData_1": {
"config": {
"query": ""
},
"connectorId": "658ced98-8adb-4d63-b14f-21c50d716e4b",
"entity": null,
"entityId": null,
"input": null,
"name": "action_1",
"next": "",
"pluginName": ""
}
}
}
},
"settings": {
"isEnabled": true,
"event": null,
"api": {
"isEnabled": true,
"isPrivate": false
},
"schedule": null,
"auditIO": false,
"startAt": null,
"endAt": null,
"cache": {
"enabled": false,
"duration": {
"value": 0,
"unit": ""
},
"cacheKeys": ""
},
"dateFormat": "in",
"timezone": "Africa/Algiers"
},
"firstCustomInput": "_id",
"decisionTable": {
"firstRow": "",
"firstProperty": "",
"firstResult": "",
"firstAggOutputData": "",
"rows": null,
"properties": null,
"results": null
},
"ruleSetPolicy": "",
"ruleSet": [
"94b0b2b5-6c2a-407a-b847-b1e0dfd24f91",
"8c432b6e-3275-4ef3-9726-76a10d3a16b3"
],
"firstRuleChain": "94b0b2b5-6c2a-407a-b847-b1e0dfd24f91",
"ruleChain": {
"8c432b6e-3275-4ef3-9726-76a10d3a16b3": {
"isEnabled": false,
"nextRuleId": "",
"prevRuleId": "94b0b2b5-6c2a-407a-b847-b1e0dfd24f91"
},
"94b0b2b5-6c2a-407a-b847-b1e0dfd24f91": {
"isEnabled": true,
"nextRuleId": "8c432b6e-3275-4ef3-9726-76a10d3a16b3",
"prevRuleId": ""
}
},
"policy": "",
"dependencyMap": []
}{
"data": {
"id": "16049cf8-8a88-4aeb-9266-fc2d179bb717",
"checksum": "b6b3327f41ad57098758ecb5bbc42c21"
},
"code": "success",
"message": "Success."
}Copy‑paste JSON examples
You can copy any of the following payloads, replace IDs/field values with your own, and call POST /dev/v1/rule directly.
Example payload – type = simpleRule
Example payload – type = decisionTable
Example payload – type = ruleSet
Last updated