---
title: Add a channel subscription
full: true
_openapi:
  method: POST
  toc: []
  structuredData:
    headings: []
    contents:
      - content: >
          Add a channel subscription for the current user.

          If a subscription with the same `identifier` already exists, its
          `settings` are updated in place.


          ```json

          {
            "identifier": "https://fcm.googleapis.com/fcm/send/...",
            "settings": {
              "endpoint": "https://fcm.googleapis.com/fcm/send/...",
              "p256dh": "BOxxx...",
              "auth": "xxx..."
            }
          }

          ```


          The `identifier` is the dedup key (for web push, the push endpoint
          URL).

          The `settings` object contains provider-specific fields validated per
          channel type.
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

Add a channel subscription for the current user.
If a subscription with the same `identifier` already exists, its `settings` are updated in place.

```json
{
  "identifier": "https://fcm.googleapis.com/fcm/send/...",
  "settings": {
    "endpoint": "https://fcm.googleapis.com/fcm/send/...",
    "p256dh": "BOxxx...",
    "auth": "xxx..."
  }
}
```

The `identifier` is the dedup key (for web push, the push endpoint URL).
The `settings` object contains provider-specific fields validated per channel type.


<APIPage document={"./openapi-user.json"} operations={[{"path":"/channels/{channel_id}/subscriptions","method":"post"}]} />