Subscribers addition

Add subscribers to a topic by key

POST
/v1/topics/{topicKey}/subscribers

Authorization

Authorization<token>

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

In: header

Request Body

application/jsonRequired
subscribersRequiredarray<string>

List of subscriber identifiers that will be associated to the topic

Path Parameters

topicKeyRequiredstring

The topic key

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

succeededRequiredarray<string>

List of successfully assigned subscriber IDs

failedobject

Details about failed assignments

export interface Response {
  /**
   * List of successfully assigned subscriber IDs
   */
  succeeded: string[];
  /**
   * Details about failed assignments
   */
  failed?: FailedAssignmentsDto;
}
export interface FailedAssignmentsDto {
  /**
   * List of subscriber IDs that were not found
   */
  notFound?: string[];
}
 
curl -X POST "https://api.novu.co/v1/topics/string/subscribers" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "subscribers": [
      "string"
    ]
  }'
{
  "succeeded": [
    "string"
  ],
  "failed": {
    "notFound": [
      "string"
    ]
  }
}