---
title: "Get anonymous device token"
method: POST
path: "/v1/auth/anonymous"
tags: ["Auth"]
---

# Get anonymous device token

`POST /v1/auth/anonymous`

## Request

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

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.

## Request body

- AnonymousAuthRequest
  - `deviceId` string: Optional client-generated device ID
  - `name` string: Optional display name
  - `deviceInfo` object
    - `platform` string: ios, android, web
    - `model` string: Device model
    - `osVersion` string
    - `appVersion` string
  - `refreshToken` string: Active refresh token to resume an existing device session (200 with a null refreshToken). Omit for a new device.

## Response `200`

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

- AuthTokenResponse
  - `accessToken` string: JWT access token (15min expiry)
  - `refreshToken` string, nullable: Refresh token (30 day expiry, single-use). Null when resuming an existing device session — keep the stored token.
  - `expiresIn` integer: Access token TTL in seconds
  - `tokenType` string
  - `device` object
    - `id` string, uuid
    - `deviceFingerprint` string
    - `createdAt` string, date-time

## Other responses

- `201`: New device created — full token pair issued

---

[API](https://skmtc.dev/reqistry/apis/public-apis-mobile-client-api.md) · [All operations](https://skmtc.dev/reqistry/apis/public-apis-mobile-client-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reqistry/apis/public-apis-mobile-client-api/revisions/7f07b9ca718f?raw)
