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:
| Name | Type | Description |
|---|---|---|
tenant | string | The tenant information (organization or system making the request). |
templateName | string | The name of the template. |
subject | string | The subject of the notification. |
type | string | Type of the notification. Example: IN_APP. |
template | string | The content of the notification template. |
status | boolean | The status of the template (active or inactive). |
image | string | Optional. URL of an image associated with the notification. |
sender | string | The sender of the notification (e.g., system or user). |
productName | string | The product associated with the notification. Example: REGISTRY. |
actions | array | A list of actions associated with the notification, including action URLs. |
Each item in the actions array should include:
| Name | Type | Description |
|---|---|---|
action | string | The action type associated with the notification. |
title | string | The title for the action. |
url | string | The 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"
}
]
}'