Push Notifications EndpointsView Markdown ↗

Dismiss Push Notification

Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the notification_id from the send response. Notification history keeps it.

Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Devices running an ActivitySmith app version before 1.17.0 show a silent notification titled "Push Notification dismissed" in its place until the user clears it.

Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.

POST https://activitysmith.com/api/push-notification/{notification_id}/dismiss

Authentication#

Use your API key in the request header.

Authorization: Bearer $YOUR_API_KEY

Parameters#

notification_id#

path parameter. Required.

The notification_id returned when the Push Notification was sent.

Type: string

Min Length: 1

Request examples#

import ActivitySmith from "activitysmith";
const activitysmith = new ActivitySmith({
apiKey: process.env.ACTIVITYSMITH_API_KEY,
});
await activitysmith.notifications.dismiss("Xk3pQ8mV2nR7tL9wB4yZ");

Responses#

200#

Push notification dismissal recorded

Content type: application/json

Schema: PushNotificationDismissResponse#

Dismissal result. Devices clear the notification after this response, so it does not confirm that any device has cleared it.

successbooleanrequired
True when the dismissal is recorded.
notification_idstringrequired
ID of the dismissed Push Notification.
dismissed_atstring<date-time>required
When the notification was first dismissed. Repeat calls return the same time.

Additional Properties: false

default

{
"success": true,
"notification_id": "Xk3pQ8mV2nR7tL9wB4yZ",
"dismissed_at": "2025-08-12T12:05:00.000Z"
}

402#

Billing access required

Content type: application/json

Schema: BillingBlockedError#

errorstringrequired
Enum: ["trial_expired","trial_exhausted","billing_overage_cap_reached"]
messagestringrequired
trial_periodobject
trial_period.started_atstring<date-time>required
trial_period.ends_atstring<date-time>required
upgrade_urlstring<uri>required

Additional Properties: true

403#

Forbidden (API key scope or channel assignment violation)

Content type: application/json

Schema: ForbiddenError#

errorstringrequired
messagestringrequired

Additional Properties: true

channel scope violation

{
"error": "Invalid channel targeting",
"message": "This API key can only target assigned channels. Requested channels include channels outside this key scope."
}

404#

Push notification not found

Content type: application/json

Schema: NotFoundError#

errorstringrequired
messagestringrequired

Additional Properties: true

not found

{
"error": "Push notification not found",
"code": "push_notification_not_found",
"message": "No push notification found with id: Xk3pQ8mV2nR7tL9wB4yZ"
}

409#

Push notification was sent before dismissal support

Content type: application/json

Schema: NotFoundError

not dismissible

{
"error": "Push notification cannot be dismissed",
"code": "push_notification_not_dismissible",
"message": "This push notification was sent before dismissal was supported and cannot be dismissed."
}

429#

Rate limit exceeded

Content type: application/json

oneOf

Schema: RateLimitError

Schema: LiveActivityLimitError

rate limited

{
"error": "Rate limit exceeded",
"message": "Too many requests, please try again later."
}

Download the OpenAPI specification