Skip to main content

Create Notification Template

POST /api/v1/notifications/templates

Description

Creates a new notification template for the system. This template can be used to generate consistent notifications across the application.

Headers:

  • tenantId (required): A string representing the tenant ID, included in the request header.
  • Authorization (required): A valid bearer token is required for authentication and authorization.

Sample Request Body

{
"tenant": "string",
"templateName": "string",
"subject": "string",
"type": "IN_APP",
"template": "string",
"status": true,
"image": "string",
"sender": "string",
"productName": "REGISTRY",
"actions": [
{
"action": "string",
"title": "string",
"url": "string"
}
]
}

Request Body:

NameTypeDescription
tenantstringThe tenant information (organization or system making the request).
templateNamestringThe name of the template.
subjectstringThe subject of the notification.
typestringType of the notification. Example: IN_APP.
templatestringThe content of the notification template.
statusbooleanThe status of the template (active or inactive).
imagestringOptional. URL of an image associated with the notification.
senderstringThe sender of the notification (e.g., system or user).
productNamestringThe product associated with the notification. Example: REGISTRY.
actionsarrayA list of actions associated with the notification, including action URLs.

Each item in the actions array should include:

NameTypeDescription
actionstringThe action type associated with the notification.
titlestringThe title for the action.
urlstringThe URL for the action.

Example Request:

curl -X POST "{{baseURL}}/api/v1/notifications/templates" \
-H "Authorization: Bearer [access_token]" \
-H "tenantId: [tenantId]" \
-d '{
"tenant": "string",
"templateName": "string",
"subject": "string",
"type": "IN_APP",
"template": "string",
"status": true,
"image": "string",
"sender": "string",
"productName": "REGISTRY",
"actions": [
{
"action": "string",
"title": "string",
"url": "string"
}
]
}'