LoguDocs
Open Logu

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.

FieldTypeRequiredNotes
platform"ios" | "android" | "web"required
tokenstringrequired20–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
FieldTypeRequiredNotes
idstringrequired

Errors#

Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.

StatusCodeMeaning
400bad_requestThe request is malformed or a field is invalid (see issues).
400unknown_fieldThe body has a field the endpoint doesn't know (often a typo or snake_case).
401unauthorizedNo credentials, or the API key or session is invalid or revoked.
403forbiddenThe caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint).
500internal_errorSomething went wrong on Logu's side.