Replace all component elements.
Replaces the complete element set for the selected component. This is not an upsert/patch endpoint: any element omitted from the request is removed from the component. Prefer POST /component//patch for single-element updates.
ROLES: COMPONENT_WRITE,COMPONENT_ADMIN USER: true SERVICE ACCOUNT: true
curl --request POST \
--url https://api.revoengine.com/api/v1/component/{componentId}/save \
--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,
"componentElementId": "<string>",
"desc": "<string>",
"metadata": {},
"hidden": true
}
]
'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,
componentElementId: '<string>',
desc: '<string>',
metadata: {},
hidden: true
}
])
};
fetch('https://api.revoengine.com/api/v1/component/{componentId}/save', 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}/save"
payload = [
{
"key": "<string>",
"details": "<string>",
"order": 123,
"componentElementId": "<string>",
"desc": "<string>",
"metadata": {},
"hidden": True
}
]
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 whose full element set should be replaced.
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}/save \
--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,
"componentElementId": "<string>",
"desc": "<string>",
"metadata": {},
"hidden": true
}
]
'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,
componentElementId: '<string>',
desc: '<string>',
metadata: {},
hidden: true
}
])
};
fetch('https://api.revoengine.com/api/v1/component/{componentId}/save', 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}/save"
payload = [
{
"key": "<string>",
"details": "<string>",
"order": 123,
"componentElementId": "<string>",
"desc": "<string>",
"metadata": {},
"hidden": True
}
]
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)
