---
title: "Record Login Event"
method: POST
path: "/v1/auth/login-event"
tags: ["Auth"]
---

# Record Login Event

`POST /v1/auth/login-event`

Called by the Meteor app after a login attempt to record the event, track the device, and trigger new-device notifications.

## Request body

- object
  - `userId` string, required — Meteor user ID
  - `loginToken` string — Raw Meteor login token (will be hashed before storage)
  - `hashedLoginToken` string — Pre-hashed login token (already SHA-256 base64, skips hashing)
  - `loginType` 'password' | 'google' | 'apple' | 'facebook' | 'microsoft', required — Authentication method used
  - `ip` string, required — Client IP address
  - `userAgent` string, required — Raw User-Agent header
  - `source` 'web' | 'mobile' | 'api', required — Origin of the login
  - `success` boolean, required — Whether the login attempt succeeded
  - `failureReason` string — Reason for failure (when success is false)

## Response `200`

Default Response

- object
  - `success` boolean, required
  - `sessionId` string — Created session ID (on successful login)
  - `deviceId` string — Device ID
  - `isNewDevice` boolean, required — Whether a new device was detected

## Other responses

- `400` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/bluehive-health/apis/bluehive-api.md) · [All operations](https://skmtc.net/bluehive-health/apis/bluehive-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bluehive-health/bluehive-api/revisions/e6e553c2594a/schema)
