Bulk create subscribers

Using this endpoint multiple subscribers can be created at once. The bulk API is limited to 500 subscribers per request.

POST
/v1/subscribers/bulk

Authorization

Authorization<token>

API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".

In: header

Request Body

application/jsonRequired
subscribersRequiredarray<object>

An array of subscribers to be created in bulk.

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

Created

updatedRequiredarray<object>

An array of subscribers that were successfully updated.

@minItems 0

createdRequiredarray<object>

An array of subscribers that were successfully created.

@minItems 0

failedRequiredarray<object>

An array of failed operations with error messages and optional subscriber IDs.

@minItems 0

export interface Response {
  /**
   * An array of subscribers that were successfully updated.
   *
   * @minItems 0
   */
  updated: UpdatedSubscriberDto[];
  /**
   * An array of subscribers that were successfully created.
   *
   * @minItems 0
   */
  created: CreatedSubscriberDto[];
  /**
   * An array of failed operations with error messages and optional subscriber IDs.
   *
   * @minItems 0
   */
  failed: FailedOperationDto[];
}
export interface UpdatedSubscriberDto {
  /**
   * The ID of the subscriber that was updated.
   */
  subscriberId: string;
}
export interface CreatedSubscriberDto {
  /**
   * The ID of the subscriber that was created.
   */
  subscriberId: string;
}
export interface FailedOperationDto {
  /**
   * The error message associated with the failed operation.
   */
  message?: string;
  /**
   * The subscriber ID associated with the failed operation. This field is optional.
   */
  subscriberId?: string;
}
 
curl -X POST "https://api.novu.co/v1/subscribers/bulk" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "subscribers": [
      {
        "subscriberId": "string",
        "firstName": "string",
        "lastName": "string",
        "email": "string",
        "phone": "string",
        "avatar": "string",
        "timezone": "string",
        "locale": "string",
        "data": {}
      }
    ]
  }'
{
  "updated": [
    {
      "subscriberId": "string"
    }
  ],
  "created": [
    {
      "subscriberId": "string"
    }
  ],
  "failed": [
    {
      "message": "string",
      "subscriberId": "string"
    }
  ]
}