Skip to content

Update a component

PUT
/content/management/v1/components/{id}
curl --request PUT \
--url https://api.ebitex.io/content/management/v1/components/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "document": {}, "folderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "repinToLatest": false, "rowVersion": 1, "madeFor": [ "example" ] }'

Replaces a component’s name, folderId and document. This is a full replace: omitting folderId moves the component to the root. The document is validated against the component’s pinned contract version; send repinToLatest: true to validate against the contract’s latest version instead and, on success, move the pin there. The external id and the contract cannot be changed.

madeFor is an optional advisory note of the channels it is made for, a list drawn from email and web. It never blocks a save or a publish, and an empty or missing note means unknown; unlike the members above it is not a full replace: omit it to leave the note alone, send [] to clear it, and an unknown channel is refused with 400 validation_failed.

When a document fails against a pinned version that is not the contract’s latest, the 400 also carries pinnedContractVersion, latestContractVersion, validatesAgainstLatest (whether the same document passes the latest version) and a message saying what to send. A document that looks right against the contract you just read, but fails, is usually this case.

Send the rowVersion from your last read to make the update conditional: if the component changed in the meantime the write is refused with 409 concurrency_conflict and the current currentRowVersion. Without it, the last write wins.

The key needs edit on the component’s folder, and on the target folder too when moving it, which must also allow the component’s contract. When a workflow governs the component, it can only be edited in an editable workflow state. A component owned by a realm above the key’s own can be edited from the app (the change is written in the realm that owns it), but a key never writes through to another realm.

Key: a management key with content.management.authoring.

id
required
string format: uuid
Media typeapplication/json
object
name
required
string
document
required
object
folderId
required
null | string format: uuid
repinToLatest
boolean
rowVersion
null | integer | string format: uint32
/^-?(?:0|[1-9]\d*)$/
madeFor
Array<string> | null

OK

validation_failed: the document does not validate; errors names each failing field’s path, and a failure against a pin behind the contract’s latest also carries pinnedContractVersion, latestContractVersion, validatesAgainstLatest and message. folder_contract_constraint_violation: the target 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 not edit the component’s folder or the target folder. inherited_owner_not_permitted: the item is owned by a realm above the key’s own (ownerRealmId). A person can edit it from the app and the change is written in the realm that owns it, but a key acts in one realm and never writes through to another: change it with a key bound to the owning realm.

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.

No component has this id in the key’s environment, it is in a branch the key’s role cannot view, or folderId names no folder.

concurrency_conflict: the component changed since rowVersion was read; re-read it and retry. inherited_read_only: the move is not allowed because the component is owned by a realm above the key’s own (ownerRealmId); an inherited component stays in the folder its source put it in.

workflow_state_not_editable: the component’s workflow state (state, in definition) does not allow edits; move it to an editable state first.

Rate limit or quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.