Objects

Create an Object

Create a single Object. title and type are required; the slug is derived from the title when omitted. Values in metadata must satisfy any validation configured on the Object type's Metafields. To create several Objects at once, use the batch endpoint instead of looping over this one.

post/buckets/{slug}/objects

Request body

titlestring required
typestring required

Object type slug. The type must already exist.

slugstring

Derived from title when omitted.

status'published' | 'draft'
contentstring
metadataMetadata

Values of the Metafields defined on the Object type, keyed by Metafield key.

The value shape follows the Metafield type, and differs between write and read for two of them:

  • Text, textarea, markdown, and HTML Metafields are strings. Number Metafields are numbers, switches are booleans, dates are ISO 8601 strings.
  • Object Relationship Metafields are written as an Object id string (or an array of ids for the multiple variant) and returned as a nested Object (or array of Objects) once depth is at least 1.
  • File and Image Metafields are written as a media name string (or an array of names) and returned as an object with url and imgix_url, plus alt_text, width, and height when requested via props.
  • Repeater Metafields are arrays of objects keyed by the child Metafield keys.
thumbnailstring

Media name. The media must already exist in the Bucket.

localestring
trigger_webhookboolean

Fire the corresponding Object webhook.

Response

The created Object.

Changes