---
title: "Set an object"
method: PUT
path: "/v1/objects/{collection}/{id}"
tags: ["Objects"]
---

# Set an object

`PUT /v1/objects/{collection}/{id}`

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.

## Path parameters

- `collection` string, required
- `id` string, required

## Request body

- SetObjectRequest — A set of parameters to set an object with. Does not include the object id or collection.
  - `channel_data` InlineChannelDataRequest — A request to set channel data for a type of channel inline.
  - `locale` string, nullable — The locale of the object. Used for [message localization](/concepts/translations).
  - `name` string, nullable — An optional name for the object.
  - `preferences` InlinePreferenceSetRequest — Inline set preferences for a recipient, where the key is the preference set id. Preferences that are set inline will be merged into any existing preferences rather than replacing them.
  - `timezone` string, nullable — The timezone of the object. Must be a valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Used for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).

## Response `200`

OK

- Object — A custom [Object](/concepts/objects) entity which belongs to a collection.
  - `__typename` string, required — The typename of the schema.
  - `collection` string, required — The collection this object belongs to.
  - `created_at` string, date-time, nullable — Timestamp when the resource was created.
  - `id` string, required — Unique identifier for the object.
  - `properties` object — The custom properties associated with the object.
  - `updated_at` string, date-time, required — The timestamp when the resource was last updated.

---

[API](https://skmtc.net/knocklabs/apis/knock-api.md) · [All operations](https://skmtc.net/knocklabs/apis/knock-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/knocklabs/knock-api/revisions/4b8499dddbc5/schema)
