# app.bivri.notif.registerPush

> Published by [lexicons.bivri.app](https://lexicon.garden/identity/did:plc:uqat5a7hrbww3snbbinxgwah)

✓ This is the authoritative definition for this NSID.

## Description

Authenticated member Web Push subscription management. Identity comes only from authentication.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:uqat5a7hrbww3snbbinxgwah/app.bivri.notif.registerPush)
- [Documentation](https://lexicon.garden/lexicon/did:plc:uqat5a7hrbww3snbbinxgwah/app.bivri.notif.registerPush/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:uqat5a7hrbww3snbbinxgwah/app.bivri.notif.registerPush/examples)

## Definitions

### `app.bivri.notif.registerPush`

**Type**: `procedure`

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `endpoint` | `string` (uri) | Yes | HTTPS endpoint on a supported browser push service. |
| `keys` | `ref` → `#subscriptionKeys` | Yes |  |
| `userAgent` | `string` | No |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `registered` | `boolean` | Yes |  |

#### Errors

- **PushUnavailable**: Web Push is not configured.
- **SubscriptionConflict**: The endpoint belongs to another member.
- **ConsentRequired**: The authenticated member must accept Terms and Privacy Policy and confirm age.

### `app.bivri.notif.registerPush#subscriptionKeys`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `auth` | `string` | Yes | Base64url authentication secret (16 bytes). |
| `p256dh` | `string` | Yes | Base64url uncompressed P-256 public key (65 bytes). |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "errors": [
        {
          "description": "Web Push is not configured.",
          "name": "PushUnavailable"
        },
        {
          "description": "The endpoint belongs to another member.",
          "name": "SubscriptionConflict"
        },
        {
          "description": "The authenticated member must accept Terms and Privacy Policy and confirm age.",
          "name": "ConsentRequired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "endpoint": {
              "description": "HTTPS endpoint on a supported browser push service.",
              "format": "uri",
              "maxLength": 2048,
              "type": "string"
            },
            "keys": {
              "ref": "#subscriptionKeys",
              "type": "ref"
            },
            "userAgent": {
              "maxLength": 512,
              "type": "string"
            }
          },
          "required": [
            "endpoint",
            "keys"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "registered": {
              "const": true,
              "type": "boolean"
            }
          },
          "required": [
            "registered"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "subscriptionKeys": {
      "properties": {
        "auth": {
          "description": "Base64url authentication secret (16 bytes).",
          "maxLength": 22,
          "minLength": 22,
          "type": "string"
        },
        "p256dh": {
          "description": "Base64url uncompressed P-256 public key (65 bytes).",
          "maxLength": 87,
          "minLength": 87,
          "type": "string"
        }
      },
      "required": [
        "p256dh",
        "auth"
      ],
      "type": "object"
    }
  },
  "description": "Authenticated member Web Push subscription management. Identity comes only from authentication.",
  "id": "app.bivri.notif.registerPush",
  "lexicon": 1
}
```
