---
title: "Subscribe Push"
method: POST
path: "/api/push/subscribe"
tags: ["push-notifications", "push-notifications"]
---

# Subscribe Push

`POST /api/push/subscribe`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/push/subscribe`
- Auth: none declared

Register a push subscription for the current user.

## Request body

- PushSubscriptionCreate: Request to register a push subscription. ``webpush`` carries a Web Push ``endpoint`` + ``keys``. ``fcm`` / ``apns`` carry the device ``token`` (stored in ``endpoint``, keys empty); an iOS app also sends its PushKit ``voip_token``: a value sets it, an explicit ``null`` clears it (PushKit invalidated the token), and no key at all keeps the stored one (the app could not read it this time).
  - `kind` 'webpush' | 'fcm' | 'apns'
  - `endpoint` string, nullable
  - `keys` PushSubscriptionKeys: Web Push subscription keys.
    - `p256dh` string, required
    - `auth` string, required
  - `token` string, nullable
  - `voip_token` string, nullable
  - `platform` 'ios' | 'android', nullable
  - `user_agent` string, nullable
  - `device_name` string, nullable

## Response `200`

Successful Response

- PushSubscription: Push subscription response.
  - `id` integer, required
  - `kind` string, required
  - `endpoint` string, required
  - `device_name` string, nullable
  - `is_active` boolean, required
  - `created_at` string, required
  - `last_used_at` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
