Skip to content

Notification (💗 Pro only)

FastAPI-Admin provide a notification center implement by websocket.


You should add it to providers to enable it.

from fastapi import FastAPI
from import app as admin_app
from fastapi_admin.providers.notification import NotificationProvider

app = FastAPI()

provider = NotificationProvider()

async def startup():
    await admin_app.configure(

There are two ways to send notifications.

One is call await provider.broadcast() directly.

data = {
    "title": "test",
    "content": "//",
    "image": "",
    "link": ""
await provider.broadcast(data)

If you want to send notifications out of application, another way is use http api.

import requests'http://localhost:8000/admin/notification', json=data)

Last update: August 28, 2022 06:31:41