---
title: "Bulk add subscriptions"
method: POST
path: "/v1/objects/{collection}/bulk/subscriptions/add"
tags: ["Objects", "Subscriptions", "Bulk operations"]
---

# Bulk add subscriptions

`POST /v1/objects/{collection}/bulk/subscriptions/add`

Add subscriptions for all objects in a single collection. If a subscription for an object in the collection already exists, it will be updated. This endpoint also handles [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients) for the `recipient` field.

## Path parameters

- `collection` string, required

## Request body

- BulkUpsertSubscriptionsRequest — A request to upsert subscriptions for many groups of 1 subscribed-to object, N subscriber recipients.
  - `subscriptions` object[], required — A nested list of subscriptions.
    - `id` string, required — Unique identifier for the object.
    - `properties` object, nullable — The custom properties associated with the subscription relationship.
    - `recipients` RecipientRequest[], required — The recipients of the subscription. You can subscribe up to 100 recipients to an object at a time.
      - union — Specifies a recipient in a request. This can either be a user identifier (string), an inline user request (object), or an inline object request, which is determined by the presence of a `collection` property.
        - string — The ID of the user which is used as the reference for the recipient.
        - object — A set of parameters to inline-identify a user with. Inline identifying the user will ensure that the user is available before the request is executed in Knock. It will perform an upsert for the user you're supplying, replacing any properties specified.
          - `avatar` string, nullable — A URL for the avatar of the user.
          - `channel_data` InlineChannelDataRequest — A request to set channel data for a type of channel inline.
          - `created_at` string, date-time, nullable — The creation date of the user from your system.
          - `email` string, nullable — The primary email address for the user.
          - `id` string, required — The unique identifier of the user.
          - `locale` string, nullable — The locale of the user. Used for [message localization](/concepts/translations).
          - `name` string, nullable — Display name of the user.
          - `phone_number` string, nullable — The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the user (required for SMS channels).
          - `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 user. 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).
        - object — A custom [Object](/concepts/objects) entity which belongs to a collection.
          - `channel_data` union — An optional set of [channel data](/managing-recipients/setting-channel-data) for the object. This is a list of `ChannelData` objects.
            - object — A request to set channel data for a type of channel inline.
            - unknown
          - `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.
          - `name` string, nullable — An optional name for the object.
          - `preferences` union — An optional set of [preferences](/concepts/preferences) for the object.
            - object — 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.
            - unknown

## Response `200`

OK

- BulkOperation — A bulk operation entity.
  - `__typename` string, required — The typename of the schema.
  - `completed_at` string, date-time, nullable — Timestamp when the bulk operation was completed.
  - `error_count` integer — The number of failed operations.
  - `error_items` object[] — A list of items that failed to be processed.
    - `collection` string, nullable — The collection this object belongs to.
    - `id` string, required — Unique identifier for the object.
  - `estimated_total_rows` integer, required — The estimated total number of rows to process.
  - `failed_at` string, date-time, nullable — Timestamp when the bulk operation failed.
  - `id` string, uuid, required — Unique identifier for the bulk operation.
  - `inserted_at` string, date-time, required — Timestamp when the resource was created.
  - `name` string, required — The name of the bulk operation.
  - `processed_rows` integer, required — The number of rows processed so far.
  - `progress_path` string, uri — The URI to the bulk operation's progress.
  - `started_at` string, date-time, nullable — Timestamp when the bulk operation was started.
  - `status` 'queued' | 'processing' | 'completed' | 'failed', required — The status of the bulk operation.
  - `success_count` integer, required — The number of successful operations.
  - `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)
