# 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.

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

## Authentication

Use your [API key](/docs/api-keys) in the request header.

```http
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

```javascript Node
import ActivitySmith from "activitysmith";

const activitysmith = new ActivitySmith({
  apiKey: process.env.ACTIVITYSMITH_API_KEY,
});

await activitysmith.notifications.dismiss("Xk3pQ8mV2nR7tL9wB4yZ");
```

```python Python
import os
from activitysmith import ActivitySmith

activitysmith = ActivitySmith(api_key=os.environ["ACTIVITYSMITH_API_KEY"])

activitysmith.notifications.dismiss("Xk3pQ8mV2nR7tL9wB4yZ")
```

```go Go
package main

import (
	"log"

	activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)

func main() {
	activitysmith, err := activitysmithsdk.New("YOUR-API-KEY")
	if err != nil {
		log.Fatal(err)
	}

	_, err = activitysmith.Notifications.Dismiss("Xk3pQ8mV2nR7tL9wB4yZ")
	if err != nil {
		log.Fatal(err)
	}
}
```

```php PHP
<?php

use ActivitySmith\ActivitySmith;

$activitysmith = new ActivitySmith($_ENV['ACTIVITYSMITH_API_KEY']);

$activitysmith->notifications->dismiss('Xk3pQ8mV2nR7tL9wB4yZ');
```

```ruby Ruby
require "activitysmith"

activitysmith = ActivitySmith::Client.new(api_key: ENV.fetch("ACTIVITYSMITH_API_KEY"))

activitysmith.notifications.dismiss("Xk3pQ8mV2nR7tL9wB4yZ")
```

```bash CLI
activitysmith push dismiss "Xk3pQ8mV2nR7tL9wB4yZ"
```

```bash cURL
curl -X POST "https://activitysmith.com/api/push-notification/Xk3pQ8mV2nR7tL9wB4yZ/dismiss" \
  -H "Authorization: Bearer $YOUR_API_KEY"
```

## 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.

| Field | Type | Presence | Description | Constraints |
| --- | --- | --- | --- | --- |
| `success` | boolean | Required | True when the dismissal is recorded. |  |
| `notification_id` | string | Required | ID of the dismissed Push Notification. |  |
| `dismissed_at` | `string<date-time>` | Required | When the notification was first dismissed. Repeat calls return the same time. |  |

**Additional Properties**: `false`

**default**

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

### 402

Billing access required

Content type: `application/json`

### Schema: BillingBlockedError

| Field | Type | Presence | Description | Constraints |
| --- | --- | --- | --- | --- |
| `error` | string | Required |  | **Enum**: `["trial_expired","trial_exhausted","billing_overage_cap_reached"]` |
| `message` | string | Required |  |  |
| `trial_period` | object | Optional |  |  |
| `trial_period.started_at` | `string<date-time>` | Required |  |  |
| `trial_period.ends_at` | `string<date-time>` | Required |  |  |
| `upgrade_url` | `string<uri>` | Required |  |  |

**Additional Properties**: `true`

### 403

Forbidden (API key scope or channel assignment violation)

Content type: `application/json`

### Schema: ForbiddenError

| Field | Type | Presence | Description | Constraints |
| --- | --- | --- | --- | --- |
| `error` | string | Required |  |  |
| `message` | string | Required |  |  |

**Additional Properties**: `true`

**channel scope violation**

```json
{
  "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

| Field | Type | Presence | Description | Constraints |
| --- | --- | --- | --- | --- |
| `error` | string | Required |  |  |
| `message` | string | Required |  |  |

**Additional Properties**: `true`

**not found**

```json
{
  "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](#schema-notfounderror)

**not dismissible**

```json
{
  "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**

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

[Download the OpenAPI specification](/openapi.json)
