Create a component
const url = 'https://api.ebitex.io/content/management/v1/components';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","externalId":"example","contractId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","folderId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","document":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ebitex.io/content/management/v1/components \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "externalId": "example", "contractId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "folderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "document": {} }'Creates a component of a contract from { name, externalId, contractId, folderId, document }, and answers 201 Created with the full component. Omit folderId to file it at the root. The component is pinned to the contract’s latest version, and document must validate against it: an invalid document is refused with each failing field’s path in errors.
The contract cannot be abstract, and it must satisfy the target folder’s allowed contracts (the nearest folder up the tree that declares any). externalId must be unique in the environment.
Creating into a folder needs edit on that folder under the branch access rules, which apply to the key as they do to its role. The organization’s plan caps how many components it may hold across all its environments.
Key: a management key with content.management.authoring.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Examplegenerated
{ "name": "example", "externalId": "example", "contractId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "folderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "document": {}}Responses
Section titled “ Responses ”OK
validation_failed: errors names each problem, by field path for the document, or under contractId when the contract does not exist or has no version. abstract_contract: an abstract contract cannot be instantiated; use one that inherits from it. folder_contract_constraint_violation: the folder does not allow components of this contract.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
payment_required: the organization’s subscription needs attention.
access_denied: the key’s role may view the folder but not edit it. quota_exceeded: the organization has reached its plan’s component limit.
scope_denied: the key lacks this route’s scope. tier_required: the Content Management API needs the Pro plan or above. ip_denied: the caller’s address is outside the key’s allowed ranges. app_not_available: Content is not enabled for the organization.
folderId names no folder in this environment, or one the key’s role cannot view.
duplicate_external_id: a component with this external id already exists in the environment.
Rate limit or quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.