Update a template
const url = 'https://api.ebitex.io/content/management/v1/templates/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","externalId":"example","supportedContractIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"settingsContractId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","rowVersion":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "name": "example", "externalId": "example", "supportedContractIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "settingsContractId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rowVersion": 1}Responses
Section titled “ Responses ”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.