Documentation · API reference
POST
/api/v1/me/pushAdd the browser this is asked from as a device
This page as Markdown, or in an AI chatMore ways to read this page
Add the browser this is asked from as a device: what it gave when it subscribed to its push service.
# Add the browser this is asked from as a device
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-me-push
`POST /api/v1/me/push`
Add the browser this is asked from as a device: what it gave when it subscribed to its push service.
## What to send
`PushSubscribe`: What a browser gave when it subscribed.
- `auth` (string)
- `endpoint` (string)
- `name` (string or null): A name for the device. Left out: what its browser says it is.
- `p256dh` (string)
## The answer
201, `PushDeviceView`
- `by` (string, needed): The member whose device it is.
- `error` (string, needed): What its push service said the last time it refused. Empty: nothing.
- `id` (string, needed)
- `last_sent` (integer or null)
- `made` (integer, needed)
- `mine` (boolean, needed): It is the asking member's own.
- `name` (string, needed): What its owner sees it as: `Firefox on Linux`.
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/me/push \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
```
What to send
PushSubscribe What a browser gave when it subscribed.
- auth
- string
- endpoint
- string
- name
- string or nullA name for the device. Left out: what its browser says it is.
- p256dh
- string
The answer
Status 201
PushDeviceView
- by
- stringneededThe member whose device it is.
- error
- stringneededWhat its push service said the last time it refused. Empty: nothing.
- id
- stringneeded
- last_sent
- integer or null
- made
- integerneeded
- mine
- booleanneededIt is the asking member's own.
- name
- stringneededWhat its owner sees it as: `Firefox on Linux`.
Asking
curl -X POST https://tidekeeper.eu/api/v1/me/push \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'
const answer = await fetch("https://tidekeeper.eu/api/v1/me/push", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({}), }).then((r) => r.json());