Create/Update Mapping Rule
post
https://api.flxpoint.com/workflow/mapping-ruleUse this when you want to create workflow data through the API.
🔑 X-API-TOKEN⏱ 2 req/sToken: Account · Source · Channel
This page explains the endpoint. To send a live test request, use the interactive tester in Stoplight or your own Postman / HTTP client.
Create or update a mapping rule
Request
Body
application/jsonidintegerIf null this rule will be created, if non-null then the exist rule will be updated
namestringrequireddescriptionstringrequiredeventIdintegerrequiredThe ID of the event this mapping rule is run within. This value cannot be changed after the rule is created.
useOriginalInputValuebooleanrequiredWhether the rules contain within this mapping rules should start their operations on the result of previous rules or on the basis of the original value provided by the mapping template
globalObjectFieldIdintegerThe ID of the `GlobalObjectField` that this rule assigns to. This value cannot be changed after the rule is created.
globalDataTypeIdintegerrequiredThe ID of the `GlobalDataType` that this rule runs against. This value cannot be changed after the rule is created.
ruleobjectrequiredidintegerGenerated on your behalf when first creating a rule. Should not be provided unless the rule was previously saved & you are modifying a version of the rule that was directly fetched from the system.
By providing a `null` value here you are indicating a rule should be created.
By providing a non-null value here you are indicating this rule exists within the `UpdateOrCreateWorkflow` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflow` already a `400` error wil be thrown
namestringrequiredThe name of the rule, will be updated to whatever is provided.
workflowRuleTypeIdintegerrequiredThe ID of the `WorkflowRuleType` of this rule.
alwaysRunbooleanrequiredWhen set to `true` all `groups` & `conditions` are ignored and the rule will always have its a`actions` run.
default
falseenabledbooleanWhether the workflow rule is enabled and should run.
groupsarray[UpdateOrCreateWorkflowRuleGroup]requiredidintegerGenerated on your behalf when first creating a rule group. Should not be provided unless the rule group was previously saved & you are modifying a version of the rule group that was directly fetched from the system.
By providing a `null` value here you are indiciating a rule should be created.
By providing a non-null value here you are indicating this rule group exists within the `UpdateOrCreateWorkflowRule` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflowRule` already a `400` error wil be thrown
conditionsarray[UpdateOrCreateWorkflowCondition]requiredidintegerLeave as `null` in order to create a new condition. If provided with an ID that does not belong to the existing rule a `400` error will be returned.
globalObjectFieldIdintegerrequiredThe ID of the `GlobalObjectField` that provides the data this rule runs against.
workflowDataTypeComparatorIdintegerrequiredThe ID of the `WorkflowDataTypeComparator` this rule uses as a basis to perform a condition with.
conditionstringFor most standard rules the primary data condition that is used in conjunction with the comparator will be stored here.
condition2stringcondition3stringcondition4stringfieldArrayMustMatchAllbooleanWhen the field this condition operates on for the particular event is provided as an array of data rather than a singleton setting this to `true` means that all fields in that list must be truthy in order for the condition to be truthy. Otherwise only 1 of the fields in the list must be truthy to have the condition pass.
default
falseconditionArrayMustMatchAllbooleanWhen the data this condition operates on for the particular event is provided as an array of data rather than a singleton setting this to `true` means that all data in that list must be truthy in order for the condition to be truthy. Otherwise only 1 of the datums in the list must be truthy to have the condition pass.
default
falsepreModifierDataTypeComparatorIdintegermetaDatastringThis is a JSON encoded string that is used to provide & store context relating to rules that do not fit within the bounds of standard rules.
childConditionsarray[UpdateOrCreateWorkflowCondition]actionsarray[UpdateOrCreateWorkflowRuleAction]requiredidintegerGenerated on your behalf when first creating a action. Should not be provided unless the action was previously saved & you are modifying a version of the action that was directly fetched from the system.
By providing a `null` value here you are indicating this action should be created.
By providing a non-null value here you are indiciting this action exists within the `UpdateOrCreateWorkflowRule` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflowRule` already a `400` error wil be thrown
globalObjectFieldIdintegerrequiredThe ID of the `GlobalObjectField` this action will apply a transformation to.
workflowDataTypeActionIdintegerrequiredThe ID of the `WorkflowDataTypeAction` that this action applys as a transformation/modification to a field.
valuestringIf the action type uses data indicated by the user to apply its transformations those values will be supplier here.
value2stringvalue3stringvalue4stringmetaDatastringusesOtherFieldScopestringWhen using actions that depend on the values of other fields & objects this will control which objects are used to take values from.
allowed
allfilteredcorrelatedapplyToMatchedOnlybooleanWhen true, the action is applied only to elements that satisfy the rule conditions. When false or not provided, the action is applied to all elements.
childActionsarray[UpdateOrCreateWorkflowRuleAction]idintegerGenerated on your behalf when first creating a action. Should not be provided unless the action was previously saved & you are modifying a version of the action that was directly fetched from the system.
By providing a `null` value here you are indicating this action should be created.
By providing a non-null value here you are indiciting this action exists within the `UpdateOrCreateWorkflowRule` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflowRule` already a `400` error wil be thrown
globalObjectFieldIdintegerrequiredThe ID of the `GlobalObjectField` this action will apply a transformation to.
workflowDataTypeActionIdintegerrequiredThe ID of the `WorkflowDataTypeAction` that this action applys as a transformation/modification to a field.
valuestringIf the action type uses data indicated by the user to apply its transformations those values will be supplier here.
value2stringvalue3stringvalue4stringmetaDatastringusesOtherFieldScopestringWhen using actions that depend on the values of other fields & objects this will control which objects are used to take values from.
allowed
allfilteredcorrelatedapplyToMatchedOnlybooleanWhen true, the action is applied only to elements that satisfy the rule conditions. When false or not provided, the action is applied to all elements.
childActionsarray[UpdateOrCreateWorkflowRuleAction]headerNamestringheaderNamestringchildRulesarray[UpdateOrCreateWorkflowRule]idintegerGenerated on your behalf when first creating a rule. Should not be provided unless the rule was previously saved & you are modifying a version of the rule that was directly fetched from the system.
By providing a `null` value here you are indicating a rule should be created.
By providing a non-null value here you are indicating this rule exists within the `UpdateOrCreateWorkflow` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflow` already a `400` error wil be thrown
namestringrequiredThe name of the rule, will be updated to whatever is provided.
workflowRuleTypeIdintegerrequiredThe ID of the `WorkflowRuleType` of this rule.
alwaysRunbooleanrequiredWhen set to `true` all `groups` & `conditions` are ignored and the rule will always have its a`actions` run.
default
falseenabledbooleanWhether the workflow rule is enabled and should run.
groupsarray[UpdateOrCreateWorkflowRuleGroup]requiredidintegerGenerated on your behalf when first creating a rule group. Should not be provided unless the rule group was previously saved & you are modifying a version of the rule group that was directly fetched from the system.
By providing a `null` value here you are indiciating a rule should be created.
By providing a non-null value here you are indicating this rule group exists within the `UpdateOrCreateWorkflowRule` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflowRule` already a `400` error wil be thrown
conditionsarray[UpdateOrCreateWorkflowCondition]requiredactionsarray[UpdateOrCreateWorkflowRuleAction]requiredidintegerGenerated on your behalf when first creating a action. Should not be provided unless the action was previously saved & you are modifying a version of the action that was directly fetched from the system.
By providing a `null` value here you are indicating this action should be created.
By providing a non-null value here you are indiciting this action exists within the `UpdateOrCreateWorkflowRule` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflowRule` already a `400` error wil be thrown
globalObjectFieldIdintegerrequiredThe ID of the `GlobalObjectField` this action will apply a transformation to.
workflowDataTypeActionIdintegerrequiredThe ID of the `WorkflowDataTypeAction` that this action applys as a transformation/modification to a field.
valuestringIf the action type uses data indicated by the user to apply its transformations those values will be supplier here.
value2stringvalue3stringvalue4stringmetaDatastringusesOtherFieldScopestringWhen using actions that depend on the values of other fields & objects this will control which objects are used to take values from.
allowed
allfilteredcorrelatedapplyToMatchedOnlybooleanWhen true, the action is applied only to elements that satisfy the rule conditions. When false or not provided, the action is applied to all elements.
childActionsarray[UpdateOrCreateWorkflowRuleAction]headerNamestringchildRulesarray[UpdateOrCreateWorkflowRule]idintegerGenerated on your behalf when first creating a rule. Should not be provided unless the rule was previously saved & you are modifying a version of the rule that was directly fetched from the system.
By providing a `null` value here you are indicating a rule should be created.
By providing a non-null value here you are indicating this rule exists within the `UpdateOrCreateWorkflow` already and should be updated. If the provided ID does not exist in the `UpdateOrCreateWorkflow` already a `400` error wil be thrown
namestringrequiredThe name of the rule, will be updated to whatever is provided.
workflowRuleTypeIdintegerrequiredThe ID of the `WorkflowRuleType` of this rule.
alwaysRunbooleanrequiredWhen set to `true` all `groups` & `conditions` are ignored and the rule will always have its a`actions` run.
default
falseenabledbooleanWhether the workflow rule is enabled and should run.
groupsarray[UpdateOrCreateWorkflowRuleGroup]requiredactionsarray[UpdateOrCreateWorkflowRuleAction]requiredchildRulesarray[UpdateOrCreateWorkflowRule]tierDatastringStores data needed to run new style tier rules set from enterprise accounts
tierDatastringStores data needed to run new style tier rules set from enterprise accounts
tierDatastringStores data needed to run new style tier rules set from enterprise accounts
Example request
post
/workflow/mapping-rulecurl -X POST "https://api.flxpoint.com/workflow/mapping-rule" \
-H "Accept: application/json" \
-H "X-API-TOKEN: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": 0,
"name": "string",
"description": "string",
"eventId": 0,
"useOriginalInputValue": true,
"globalObjectFieldId": 0,
"globalDataTypeId": 0,
"rule": {
"id": 0,
"name": "string",
"workflowRuleTypeId": 0,
"alwaysRun": true,
"enabled": true,
"groups": [
{
"id": 0,
"conditions": [
null
]
}
],
"actions": [
{
"id": 0,
"globalObjectFieldId": 0,
"workflowDataTypeActionId": 0,
"value": "string",
"value2": "string",
"value3": "string",
"value4": "string",
"metaData": "string",
"usesOtherFieldScope": "all",
"applyToMatchedOnly": true,
"childActions": [
null
],
"headerName": "string"
}
],
"childRules": [
{
"id": 0,
"name": "string",
"workflowRuleTypeId": 0,
"alwaysRun": true,
"enabled": true,
"groups": [
null
],
"actions": [
null
],
"childRules": [
null
],
"tierData": "string"
}
],
"tierData": "string"
}
}'Example body · application/json
{
"id": 0,
"name": "string",
"description": "string",
"eventId": 0,
"useOriginalInputValue": true,
"globalObjectFieldId": 0,
"globalDataTypeId": 0,
"rule": {
"id": 0,
"name": "string",
"workflowRuleTypeId": 0,
"alwaysRun": true,
"enabled": true,
"groups": [
{
"id": 0,
"conditions": [
null
]
}
],
"actions": [
{
"id": 0,
"globalObjectFieldId": 0,
"workflowDataTypeActionId": 0,
"value": "string",
"value2": "string",
"value3": "string",
"value4": "string",
"metaData": "string",
"usesOtherFieldScope": "all",
"applyToMatchedOnly": true,
"childActions": [
null
],
"headerName": "string"
}
],
"childRules": [
{
"id": 0,
"name": "string",
"workflowRuleTypeId": 0,
"alwaysRun": true,
"enabled": true,
"groups": [
null
],
"actions": [
null
],
"childRules": [
null
],
"tierData": "string"
}
],
"tierData": "string"
}
}Responses
200OKapplication/json
idintegerrequiredGenerated on your behalf when first creating a mapping rule.
namestringdescriptionstringcreatedAtstring (date-time)updatedAtstring (date-time)eventIdintegerrequiredThe ID of the event this mapping rule is run within. Important as this dictates what `GlobalObjects` & `GlobalObjectFields` are allowed to be saved to the rule.
useOriginalInputValuebooleanrequiredWhether the rules contain within this mapping rules should start their operations on the result of previous rules or on the basis of the original value provided by the mapping template
globalObjectFieldIdintegerThe ID of the `GlobalObjectField` that this rule assigns to.
globalDataTypeIdintegerrequiredThe ID of the `GlobalDataType` that this rule runs against.
workflowRuleTypeIdintegerThe ID of the `WorkflowRuleType` for this rule. This value will always match the same property on the workflow rule (`rule` property)
configuredbooleanWhether or not the workflow rule (`rule` property) is configured correctly and can be used in mapping templates.
globalDataTypeobjectidintegerrequirednamestringrequiredhandlestringrequiredallowed
stringnumberbooleannumeric_optionscustom_actionarrayinheriteddateattributesstring_optionscustom_fieldscategory_copycustom_aggregate_fieldsimagesvariant_optionstagsbuilder_actioncategory_in_listruleobjectrequiredidintegerGenerated on your behalf when first creating a rule.
namestringrequiredcreatedAtstring (date-time)rankintegerThe order/rank in which rules are run. Very important as order matters since each rule has the potential to modify data.
workflowRuleTypeIdintegerrequiredThe ID of the `WorkflowRuleType` of this rule.
alwaysRunbooleanrequiredWhen set to `true` all `groups` & `conditions` are ignored and the rule will always have its a`actions` run.
default
falseconfiguredbooleanWhether the rule is configured correctly. To be considered configured the rule must have at least 1 action and 1 condition (or be set to always run).
groupsarray[WorkflowRuleGroup]requiredidintegerGenerated on your behalf when first creating a rule group.
rankintegerThe order/rank in which groups are run
conditionsarray[WorkflowRuleGroupCondition]requiredidintegerGenerated on your behalf when first creating a condition.
rankintegerThe order/rank in which conditions are run
globalObjectFieldIdintegerThe ID of the `GlobalObjectField` that provides the data this rule runs against.
workflowDataTypeComparatorIdintegerThe ID of the `WorkflowDataTypeComparator` this rule uses as a basis to perform a condition with.
conditionstringFor most standard rules the primary data condition that is used in conjunction with the comparator will be stored here.
condition2stringcondition3stringcondition4stringfieldArrayMustMatchAllbooleanWhen the field this condition operates on for the particular event is provided as an array of data rather than a singleton setting this to `true` means that all fields in that list must be truthy in order for the condition to be truthy. Otherwise only 1 of the fields in the list must be truthy to have the condition pass.
default
falseconditionArrayMustMatchAllbooleanWhen the data this condition operates on for the particular event is provided as an array of data rather than a singleton setting this to `true` means that all data in that list must be truthy in order for the condition to be truthy. Otherwise only 1 of the datums in the list must be truthy to have the condition pass.
default
falsepreModifierDataTypeComparatorIdintegermetaDatastringThis is a JSON encoded string that is used to provide & store context relating to rules that do not fit within the bounds of standard rules.
childConditionsarray[WorkflowRuleGroupCondition]workflowDataTypeComparatorobjectidintegerrequiredglobalDataTypeIdintegerrequirednamestringrequiredhandlestringrequiredallowed
array_emptyarray_not_emptyarray_size_equalsarray_size_greater_thanarray_size_less_thanattributes_defaultboolean_equal_tocustom_aggregate_field_defaultcustom_fields_defaultdate_older_thandate_within_lastdate_greater_thandate_greater_than_equalsdate_older_than_equalsdecimal_place_valueequal_toequal_to_fieldgreater_thangreater_than_equal_togreater_than_equal_to_fieldgreater_than_fieldless_thanless_than_equal_toless_than_equal_to_fieldless_than_fieldnumber_does_not_existnumber_existsoption_equal_tooption_not_equal_topercent_greater_than_equal_to_fieldpercent_greater_than_fieldpercent_less_than_equal_to_fieldpercent_less_than_fieldstring_containsstring_contains_case_sensitivestring_does_not_existstring_ends_withstring_ends_with_case_sensitivestring_equals_fieldstring_equals_field_case_sensitivestring_equal_tostring_equal_to_case_sensitivestring_existsstring_lengthstring_not_containsstring_not_contains_case_sensitivestring_not_ends_withstring_not_ends_with_case_sensitivestring_not_equals_fieldstring_not_equals_field_case_sensitivestring_not_equal_tostring_not_equal_to_case_sensitivestring_not_starts_withstring_not_starts_with_case_sensitivestring_occurrence_of_characterstring_option_equal_tostring_option_not_equal_tostring_starts_withstring_starts_with_case_sensitivevariant_options_defaultstring_in_liststring_not_in_liststring_in_list_case_sensitivestring_not_in_list_case_sensitivetag_containstag_does_not_containscategory_in_listhideInputbooleanusesOtherFieldbooleanrequiredpreModifierbooleanpreModifierResultGlobalDataTypeIdintegerusesListbooleanpreModifierDataTypeComparatorobjectidintegerrequiredglobalDataTypeIdintegerrequirednamestringrequiredhandlestringrequiredallowed
array_emptyarray_not_emptyarray_size_equalsarray_size_greater_thanarray_size_less_thanattributes_defaultboolean_equal_tocustom_aggregate_field_defaultcustom_fields_defaultdate_older_thandate_within_lastdate_greater_thandate_greater_than_equalsdate_older_than_equalsdecimal_place_valueequal_toequal_to_fieldgreater_thangreater_than_equal_togreater_than_equal_to_fieldgreater_than_fieldless_thanless_than_equal_toless_than_equal_to_fieldless_than_fieldnumber_does_not_existnumber_existsoption_equal_tooption_not_equal_topercent_greater_than_equal_to_fieldpercent_greater_than_fieldpercent_less_than_equal_to_fieldpercent_less_than_fieldstring_containsstring_contains_case_sensitivestring_does_not_existstring_ends_withstring_ends_with_case_sensitivestring_equals_fieldstring_equals_field_case_sensitivestring_equal_tostring_equal_to_case_sensitivestring_existsstring_lengthstring_not_containsstring_not_contains_case_sensitivestring_not_ends_withstring_not_ends_with_case_sensitivestring_not_equals_fieldstring_not_equals_field_case_sensitivestring_not_equal_tostring_not_equal_to_case_sensitivestring_not_starts_withstring_not_starts_with_case_sensitivestring_occurrence_of_characterstring_option_equal_tostring_option_not_equal_tostring_starts_withstring_starts_with_case_sensitivevariant_options_defaultstring_in_liststring_not_in_liststring_in_list_case_sensitivestring_not_in_list_case_sensitivetag_containstag_does_not_containscategory_in_listhideInputbooleanusesOtherFieldbooleanrequiredpreModifierbooleanpreModifierResultGlobalDataTypeIdintegerusesListbooleanactionsarray[WorkflowRuleAction]requiredidintegerGenerated on your behalf when first creating a action.
globalObjectFieldIdintegerrequiredThe ID of the `GlobalObjectField` this action will apply a transformation to.
workflowDataTypeActionIdintegerrequiredThe ID of the `WorkflowDataTypeAction` that this action applys as a transformation/modification to a field.
valuestringIf the action type uses data indicated by the user to apply its transformations those values will be supplier here.
value2stringvalue3stringvalue4stringrankintegerThe order/rank in which actions are run. Very important as order matters since each action has the potential to modify data.
workflowDataTypeActionobjectidintegerrequirednamestringrequiredhandlestringrequiredallowed
addadd_fieldall_po_line_items_custom_fields_to_textappend_as_sentenceapply_custom_actionattribute_addattribute_modifyattribute_removeattributes_to_htmlcapitalize_each_wordcustom_aggregate_field_addcustom_aggregate_field_modifycustom_aggregate_field_removecustom_field_addcustom_field_modifycustom_field_removedecode_htmldivide_bydivide_by_fieldleft_padlowercasemultiplymultiply_by_fieldoption_setpercent_changepo_custom_fields_to_textpostfixpostfix_with_fieldprefixprefix_with_fieldreplacereplace_case_sensitivereplace_character_at_indexreplace_character_occurrenceright_padsentence_casesetset_decimalset_to_emptyset_to_fieldsplit_by_valuesubstringsubtractsubtract_fieldtrimuppercasevariant_option_addvariant_option_modifyvariant_option_removeset_ones_place_value_tomapping_sethideInputbooleanusesOtherFieldbooleanrequiredformulabooleanrequiredglobalDataTypeIdintegerformulaCanRunAgainstGlobalObjectIdsarray[integer]If `formula=true` then this will be a list of `GlobalObject.id` that the formula can be applied against.
integer
globalDataTypeFilterIdsarray[integer]Certain `GlobalObjectField`'s such as ones for quantities may wish to further restrict what types of actions they are allowed to run against. Actions that support this type of additional filtering will have the IDs of the filter types set here. The IDs in this array will correspond to the `GlobalObjectField.globalDataTypeFilterId` field.
integer
metaDatastringIf non-null a JSON object containing meta data related to executing the action
usesOtherFieldScopestringWhen using actions that depend on the values of other fields & objects this will control which objects are used to take values from.
allowed
allfilteredcorrelatedapplyToMatchedOnlybooleanWhen true, the action is applied only to elements that satisfy the rule conditions. When false or not provided, the action is applied to all elements.
childActionsarray[WorkflowRuleAction]idintegerGenerated on your behalf when first creating a action.
globalObjectFieldIdintegerrequiredThe ID of the `GlobalObjectField` this action will apply a transformation to.
workflowDataTypeActionIdintegerrequiredThe ID of the `WorkflowDataTypeAction` that this action applys as a transformation/modification to a field.
valuestringIf the action type uses data indicated by the user to apply its transformations those values will be supplier here.
value2stringvalue3stringvalue4stringrankintegerThe order/rank in which actions are run. Very important as order matters since each action has the potential to modify data.
workflowDataTypeActionobjectidintegerrequirednamestringrequiredhandlestringrequiredallowed
addadd_fieldall_po_line_items_custom_fields_to_textappend_as_sentenceapply_custom_actionattribute_addattribute_modifyattribute_removeattributes_to_htmlcapitalize_each_wordcustom_aggregate_field_addcustom_aggregate_field_modifycustom_aggregate_field_removecustom_field_addcustom_field_modifycustom_field_removedecode_htmldivide_bydivide_by_fieldleft_padlowercasemultiplymultiply_by_fieldoption_setpercent_changepo_custom_fields_to_textpostfixpostfix_with_fieldprefixprefix_with_fieldreplacereplace_case_sensitivereplace_character_at_indexreplace_character_occurrenceright_padsentence_casesetset_decimalset_to_emptyset_to_fieldsplit_by_valuesubstringsubtractsubtract_fieldtrimuppercasevariant_option_addvariant_option_modifyvariant_option_removeset_ones_place_value_tomapping_sethideInputbooleanusesOtherFieldbooleanrequiredformulabooleanrequiredglobalDataTypeIdintegerformulaCanRunAgainstGlobalObjectIdsarray[integer]If `formula=true` then this will be a list of `GlobalObject.id` that the formula can be applied against.
globalDataTypeFilterIdsarray[integer]Certain `GlobalObjectField`'s such as ones for quantities may wish to further restrict what types of actions they are allowed to run against. Actions that support this type of additional filtering will have the IDs of the filter types set here. The IDs in this array will correspond to the `GlobalObjectField.globalDataTypeFilterId` field.
metaDatastringIf non-null a JSON object containing meta data related to executing the action
usesOtherFieldScopestringWhen using actions that depend on the values of other fields & objects this will control which objects are used to take values from.
allowed
allfilteredcorrelatedapplyToMatchedOnlybooleanWhen true, the action is applied only to elements that satisfy the rule conditions. When false or not provided, the action is applied to all elements.
childActionsarray[WorkflowRuleAction]headerNamestringheaderNamestringchildRulesarray[WorkflowRule]idintegerGenerated on your behalf when first creating a rule.
namestringrequiredcreatedAtstring (date-time)rankintegerThe order/rank in which rules are run. Very important as order matters since each rule has the potential to modify data.
workflowRuleTypeIdintegerrequiredThe ID of the `WorkflowRuleType` of this rule.
alwaysRunbooleanrequiredWhen set to `true` all `groups` & `conditions` are ignored and the rule will always have its a`actions` run.
default
falseconfiguredbooleanWhether the rule is configured correctly. To be considered configured the rule must have at least 1 action and 1 condition (or be set to always run).
groupsarray[WorkflowRuleGroup]requiredidintegerGenerated on your behalf when first creating a rule group.
rankintegerThe order/rank in which groups are run
conditionsarray[WorkflowRuleGroupCondition]requiredactionsarray[WorkflowRuleAction]requiredidintegerGenerated on your behalf when first creating a action.
globalObjectFieldIdintegerrequiredThe ID of the `GlobalObjectField` this action will apply a transformation to.
workflowDataTypeActionIdintegerrequiredThe ID of the `WorkflowDataTypeAction` that this action applys as a transformation/modification to a field.
valuestringIf the action type uses data indicated by the user to apply its transformations those values will be supplier here.
value2stringvalue3stringvalue4stringrankintegerThe order/rank in which actions are run. Very important as order matters since each action has the potential to modify data.
workflowDataTypeActionobjectidintegerrequirednamestringrequiredhandlestringrequiredallowed
addadd_fieldall_po_line_items_custom_fields_to_textappend_as_sentenceapply_custom_actionattribute_addattribute_modifyattribute_removeattributes_to_htmlcapitalize_each_wordcustom_aggregate_field_addcustom_aggregate_field_modifycustom_aggregate_field_removecustom_field_addcustom_field_modifycustom_field_removedecode_htmldivide_bydivide_by_fieldleft_padlowercasemultiplymultiply_by_fieldoption_setpercent_changepo_custom_fields_to_textpostfixpostfix_with_fieldprefixprefix_with_fieldreplacereplace_case_sensitivereplace_character_at_indexreplace_character_occurrenceright_padsentence_casesetset_decimalset_to_emptyset_to_fieldsplit_by_valuesubstringsubtractsubtract_fieldtrimuppercasevariant_option_addvariant_option_modifyvariant_option_removeset_ones_place_value_tomapping_sethideInputbooleanusesOtherFieldbooleanrequiredformulabooleanrequiredglobalDataTypeIdintegerformulaCanRunAgainstGlobalObjectIdsarray[integer]If `formula=true` then this will be a list of `GlobalObject.id` that the formula can be applied against.
globalDataTypeFilterIdsarray[integer]Certain `GlobalObjectField`'s such as ones for quantities may wish to further restrict what types of actions they are allowed to run against. Actions that support this type of additional filtering will have the IDs of the filter types set here. The IDs in this array will correspond to the `GlobalObjectField.globalDataTypeFilterId` field.
metaDatastringIf non-null a JSON object containing meta data related to executing the action
usesOtherFieldScopestringWhen using actions that depend on the values of other fields & objects this will control which objects are used to take values from.
allowed
allfilteredcorrelatedapplyToMatchedOnlybooleanWhen true, the action is applied only to elements that satisfy the rule conditions. When false or not provided, the action is applied to all elements.
childActionsarray[WorkflowRuleAction]headerNamestringchildRulesarray[WorkflowRule]idintegerGenerated on your behalf when first creating a rule.
namestringrequiredcreatedAtstring (date-time)rankintegerThe order/rank in which rules are run. Very important as order matters since each rule has the potential to modify data.
workflowRuleTypeIdintegerrequiredThe ID of the `WorkflowRuleType` of this rule.
alwaysRunbooleanrequiredWhen set to `true` all `groups` & `conditions` are ignored and the rule will always have its a`actions` run.
default
falseconfiguredbooleanWhether the rule is configured correctly. To be considered configured the rule must have at least 1 action and 1 condition (or be set to always run).
groupsarray[WorkflowRuleGroup]requiredactionsarray[WorkflowRuleAction]requiredchildRulesarray[WorkflowRule]workflowRuleTypeobjectidintegerrequiredhandlestringrequiredallowed
conditionaltiernamestringrequiredenabledbooleanidentifies whether the workflow rule is enabled
tierDatastringStores data needed to run new style tier rules set from enterprise accounts
workflowRuleTypeobjectidintegerrequiredhandlestringrequiredallowed
conditionaltiernamestringrequiredenabledbooleanidentifies whether the workflow rule is enabled
tierDatastringStores data needed to run new style tier rules set from enterprise accounts
workflowRuleTypeobjectidintegerrequiredhandlestringrequiredallowed
conditionaltiernamestringrequiredenabledbooleanidentifies whether the workflow rule is enabled
tierDatastringStores data needed to run new style tier rules set from enterprise accounts
fieldsUsedBySetToFieldarray[any]requiredfieldsUsedByFormulasarray[any]requiredExample response
{
"id": 0,
"name": "string",
"description": "string",
"createdAt": "2026-04-20T00:00:00Z",
"updatedAt": "2026-04-20T00:00:00Z",
"eventId": 0,
"useOriginalInputValue": true,
"globalObjectFieldId": 0,
"globalDataTypeId": 0,
"workflowRuleTypeId": 0,
"configured": true,
"globalDataType": {
"id": 0,
"name": "string",
"handle": "string"
},
"rule": {
"id": 0,
"name": "string",
"createdAt": "2026-04-20T00:00:00Z",
"rank": 0,
"workflowRuleTypeId": 0,
"alwaysRun": true,
"configured": true,
"groups": [
{
"id": 0,
"rank": 0,
"conditions": [
null
]
}
],
"actions": [
{
"id": 0,
"globalObjectFieldId": 0,
"workflowDataTypeActionId": 0,
"value": "string",
"value2": "string",
"value3": "string",
"value4": "string",
"rank": 0,
"workflowDataTypeAction": {
"id": null,
"name": null,
"handle": null,
"hideInput": null,
"usesOtherField": null,
"formula": null,
"globalDataTypeId": null,
"formulaCanRunAgainstGlobalObjectIds": null,
"globalDataTypeFilterIds": null
},
"metaData": "string",
"usesOtherFieldScope": "all",
"applyToMatchedOnly": true,
"childActions": [
null
],
"headerName": "string"
}
],
"childRules": [
{
"id": 0,
"name": "string",
"createdAt": "2026-04-20T00:00:00Z",
"rank": 0,
"workflowRuleTypeId": 0,
"alwaysRun": true,
"configured": true,
"groups": [
null
],
"actions": [
null
],
"childRules": [
null
],
"workflowRuleType": {
"id": null,
"handle": null,
"name": null
},
"enabled": true,
"tierData": "string"
}
],
"workflowRuleType": {
"id": 0,
"handle": "conditional",
"name": "string"
},
"enabled": true,
"tierData": "string"
},
"fieldsUsedBySetToField": [
null
],
"fieldsUsedByFormulas": [
null
]
}400Bad Request
No schema documented for this status.
401Unauthorized
No schema documented for this status.
OpenAPI fragment
{
"post": {
"summary": "Create/Update Mapping Rule",
"description": "Create or update a mapping rule",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateOrCreateMappingRule"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MappingRule"
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
}
}
}Ready to run it? Send the curl from your terminal or Postman, or use the interactive tester in Stoplight.Open in Stoplight