Classify a contract
const url = 'https://api.ebitex.io/content/management/v1/contracts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/categories';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"categoryIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
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/contracts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/categories \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "categoryIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'Replaces the contract’s classification with categoryIds. The list is the whole set, so an empty list removes every category. Every id must name a selectable category in the key’s environment. The change takes effect immediately; contracts are not published.
The key’s role needs content.contracts.manage, the same permission that edits the contract itself.
Key: a management key with content.management.authoring.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "categoryIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}Responses
Section titled “ Responses ”{ "categoryIds": ["…"] }, the stored set with duplicates removed.
validation_failed: one or more ids do not exist or are not selectable (errors.categoryIds).
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.contracts.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 contract has this id in the key’s environment.
contract_read_only: the contract comes from a content provider and cannot be changed here. inherited_read_only: the item is inherited from another environment and can only be changed there; sourceEnvironmentId names it.
Rate limit or quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.