Skip to content
You are reading the pinned copy of v1.0, which is also the latest release. Read the latest.

Notifications (admin API)

Admin routes of the notifications module. Every route needs a staff session and the permission named on it; send X-Resolve-Locale: false to receive every locale of a translatable field for editing.

List notifications for the current admin user

Parameters:

  • isRead in query (boolean, optional).
  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).

Responses:

  • 200: no description.

Mark one notification as read

Parameters:

  • id in path (string, required).

Responses:

  • 200: no description.

List notification send-log entries

Parameters:

  • channel in query ("email", "push", "sms", optional).
  • from in query (string, optional).
  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).
  • recipient in query (string, optional).
  • status in query ("bounced", "complained", "delivered", "enqueue-failed", "failed", "queued", "sent", "skipped", "suppressed", optional).
  • templateCode in query (string, optional).
  • to in query (string, optional).

Responses:

  • 200: Log retrieved.

POST /v1/admin/notifications/log/{id}/resend

Section titled “POST /v1/admin/notifications/log/{id}/resend”

Resend a notification log entry

Parameters:

  • id in path (string, required).

Responses:

  • 200: Resend queued.
  • 404: Log entry not found.

Mark all notifications as read

Responses:

  • 200: no description.

List notification templates

Parameters:

  • channel in query ("email", "push", "sms", optional).
  • event in query (string, optional).
  • isEnabled in query (boolean, optional).
  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).

Responses:

  • 200: Templates retrieved.

Create notification template

Request body: CreateNotificationTemplateDto.

Responses:

  • 201: Created.
  • 400: Invalid input.
  • 409: Code already in use.

DELETE /v1/admin/notifications/templates/{id}

Section titled “DELETE /v1/admin/notifications/templates/{id}”

Delete notification template

Parameters:

  • id in path (string, required).

Responses:

  • 204: Deleted.
  • 404: Template not found.

GET /v1/admin/notifications/templates/{id}

Section titled “GET /v1/admin/notifications/templates/{id}”

Get template

Parameters:

  • id in path (string, required).

Responses:

  • 200: Template retrieved.
  • 404: Template not found.

PATCH /v1/admin/notifications/templates/{id}

Section titled “PATCH /v1/admin/notifications/templates/{id}”

Update notification template

Parameters:

  • id in path (string, required).

Request body: UpdateNotificationTemplateDto.

Responses:

  • 200: Updated.
  • 400: Invalid input.
  • 404: Template not found.

POST /v1/admin/notifications/templates/{id}/preview

Section titled “POST /v1/admin/notifications/templates/{id}/preview”

Render a draft template for every enabled locale (no send, no persist)

Parameters:

  • id in path (string, required).

Request body: PreviewTemplateDto.

Responses:

  • 200: Rendered preview.
  • 400: Body references an undeclared variable.
  • 404: Template not found.

POST /v1/admin/notifications/templates/{id}/send-test

Section titled “POST /v1/admin/notifications/templates/{id}/send-test”

Send a test of this template to your own inbox

Parameters:

  • id in path (string, required).

Request body: SendTestTemplateDto.

Responses:

  • 200: Test enqueued (honest outcome).
  • 400: Non-email template or no recipient email.
  • 404: Template not found.

Get unread notification count

Responses:

  • 200: no description.
  • code (string, pattern ^[a-z][a-z0-9_.]*$, min length 2, max length 100, required).
  • subject (OptionalTranslatableBodyDto, optional).
  • body (TranslatableBodyDto, required).
  • channel ("email", "push", "sms", required).
  • event (string, pattern ^[a-z][a-z0-9_.]*$, required).
  • variables (array of string, optional).
  • isEnabled (boolean, optional).
  • sendEnabled (boolean, optional).
  • category ("LIFECYCLE", "MARKETING", "TRANSACTIONAL", optional).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, optional).
  • locale ("ar", "en", "fr", optional).
  • variables (object, optional).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, required).
As seen on Open Source Alternatives The Merchant Engine badge