Novu Subscribers API

Manage notification recipients and their credentials.

Documentation

Specifications

Other Resources

OpenAPI Specification

novu-co-subscribers-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Novu Environments Subscribers API
  description: 'The Novu REST API drives open-source notification infrastructure that sends multi-channel messages - email, SMS, push, chat, and an in-app Inbox - from a single workflow trigger. A trigger event fans a notification out across the channels defined in a workflow. This document models the core resources - Events (Trigger), Subscribers, Topics, the in-app Inbox feed, Messages, Notifications (activity), Workflows, Integrations, Layouts, subscriber Preferences, Environments, and Translations. Novu is open source (MIT) and self-hostable, and also runs as Novu Cloud with US and EU regions. All requests authenticate with a secret API key sent as `Authorization: ApiKey <NOVU_SECRET_KEY>`. Endpoints are grounded in Novu''s published API reference; request/response bodies are modeled at a representative level rather than field-complete.'
  version: '1.0'
  contact:
    name: Novu
    url: https://novu.co
  license:
    name: MIT
    url: https://github.com/novuhq/novu/blob/next/LICENSE
servers:
- url: https://api.novu.co/v1
  description: Novu Cloud - US (default)
- url: https://eu.api.novu.co/v1
  description: Novu Cloud - EU
security:
- apiKeyAuth: []
tags:
- name: Subscribers
  description: Manage notification recipients and their credentials.
paths:
  /subscribers:
    post:
      operationId: createSubscriber
      tags:
      - Subscribers
      summary: Create a subscriber
      description: Creates a subscriber (notification recipient).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriberInput'
      responses:
        '201':
          description: The created subscriber.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /subscribers/bulk:
    post:
      operationId: bulkCreateSubscribers
      tags:
      - Subscribers
      summary: Bulk create subscribers
      description: Creates up to 500 subscribers in a single request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                subscribers:
                  type: array
                  items:
                    $ref: '#/components/schemas/SubscriberInput'
      responses:
        '201':
          description: Bulk create result.
        '401':
          $ref: '#/components/responses/Unauthorized'
  /subscribers/{subscriberId}:
    parameters:
    - $ref: '#/components/parameters/SubscriberId'
    get:
      operationId: getSubscriber
      tags:
      - Subscribers
      summary: Retrieve a subscriber
      responses:
        '200':
          description: The requested subscriber.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: updateSubscriber
      tags:
      - Subscribers
      summary: Update a subscriber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriberInput'
      responses:
        '200':
          description: The updated subscriber.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteSubscriber
      tags:
      - Subscribers
      summary: Delete a subscriber
      responses:
        '200':
          description: Deletion result.
        '404':
          $ref: '#/components/responses/NotFound'
  /subscribers/{subscriberId}/credentials/{providerId}:
    parameters:
    - $ref: '#/components/parameters/SubscriberId'
    - name: providerId
      in: path
      required: true
      schema:
        type: string
    put:
      operationId: updateSubscriberCredentials
      tags:
      - Subscribers
      summary: Update provider credentials
      description: Updates channel credentials (for example a device token or chat webhook URL) for a subscriber and provider.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                credentials:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Updated subscriber.
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    SubscriberId:
      name: subscriberId
      in: path
      required: true
      description: Your application's unique identifier for the subscriber.
      schema:
        type: string
  schemas:
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    Subscriber:
      allOf:
      - $ref: '#/components/schemas/SubscriberInput'
      - type: object
        properties:
          _id:
            type: string
          _environmentId:
            type: string
          _organizationId:
            type: string
          createdAt:
            type: string
            format: date-time
    SubscriberInput:
      type: object
      required:
      - subscriberId
      properties:
        subscriberId:
          type: string
        email:
          type: string
        phone:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        avatar:
          type: string
        locale:
          type: string
        data:
          type: object
          additionalProperties: true
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Novu secret API key from the Dashboard API Keys page, sent as `Authorization: ApiKey <NOVU_SECRET_KEY>`.'