---
title: "Create push subscription"
method: POST
path: "/api/user/push-subscriptions"
tags: ["User"]
---

# Create push subscription

`POST /api/user/push-subscriptions`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/user/push-subscriptions`
- Auth: HTTP bearer

Upserts the caller's push subscription. Body: { platform (required), provider?, externalSubscriptionId?, pushToken?, isEnabled?, metadata? }. A non-blank externalSubscriptionId is trimmed and upserted on that id, and the row's userId moves to the caller so a device signed into another account stops receiving the previous account's pushes. A missing or blank id updates or creates the legacy null-id row for that caller and platform. Returns 201.

## Response `201`

{ success, data }

## Other responses

- `400`: Validation error
- `401`: Authentication required

## Changes

- **2026-11-18** `6de639c52609`: 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `201`
- **2026-09-12** `c191eafc1801`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/user/push-subscriptions/post.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
