Replace one component element.
Replaces exactly one existing element in the selected component. Matching uses componentElementId first and falls back to key only for legacy payloads without ids. Use this endpoint for focused single-element updates instead of the full replace save endpoint.
ROLES: COMPONENT_WRITE,COMPONENT_ADMIN USER: true SERVICE ACCOUNT: true
curl --request POST \
--url https://api.revoengine.com/api/v1/component/{componentId}/patch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-revo-mutation-review: <x-revo-mutation-review>' \
--data '
{
"key": "<string>",
"details": "<string>",
"order": 123
}
'const options = {
method: 'POST',
headers: {
'x-revo-mutation-review': '<x-revo-mutation-review>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({key: '<string>', details: '<string>', order: 123})
};
fetch('https://api.revoengine.com/api/v1/component/{componentId}/patch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/component/{componentId}/patch"
payload = {
"key": "<string>",
"details": "<string>",
"order": 123
}
headers = {
"x-revo-mutation-review": "<x-revo-mutation-review>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
Bearer JWT token or API Key (sk-*).
Headers
Path Parameters
Component id containing the element to replace.
Body
Unique element key. CODE_JS, CODE_TS, CODE_JS_LIB, and CODE_TS_LIB keys must be valid JavaScript identifiers and cannot be JavaScript/TypeScript reserved words. The permanent @default element cannot be renamed, deleted or replaced; its source remains editable. Only CODE_JS_LIB and CODE_TS_LIB additionally accept the reserved technical key @default: its named exports are available as lib.LibraryName.member. An ordinary DEFAULT key remains a regular node.
1 - 32Element source/body. Required whenever an explicit element is supplied.
Order of the element (must be unique).
Existing durable element identifier. Omit it on component create because the server assigns/regenerates the id; preserve it for updates, imports, reverts, and key renames.
Optional representation description, for example Swagger details. Pass null to leave it empty.
1000Optional element metadata. Top-level keys starting with "__" are reserved for backend use.
Hide supporting or large-output elements from normal result projection. Omit or pass null to default to false.
Response
OK.
curl --request POST \
--url https://api.revoengine.com/api/v1/component/{componentId}/patch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-revo-mutation-review: <x-revo-mutation-review>' \
--data '
{
"key": "<string>",
"details": "<string>",
"order": 123
}
'const options = {
method: 'POST',
headers: {
'x-revo-mutation-review': '<x-revo-mutation-review>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({key: '<string>', details: '<string>', order: 123})
};
fetch('https://api.revoengine.com/api/v1/component/{componentId}/patch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/component/{componentId}/patch"
payload = {
"key": "<string>",
"details": "<string>",
"order": 123
}
headers = {
"x-revo-mutation-review": "<x-revo-mutation-review>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
