update_content

Patch a content record's properties (read-modify-write) through the content route.

update_content

Patch a content record's properties (read-modify-write) through the content route.

Patch a content record through the content route. This is a read-modify-write: the SDK
fetches the live record, deep-merges the properties you pass onto it, then PUTs the whole
body - so you only supply the fields you want to change.

content_definition_id is the entity id from the entity map (reference/schema.md);
properties keys are that entity's writable field names. Reference/lookup fields take a
{id, description} shape (see recipes/content-update.md).

List gotcha: lists are merged element-wise and truncated to the length of the list
you pass. To append to a multi-valued field, include the existing elements plus the new
ones - passing a shorter list deletes the tail.

Return is None - even on success. The underlying PUT succeeds and the write persists
(immediately searchable), but the SDK drops the response. Don't
branch on the return - keep the contentId from create_content and verify with
get_content. Required references (e.g. an event's eventType) must be present or the server
409s and the SDK swallows it to a silent no-write.

Safety class: C · API type: admin · Min version: -

📘

Confinement

Class C: the generic content route can write to shared/global content (e.g. language, genre, rating) - non-prod only. When content_definition_id is the asset entity, content_id must be within your run-root anchor (then it is effectively Class A, like update_asset).

Signatures

def update_content(sdk, content_id, content_definition_id, properties, language_id=None):
    """Patch content_id's properties (deep-merge onto the live record); returns None (drift #20)."""
    return sdk.update_content(content_id, content_definition_id, properties, language_id)
export async function updateContent(sdk, contentId, contentDefinitionId, properties,
        languageId = null) {
    // Patch contentId's properties (deep-merge onto the live record); returns null (drift #20).
    return await sdk.updateContent(contentId, contentDefinitionId, properties, languageId);
}

Parameters

Parameter (Python)Parameter (JS)TypeRequiredNotes
sdksdkNomad_SDKyes
content_idcontentIdstryese.g. <content-uuid>
content_definition_idcontentDefinitionIdstryesthe entity id from reference/schema.md (Entities table)
propertiespropertiesdictyeskeys are the entity's writable field names (reference/schema.md). Reference fields take a {id, description} shape.
language_idlanguageIdstr | NonenoNone for the default language variant

Returns

None - returns None EVEN ON SUCCESS. The write persists and is immediately searchable; hold the contentId from create_content and verify by re-reading (get_content). Only the keys you supply are changed.

Errors

  • 401 unauthenticated
  • 404 content record not found

See also: Python ↔ JS naming map · Return shapes.


Did this page help you?