Novu Workflows API

Multi-channel notification workflow definitions.

Documentation

Specifications

Other Resources

OpenAPI Specification

novu-co-workflows-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Novu Environments Workflows 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: Workflows
  description: Multi-channel notification workflow definitions.
paths:
  /workflows:
    post:
      operationId: createWorkflow
      tags:
      - Workflows
      summary: Create a workflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowInput'
      responses:
        '201':
          description: The created workflow.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        '401':
          $ref: '#/components/responses/Unauthorized'
    get:
      operationId: listWorkflows
      tags:
      - Workflows
      summary: List all workflows
      parameters:
      - name: page
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: A page of workflows.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Workflow'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /workflows/{workflowId}:
    parameters:
    - name: workflowId
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: getWorkflow
      tags:
      - Workflows
      summary: Retrieve a workflow
      responses:
        '200':
          description: The requested workflow.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: updateWorkflow
      tags:
      - Workflows
      summary: Update a workflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowInput'
      responses:
        '200':
          description: The updated workflow.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: patchWorkflow
      tags:
      - Workflows
      summary: Partially update a workflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
      responses:
        '200':
          description: The updated workflow.
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteWorkflow
      tags:
      - Workflows
      summary: Delete a workflow
      responses:
        '200':
          description: Deletion result.
        '404':
          $ref: '#/components/responses/NotFound'
  /workflows/{workflowId}/sync:
    post:
      operationId: syncWorkflow
      tags:
      - Workflows
      summary: Sync a workflow
      description: Syncs a workflow to a target environment.
      parameters:
      - name: workflowId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                targetEnvironmentId:
                  type: string
      responses:
        '200':
          description: Sync result.
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    WorkflowInput:
      type: object
      required:
      - name
      properties:
        name:
          type: string
        workflowId:
          type: string
        description:
          type: string
        active:
          type: boolean
        steps:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                - in_app
                - email
                - sms
                - chat
                - push
                - digest
                - delay
                - trigger
                - custom
            additionalProperties: true
        tags:
          type: array
          items:
            type: string
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    Workflow:
      allOf:
      - $ref: '#/components/schemas/WorkflowInput'
      - type: object
        properties:
          _id:
            type: string
          _environmentId:
            type: string
          createdAt:
            type: string
            format: date-time
  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>`.'