---
title: "Check Authentication"
method: GET
path: "/api/v1/auth/check"
tags: ["auth"]
---

# Check Authentication

`GET /api/v1/auth/check`

Checks if the user is authenticated and returns user info if they are.

Does not require authentication - returns null if no valid token is provided.
Falls back to email lookup if Firebase UID doesn't match database ID.
When found via email fallback, updates the user's database ID to match the new
Firebase-derived ID to prevent future mismatches.

## Response `200`

Successful Response

- UserProfile — Data Transfer Object for database User entity. This represents a user stored in the database with enrichment credits, distinct from the Firebase User model used for authentication.
  - `id` string, uuid, required
  - `email` string, email, required
  - `username` string, required
  - `display_name` string, nullable
  - `workspace_name` string, nullable
  - `role` string, nullable
  - `avatar_color` string, nullable
  - `has_completed_onboarding` boolean
  - `plan_type` 'beta' — Available user plan types with different feature restrictions.
  - `allowed_geographies` string[]
  - `available_enrichment_credits` integer, required
  - `used_enrichment_credits` integer, required
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable
  - `last_active_at` string, date-time, nullable
  - `is_internal` boolean
  - `is_suspended` boolean
  - `workspace_id` string, uuid, required
  - `workspace_role` 'writer' | 'reader' — Role within a workspace determining permission level. WRITER = can edit workspace_write projects READER = can only view workspace projects
  - `is_workspace_admin` boolean
  - `workspace_member_count` integer
  - `column_preferences` object, nullable
  - `feature_toggles` object
  - `terms_acceptance_required` boolean
  - `terms_version` string
  - `terms_url` string
  - `plan` Plan, required — Plan configuration including type and limits.
    - `type` 'beta', required — Available user plan types with different feature restrictions.
    - `max_features_per_layer` integer, required
    - `max_layers_per_project` integer, required
    - `default_enrichment_credits` integer, required
  - `available_geographies` string[], required — Get FIPS codes of counties this user can query. Sourced from `workspace_counties` (rows with load_status='succeeded') via `enrich_profile_with_workspace_data` — see MAIA-1562. Empty list means the user's workspace has no counties loaded yet.

---

[API](https://skmtc.net/maia-analytics/apis/maia-api.md) · [All operations](https://skmtc.net/maia-analytics/apis/maia-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maia-analytics/maia-api/versions/ba2b8d962161/schema)
