---
title: "Set a tenant"
method: PUT
path: "/v1/tenants/{id}"
tags: ["Tenants"]
---

# Set a tenant

`PUT /v1/tenants/{id}`

Sets a tenant within an environment, performing an upsert operation. Any existing properties will be merged with the incoming properties.

## Path parameters

- `id` string, required

## Request body

- SetTenantRequest — A tenant to be set in the system. You can supply any additional properties on the tenant object.
  - `channel_data` union — The channel data for the tenant.
    - unknown
    - object — A request to set channel data for a type of channel inline.
  - `settings` object — The settings for the tenant. Includes branding and preference set.
    - `branding` object — The branding for the tenant.
      - `icon_url` string, nullable — The icon URL for the tenant. Must point to a valid image with an image MIME type.
      - `logo_url` string, nullable — The logo URL for the tenant. Must point to a valid image with an image MIME type.
      - `primary_color` string, nullable — The primary color for the tenant, provided as a hex value.
      - `primary_color_contrast` string, nullable — The primary color contrast for the tenant, provided as a hex value.
    - `preference_set` union — The preference set for the tenant. Used to override the default preference set.
      - unknown
      - object — A request to set a preference set for a recipient.
        - `__persistence_strategy__` 'merge' | 'replace' — Controls how the preference set is persisted. 'replace' will completely replace the preference set, 'merge' will merge with existing preferences.
        - `categories` union — An object where the key is the category and the values are the preference settings for that category.
          - object — An object where the key is the category and the values are the preference settings for that category.
          - unknown
        - `channel_types` union — An object where the key is the channel type and the values are the preference settings for that channel type.
          - object — Channel type preferences.
            - `chat` union — Whether the channel type is enabled for the preference set.
              - …
            - `email` union — Whether the channel type is enabled for the preference set.
              - …
            - `http` union — Whether the channel type is enabled for the preference set.
              - …
            - `in_app_feed` union — Whether the channel type is enabled for the preference set.
              - …
            - `push` union — Whether the channel type is enabled for the preference set.
              - …
            - `sms` union — Whether the channel type is enabled for the preference set.
              - …
          - unknown
        - `workflows` union — An object where the key is the workflow key and the values are the preference settings for that workflow.
          - object — An object where the key is the workflow key and the values are the preference settings for that workflow.
          - unknown

## Response `200`

OK

- SetTenantResponse — A tenant entity.
  - `__typename` string, required — The typename of the schema.
  - `id` string, required — The unique identifier for the tenant.
  - `name` string, nullable — An optional name for the tenant.
  - `settings` object, nullable — The settings for the tenant. Includes branding and preference set.
    - `branding` object, nullable — The branding for the tenant.
      - `icon_url` string, uri, nullable — The icon URL for the tenant. Must point to a valid image with an image MIME type.
      - `logo_url` string, uri, nullable — The logo URL for the tenant. Must point to a valid image with an image MIME type.
      - `primary_color` string, nullable — The primary color for the tenant, provided as a hex value.
      - `primary_color_contrast` string, nullable — The primary color contrast for the tenant, provided as a hex value.
    - `preference_set` union — The preference set for the tenant. Used to override the default preference set.
      - object — A preference set represents a specific set of notification preferences for a recipient. A recipient can have multiple preference sets.
        - `categories` union — An object where the key is the category and the values are the preference settings for that category.
          - object — An object where the key is the category and the values are the preference settings for that category.
          - unknown
        - `channel_types` union — An object where the key is the channel type and the values are the preference settings for that channel type.
          - object — Channel type preferences.
            - `chat` union — Whether the channel type is enabled for the preference set.
              - …
            - `email` union — Whether the channel type is enabled for the preference set.
              - …
            - `http` union — Whether the channel type is enabled for the preference set.
              - …
            - `in_app_feed` union — Whether the channel type is enabled for the preference set.
              - …
            - `push` union — Whether the channel type is enabled for the preference set.
              - …
            - `sms` union — Whether the channel type is enabled for the preference set.
              - …
          - unknown
        - `id` string, required — Unique identifier for the preference set.
        - `workflows` union — An object where the key is the workflow key and the values are the preference settings for that workflow.
          - object — An object where the key is the workflow key and the values are the preference settings for that workflow.
          - unknown
      - unknown

## Changes

- **2025-09-08** `2d3aac5f3ddf` — 1 info
  - added `#/components/schemas/AwsSnsPushChannelData` to the `channel_data/oneOf[subschema #2: InlineChannelDataRequest]/additionalProperties/` request property `oneOf` list
- **2025-08-19** `e4ea1ded040e` — 1 info
  - added the new optional request property `settings/preference_set/oneOf[subschema #2: PreferenceSetRequest]/__persistence_strategy__`
- **2025-06-06** `e5a7933b414d` — 1 warning
  - removed the request property `preferences`
- **2025-05-19** `923618cb1489` — 1 breaking, 1 warning, 1 info
  - the `channel_data/oneOf[subschema #2: InlineChannelDataRequest]/additionalProperties/` request property type changed from `object` to no type
  - removed the request property `channel_data/oneOf[subschema #2: InlineChannelDataRequest]/additionalProperties/data`
  - added `#/components/schemas/PushChannelData, #/components/schemas/OneSignalChannelData, #/components/schemas/SlackChannelData, #/components/schemas/MsTeamsChannelData, #/components/schemas/DiscordChannelData` to the `channel_data/oneOf[subschema #2: InlineChannelDataRequest]/additionalProperties/` request property `oneOf` list

[Change history](https://skmtc.dev/knocklabs/apis/knock-api/changes/v1/tenants/:id/put.md)

---

[API](https://skmtc.dev/knocklabs/apis/knock-api.md) · [All operations](https://skmtc.dev/knocklabs/apis/knock-api/llms.txt) · [OpenAPI document](https://skmtc.dev/knocklabs/apis/knock-api/revisions/7e6c3d2d08fa?raw)
