Create or update an object

Creates or updates a CMS object.

For creating an object, provide a randomly generated hexadecimal ID (16 characters long) for the :obj_id parameter, for example using the shell command openssl rand -hex 8. If the object does not exist, it will be created if at least _obj_class has been specified.

If the object does not exist in the working copy but still exists in published, its content is restored. Any object attribute which is not explicitly overwritten will be restored to its previous value.

Params

  • tenant_id – The ID of the tenant.
  • working_copy_id – The ID of the working copy
  • obj_id – The ID of the object to be updated or created.

Params as part of the payload

  • obj – object attributes.
    • The following internal attributes can be specified (internal attributes other than these will be silently ignored).
      • _conflicts
      • _id
      • _path
      • _permalink
      • _site_id
      • _restriction
      • _widget_pool
    • For custom attributes, specify a pair made up of a type and a value. Valid types are:
      • binary
      • boolean
      • date
      • html
      • link
      • linklist
      • number
      • reference
      • referencelist
      • string
      • stringlist
      • widget
      • widgetlist

Example of the obj parameter:

Response

The created or updated object.

Error codes

  • precondition_not_met.obj_not_found
  • precondition_not_met.workspace_not_found
  • validation.illegal_value
  • validation.invalid_value

Example