Skip to content
You are reading the unreleased documentation. No version is released yet, and these pages describe code that is not in a release.

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", "sms", "push", 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 ("queued", "sent", "delivered", "bounced", "complained", "failed", "suppressed", "skipped", "enqueue-failed", 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", "sms", "push", 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 both locales (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", "sms", "push", required).
  • event (string, pattern /^[a-z][a-z0-9_.]*$/, required).
  • variables (array of string, optional).
  • isEnabled (boolean, optional).
  • sendEnabled (boolean, optional).
  • category ("TRANSACTIONAL", "LIFECYCLE", "MARKETING", optional).
  • default (string, optional).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • locale ("fr", "en", "ar", optional).
  • variables (object, optional).
  • default (string, required).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).