Objects

Set an object

Creates a new object or updates an existing one in the specified collection. This operation is used to identify objects with their properties, as well as optional preferences and channel data.

put/v1/objects/{collection}/{id}

Path parameters

collectionstring required

The collection this object belongs to.

idstring required

Unique identifier for the object.

Request body

channel_dataInlineChannelDataRequest

A request to set channel data for a type of channel inline.

localestring nullable

The locale of the object. Used for message localization.

preferencesInlinePreferenceSetRequest

Inline set preferences for a recipient, where the key is the preference set id.

timezonestring nullable

The timezone of the object. Must be a valid tz database time zone string. Used for recurring schedules.

Example request

{
  "channel_data": {
    "97c5837d-c65c-4d54-aa39-080eeb81c69d": {
      "tokens": [
        "push_token_123"
      ]
    }
  },
  "description": "My product description",
  "locale": "en-US",
  "name": "My product",
  "preferences": {
    "default": {
      "channel_types": {
        "email": true
      },
      "workflows": {
        "dinosaurs-loose": {
          "channel_types": {
            "email": true
          }
        }
      }
    }
  },
  "price": 100,
  "timezone": "America/New_York"
}

Response

OK

__typenamestring required

The typename of the schema.

collectionstring required

The collection this object belongs to.

created_atstring date-time nullable

Timestamp when the resource was created.

idstring required

Unique identifier for the object.

propertiesobject

The custom properties associated with the object.

updated_atstring date-time required

The timestamp when the resource was last updated.

Example response

{
  "__typename": "Object",
  "collection": "assets",
  "created_at": null,
  "id": "specimen_25",
  "properties": {
    "classification": "Theropod",
    "config": {
      "biz": "baz",
      "foo": "bar"
    },
    "name": "Velociraptor",
    "status": "contained"
  },
  "updated_at": "2024-05-22T12:00:00Z"
}

Changes