Revising a Rule is the action of creating a new revision of the rule with the
current (head
) revision. A revision of a Rule will have its own Id. The
original Rule may be discovered via the origin
link.
Revising a Rule will also revise each of its related RuleComponents. Each revision of a RuleComponent will also have its own unique Id and will link to the revision of the Rule.
Revising a Rule is achieved by supplying an action
with a value of revise
in the meta
of the request data
.
enabled
name
PATCH /rules/:id
curl https://reactor.adobe.io/rules/:id \
-H "Accept: application/vnd.api+json;revision=1" \
-H "Content-Type: application/vnd.api+json" \
-H "Authorization: Bearer [TOKEN]" \
-H "X-Api-Key: [KEY]" \
-H "X-Gw-Ims-Org-Id: [ORG_ID]" \
-X PATCH \
-d \
'
{
"data": {
"attributes": {
},
"meta": {
"action": "revise"
},
"id": "RL7db7ad3cd948406187afe31b5c84854e",
"type": "rules"
}
}'
{
"data": {
"id": "RLca6e5b6fac2b4c69bbcb80133435c1d4",
"type": "rules",
"attributes": {
"created_at": "2023-04-21T23:06:46.893Z",
"deleted_at": null,
"dirty": false,
"enabled": true,
"name": "Example Rule",
"published": false,
"published_at": null,
"revision_number": 1,
"updated_at": "2023-04-21T23:06:46.893Z",
"created_by_email": "ciltaru@adobe.com",
"created_by_display_name": "George Ciltaru",
"updated_by_email": "ciltaru@adobe.com",
"updated_by_display_name": "George Ciltaru",
"review_status": "unsubmitted"
},
"relationships": {
"libraries": {
"links": {
"related": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4/libraries"
}
},
"revisions": {
"links": {
"related": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4/revisions"
}
},
"notes": {
"links": {
"related": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4/notes"
}
},
"property": {
"links": {
"related": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4/property"
},
"data": {
"id": "PRe692b4bb0fd74a208e9a68fcf2b78fc5",
"type": "properties"
}
},
"origin": {
"links": {
"related": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4/origin"
},
"data": {
"id": "RL7db7ad3cd948406187afe31b5c84854e",
"type": "rules"
}
},
"rule_components": {
"links": {
"related": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4/rule_components"
}
}
},
"links": {
"property": "https://reactor.adobe.io/properties/PRe692b4bb0fd74a208e9a68fcf2b78fc5",
"origin": "https://reactor.adobe.io/rules/RL7db7ad3cd948406187afe31b5c84854e",
"self": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4",
"rule_components": "https://reactor.adobe.io/rules/RLca6e5b6fac2b4c69bbcb80133435c1d4/rule_components"
},
"meta": {
"latest_revision_number": 1
}
}
}