---
title: "Get User"
method: GET
path: "/user"
---

# Get User

`GET /user`

Get the user from the database.

If the user does not exist, create it. If the user exists, return the user.

Uses UserToken directly instead of AuthorizedUserDep because first-time
users won't exist in the DB yet — that creation happens here.

Args:
    user_token: JWT token with user identity

Returns:
    UserResponse: The user response object with roles included.

## Query parameters

- `invite_code` string, nullable

## Response `200`

Successful Response

- UserResponse
  - `user` APIApiSchemaUsersUser, required
    - `id` string, required
    - `email` string, required
    - `organization_id` string, nullable, required
    - `roles` string[], nullable
    - `name` string, nullable
    - `slack_user_id` string, nullable
    - `profile_photo_url` string, nullable
    - `default_timezone` string, nullable
    - `time_representation` 'military' | 'standard' — How times are rendered for the user.
    - `agent_custom_instructions` AgentCustomInstructions — A user's hard agent instruction plus the audit for its last edit.
      - `instructions` string, nullable
      - `last_edited_at` string, date-time, nullable
      - `last_edited_by` string, nullable
  - `user_exists` boolean, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/traversal/apis/fastapi.md) · [All operations](https://skmtc.net/traversal/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/traversal/fastapi/revisions/2134ebffd1ef/schema)
