Delivery · registerDevice
Register a phone for push
POST /v1/devices
The app registers its FCM token on every launch. Re-registering a token moves it to the signed-in member.
- Who may call it
- any signed-in human
- Server
- https://api.logu.dev
Request body#
Content type application/json (required).
A phone's FCM token. Strict.
| Field | Type | Required | Notes |
|---|---|---|---|
platform | "ios" | "android" | "web" | required | |
token | string | required | 20–4096 chars |
{
"platform": "ios",
"token": "fcm:dQw4w9WgXcQ8vN2pL5kR7tY1uI3oP6aS9dF2gH4jK"
}
Example#
curl -s -X POST "https://api.logu.dev/v1/devices" \
-H "Authorization: Bearer $LOGU_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"platform":"ios","token":"fcm:dQw4w9WgXcQ8vN2pL5kR7tY1uI3oP6aS9dF2gH4jK"}'
Responses#
201
The device's id.
{
"id": "dev_01K7DA2B4D6F8H0K2M4P6R8T0V"
}
Response fields
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | required |
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed or a field is invalid (see issues). |
| 400 | unknown_field | The body has a field the endpoint doesn't know (often a typo or snake_case). |
| 401 | unauthorized | No credentials, or the API key or session is invalid or revoked. |
| 403 | forbidden | The caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint). |
| 500 | internal_error | Something went wrong on Logu's side. |