A notification bell, an inbox panel or a settings page needs notifications before the service that creates them exists. The notifications template gives you a small in-app notification API behind a real URL: the list with its read flags, the unread count and the preferences.
What you get
The template creates a project with the base path /notifications-api and 5 endpoints. Each endpoint has one ready response, so the API answers as soon as the project exists.
| Method | Path | What it answers |
|---|---|---|
GET |
/notifications |
200 with eight generated notifications, read and unread. |
GET |
/notifications/unread-count |
200 with an unreadCount. |
PATCH |
/notifications/:id |
200 with read: true for the notification in the path, or read: false if the request body says so. |
POST |
/notifications/read-all |
200 with the number of changed notifications and an unreadCount of 0. |
GET |
/preferences |
200 with the channels and notification types that are switched on. |
A notification has id, type (mention, comment, invite, reminder or system), title, message, read and createdAt. The preferences have channels (email, push, inApp), types (one flag for each of the five types), digest (off, daily or weekly) and updatedAt. Titles and messages are generated filler sentences.
Sample response
$ curl -s -X PATCH $URL/notifications-api/notifications/12 \
-H "Content-Type: application/json" \
-d '{"read":false}'
{
"id": "12",
"read": false,
"updatedAt": "2026-11-15T09:12:44Z"
}
The id is the one from the path and updatedAt is the time of the call. With {"read":false} in the body the answer is read: false; with any other body, or none, it is read: true.
How to start
- Sign up at
https://app.mockhop.com/register. The quickstart explains the account and the address of your organization. - Open Projects and select Start from a template.
- Choose Example notifications API and select Use template.
Then call the mock. Replace acme with your organization's address. Your mocks answer from outside once you've confirmed your email address.
$ URL=https://acme.mockhop.cloud
$ curl -s $URL/notifications-api/notifications
$ curl -s $URL/notifications-api/notifications/unread-count
The first call returns eight notifications with random read values. The second answers with an unreadCount between 0 and 12.
What to do next
- Change the responses. Open an endpoint and edit the status code, headers and body of its response, or add more responses with matching rules.
- Add error cases and delays. For example a
404for an unknown notification, a401for an expired session, or a delay to see your loading state. See Simulate API errors, timeouts and rate limits. - Use scenarios for flows. For example an unread count that is
3on the first call and0afterPOST /notifications/read-all. See Scenarios; scenarios are included from the Pro plan. - Export the project. Under Import/Export you can download the project as an OpenAPI 3.0 file.
Good to know
- Nothing is sent anywhere. The template is an example shape for your own code: it delivers no push message, no email and no in-app notification to any device or person.
- Responses are generated per request and the mock keeps no state. Marking a notification as read changes neither the list nor the count: the next
GET /notificationsreturns randomreadvalues again. unreadCountis a random number between0and12. It does not match the unread entries in the list.- The preferences can only be read. The template has no endpoint that changes them, and
push,comment,reminderanddigestare random on every call. - The template creates a new project, and no other project in your organization may use the base path
/notifications-api. The Free plan includes one project. - You can change or delete the project and each of its endpoints at any time.
New to Mockhop? Start with the quickstart. Plans: pricing.