---
# @generated by sylphx-gen. Do not edit.
title: "Register push device on a recipient"
description: "`notify.recipients.register_push_device` (POST /v1/{name}:registerPushDevice): Atomically registers or renews one Web Push subscription."
type: reference
product: notifications
summary: "Atomically registers or renews one Web Push subscription."
updated: 2026-09-28
nav: false
---

Atomically registers or renews one Web Push subscription. Other devices remain registered. The sender and recipient must share an environment.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/recipients/recipient:registerPushDevice`
- **Scope** `notify:write`
- **Effect** `write` — a successful call changes state.
- **Collection** [recipients](/docs/api/recipients)

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The recipient to register for. Required. |
| `device` | `PushDevice` | A browser subscription, with its configured sender. Required. |

### PushDevice

| Field | Type | What it is |
| --- | --- | --- |
| `platform` | `PushPlatform` | The platform. Required. One of `apns`, `fcm`, `web_push`. |
| `device_token` | `string` | Write-only. For web_push, the exact JSON string returned by a browser's PushSubscription.toJSON(): endpoint, optional expirationTime, and keys containing base64url p256dh and auth. APNs and FCM are not yet served. Required. Never returned again. |
| `sender` | `string` | The push Sender the token belongs to. Required. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `registration_id` | `string` | Identifies this recipient's device without revealing its subscription. |
| `sender` | `string` | The sender the registration was bound to. |
| `application_server_key` | `string` | Public applicationServerKey used by the browser subscription. |
| `recipient_uid` | `string` | Immutable Notify Recipient UID; the application binds it to its own active authenticated principal before accepting notifications. Output only. |
| `registration_generation` | `int64` | Exact registration epoch, encoded as a decimal string in JSON. Output only. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`RESOURCE_NOT_FOUND`](/docs/api/errors/RESOURCE_NOT_FOUND) — The named Resource does not exist or is not visible.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`INVALID_STATE`](/docs/api/errors/INVALID_STATE) — The Resource is in a state that forbids the call.
- [`IDEMPOTENCY_KEY_REUSED`](/docs/api/errors/IDEMPOTENCY_KEY_REUSED) — An Idempotency-Key was reused with another body.
- [`IDEMPOTENCY_IN_PROGRESS`](/docs/api/errors/IDEMPOTENCY_IN_PROGRESS) — The first call with this Idempotency-Key is still running.
- [`UNAVAILABLE`](/docs/api/errors/UNAVAILABLE) — The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/recipients/recipient:registerPushDevice" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"device":{"device_token":"…","platform":"apns","sender":"…"}}'
```

**TypeScript**

```ts
const response = await sylphx.notify.recipients.registerPushDevice({ device: { deviceToken: '…', platform: 'apns', sender: '…' }, name: 'orgs/acme/projects/shop/envs/production/recipients/recipient' })
```

**Rust**

```rust
let mut req = sylphx::notify::RegisterPushDeviceRequest::default();
req.device = Some(sylphx::notify::PushDevice {
    device_token: "…".to_string(),
    platform: sylphx::notify::PushPlatform::Apns,
    sender: "…".to_string(),
    ..Default::default()
});
req.name = "orgs/acme/projects/shop/envs/production/recipients/recipient".to_string();
let response = sx.notify().recipients().register_push_device(req).await?;
```

**CLI**

```bash
sylphx notify recipients register-push-device orgs/acme/projects/shop/envs/production/recipients/recipient
```

**MCP**

```json
{ "method_id": "notify.recipients.register_push_device", "args": {"device":{"device_token":"…","platform":"apns","sender":"…"},"name":"orgs/acme/projects/shop/envs/production/recipients/recipient"} }
```
