API v1
v1
View as Markdown

Get a notification

GET /api/v1/notifications/{notification}

Retrieve one notification by its address.

Reading a notification through this endpoint does not mark it as read. Say so on purpose with the endpoint below, so that fetching a record and acting on it stay two separate things.

This endpoint also answers QUERY, with the same parameters sent in the request body. How QUERY works.

Path parameters

Sent as JSON. Anything not listed here is ignored.

notification uuid Required

The address of the notification.

Returns

One notification. A notification belonging to another account answers 404, and so does an address that matches nothing, deliberately: the two cannot be told apart.

data object

The notification.

data.type string

Always notification. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.

data.id string

The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.

data.attributes object

Everything the record holds.

data.attributes.notification_type string

What the notification is about, as a key such as reminder_due or digest. The set grows as the product finds new things to say, so match the keys you care about and let an unfamiliar one through rather than treating it as an error.

data.attributes.channel string

Which way it went out: in_app, email, slack, telegram or sms. One notification is written per channel, so a reminder that went out two ways is two records here, alike in everything but this field.

data.attributes.title string

The one line it leads with, up to 255 characters. For a reminder it is the name of the reminder.

data.attributes.body string

What it says under the title, of no fixed length, written in the language the account was set to at the moment it was made rather than the one you are asking in.

data.attributes.scheduled_for timestamp

When it was due, as a count of seconds since 1970. Quiet hours can hold a notification back, so this can be earlier than sent_at by hours.

data.attributes.sent_at timestamp

When it went out, as a count of seconds since 1970, or null when it has not gone out yet.

data.attributes.read_at timestamp

When it was first read, as a count of seconds since 1970, or null when it has not been. Reading something twice keeps the first moment.

data.attributes.failure_reason string

What the channel said when it refused, up to 255 characters, or null when nothing refused. A notification that failed keeps its record and its reason rather than disappearing.

data.attributes.created_at timestamp

When the record was written, as a count of seconds since 1970.

data.links object

Where to find this record.

data.links.self string

The absolute address this record is read from.

Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in X-RateLimit-Remaining.

GET
curl https://my.monicahq.com/api/v1/notifications/9c7f2a1e-4b6d-4f0a-9f2b-1d3c5e7a9b11 \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://my.monicahq.com/api/v1/notifications/9c7f2a1e-4b6d-4f0a-9f2b-1d3c5e7a9b11', {
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/notifications/9c7f2a1e-4b6d-4f0a-9f2b-1d3c5e7a9b11');
Response 200
{
"data": {
"type": "notification",
"id": "9c7f2a1e-4b6d-4f0a-9f2b-1d3c5e7a9b11",
"attributes": {
"notification_type": "reminder_due",
"channel": "in_app",
"title": "Birthday, Michael Scott",
"body": "It is in seven days.",
"scheduled_for": 1756339200,
"sent_at": 1756339210,
"read_at": null,
"failure_reason": null,
"created_at": 1756339200
},
"links": {
"self": "https://my.monicahq.com/api/v1/notifications/9c7f2a1e-4b6d-4f0a-9f2b-1d3c5e7a9b11"
}
}
}

Keys act as you, with exactly the access you have. Make one per integration so you can revoke it alone.