Update an audience
const url = 'https://api.ebitex.io/content/management/v1/audiences/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","predicate":{}}'};
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/audiences/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "predicate": {} }'Changes an audience’s name, predicate, or both; an omitted property stays as it is. predicate takes the same shape as on create and replaces the old condition whole.
Audiences are read live at delivery, so a new condition changes what visitors see straight away, without republishing anything.
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”Responses
Section titled “ Responses ”The updated audience, shaped as in the list.
validation_failed: errors names each problem, such as a blank name or a predicate that is not a valid condition.
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.audiences.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 audience has this id in the key’s environment.
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.