# Notifications (admin) API

Source: https://frameleaf.app/docs/api/reference/notifications-admin/

Use your own server and its scoped API keys.

## Create a notification

POST /api/admin/notifications

Create a new notification for a specific user.

```json
{
  "description": "Create a new notification for a specific user.",
  "operationId": "createNotification",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/NotificationCreateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/NotificationDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Create a notification",
  "tags": [
    "Notifications (admin)"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "all"
}
```

## Render email template

POST /api/admin/notifications/templates/{name}

Retrieve a preview of the provided email template.

```json
{
  "description": "Retrieve a preview of the provided email template.",
  "operationId": "getNotificationTemplateAdmin",
  "parameters": [
    {
      "name": "name",
      "required": true,
      "in": "path",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/TemplateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/TemplateResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Render email template",
  "tags": [
    "Notifications (admin)"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "all"
}
```

## Send test email

POST /api/admin/notifications/test-email

Send a test email using the provided SMTP configuration.

```json
{
  "description": "Send a test email using the provided SMTP configuration.",
  "operationId": "sendTestEmailAdmin",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AdminConfigSmtpDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/TestEmailResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Send test email",
  "tags": [
    "Notifications (admin)"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "all"
}
```
