Skip to content

Update a template

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

Updates a template’s name, externalId and supportedContractIds. supportedContractIds is the complete new list. Send the rowVersion from your last read so an edit somebody else made in between is refused rather than overwritten.

Settings fields are not edited here; update the settings contract with updateContract. To point the template at a different existing contract, send settingsContractId; leaving it out keeps the current one. Repointing is always a breaking change and cuts a new version. Otherwise the change is classified from the supported-contract list: a breaking change cuts a new version, and presentations already pinned to the old one keep it.

Add ?dryRun=true to run the same validation and change classification without saving anything. The response is { classification, currentLatestVersionNumber, resultingVersionNumber, breakingReasons }, where classification is new, additive, breaking or noChange, and each breaking reason is { fieldExternalId, reason }.

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

id
required
string format: uuid
dryRun
boolean
Media typeapplication/json
object
name
required
string
externalId
required
string
supportedContractIds
required
Array<string>
settingsContractId
null | string format: uuid
rowVersion
null | integer | string format: uint32
/^-?(?:0|[1-9]\d*)$/
Examplegenerated
{
"name": "example",
"externalId": "example",
"supportedContractIds": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"settingsContractId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"rowVersion": 1
}

The updated template, shaped like getTemplate. With dryRun=true, the change classification instead.

validation_failed: the body is invalid. errors maps each failing member (such as externalId or fields[2].settings) to a message.

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.

permission_denied: the key’s role lacks content.templates.manage.

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 template with this id exists in the key’s environment.

concurrency_conflict: the template changed since rowVersion; the body carries currentRowVersion and currentUpdatedAtUtc, so re-read and reapply your change. duplicate_external_id: another template already has this external id. inherited_read_only: the template is inherited from another environment (sourceEnvironmentId); edit it there.

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