Auth

Get anonymous device token

Create or resume an anonymous device session. If the device has an active refresh token, returns a new access token without creating a new session (200). Otherwise, creates a new device session with refresh + access tokens (201).

This is the entry point for the Flutter app — no account creation required.

post/v1/auth/anonymous

Request

  • Base URL: http://localhost:4000
  • URL: http://localhost:4000/v1/auth/anonymous
  • Auth: none declared

Request body

deviceIdstring

Optional client-generated device ID

namestring

Optional display name

refreshTokenstring

Active refresh token to resume an existing device session (200 with a null refreshToken). Omit for a new device.

Response

Existing device — tokens re-issued (refreshToken is null)

accessTokenstring

JWT access token (15min expiry)

refreshTokenstring nullable

Refresh token (30 day expiry, single-use). Null when resuming an existing device session — keep the stored token.

expiresIninteger

Access token TTL in seconds

tokenTypestring

Example response

{
  "expiresIn": 900,
  "tokenType": "Bearer"
}

Changes