Create component.
ROLES: COMPONENT_WRITE,COMPONENT_ADMIN USER: true SERVICE ACCOUNT: true
curl --request POST \
--url https://api.revoengine.com/api/v1/component \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"active": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', type: '<string>', active: true})
};
fetch('https://api.revoengine.com/api/v1/component', 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"
payload = {
"name": "<string>",
"type": "<string>",
"active": True
}
headers = {
"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-*).
Body
Display name. For CODE_JS_LIB and CODE_TS_LIB, it must be a JavaScript identifier (letters/underscore first, then letters/digits/underscore). At most one active, non-deleted library of either type may have this name; inspect existing active libraries before creating an active one. Inactive libraries may share a name.
1 - 60Type of component must be one of: CODE_JS,CODE_TS,CODE_JS_LIB,CODE_TS_LIB,JSON_VALIDATOR,CUSTOM_NODEJS.
Activate upon creation. If type is CODE_JS_LIB or CODE_TS_LIB and active is true, no other active, non-deleted library of either library type may have the same name.
Optional category appropriate for the selected component type. Pass null to leave it empty.
32Optional component description. Pass null to leave it empty.
Optional resource metadata. Values may use any JSON type. Maximum 16 KiB and 64 top-level keys. Top-level keys starting with "__" are reserved for backend use.
For CUSTOM_NODEJS, wait for deployment. Omit or pass null to use the default behavior.
Initial component elements. Server ignores/regenerates componentElementId values on create. Omit or pass null to create the default starter content. CODE_JS_LIB and CODE_TS_LIB always include a permanent @default element, even with explicit elements; an automatically added @default contains documentation only and exposes no members.
Show child attributes
Show child attributes
Response
Created.
curl --request POST \
--url https://api.revoengine.com/api/v1/component \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"active": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', type: '<string>', active: true})
};
fetch('https://api.revoengine.com/api/v1/component', 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"
payload = {
"name": "<string>",
"type": "<string>",
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
