> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hq.zone/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the signed-in user

> The caller's own self-view, scoped to their identity: an identity block
(display name, email, locale, timezone, admin/bot flags, connected-workspace
source, profile-consent state, and clock/timezone display preferences), an
optional persona block summarizing the user's distilled profile (`null` if
not yet generated), quick counts such as the number of schedules owned, the
workspace onboarding state, and an `out_of_credits` flag indicating whether
the workspace has run out of credits.



## OpenAPI

````yaml GET /v1/api/me
openapi: 3.1.0
info:
  title: HQ API
  description: >-
    Public HTTP API for HQ. Authenticate with a Personal Access Token
    (`Authorization: Bearer hq_pat_...`) for server-side integrations, or an
    OAuth 2.1 authorization-code + PKCE flow for browser apps acting on a user's
    behalf. Both grant from the same resource:action scope vocabulary; an
    endpoint's required scope is listed under its `security`.
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  version: 1.0.0
servers:
  - url: https://api.hq.zone
    description: HQ API (production)
security: []
tags:
  - name: me
    description: The signed-in user's own account
  - name: conversations
    description: Conversations and their messages
  - name: documents
    description: The content-addressed documents library
  - name: schedules
    description: Scheduled prompts and recurring tasks
  - name: agents
    description: Agents, their skills and integrations
  - name: memory
    description: What the assistant remembers (L5 governance)
  - name: tokens
    description: Personal Access Token management
  - name: billing
    description: Usage and billing
  - name: notifications
    description: In-app notification center
  - name: admin
    description: Workspace administration
  - name: integrations
    description: Workspace integrations (Slack, MCP, skills)
  - name: onboarding
    description: New-workspace onboarding wizard
  - name: auth
    description: Sign-in, sessions, and OAuth
paths:
  /v1/api/me:
    get:
      tags:
        - me
      summary: Get the signed-in user
      description: >-
        The caller's own self-view, scoped to their identity: an identity block

        (display name, email, locale, timezone, admin/bot flags,
        connected-workspace

        source, profile-consent state, and clock/timezone display preferences),
        an

        optional persona block summarizing the user's distilled profile (`null`
        if

        not yet generated), quick counts such as the number of schedules owned,
        the

        workspace onboarding state, and an `out_of_credits` flag indicating
        whether

        the workspace has run out of credits.
      operationId: get_me
      responses:
        '200':
          description: The signed-in user's self-view
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeResp'
      security:
        - bearer_pat: []
        - oauth2: []
components:
  schemas:
    MeResp:
      type: object
      required:
        - identity
        - counts
        - onboarding
        - out_of_credits
        - is_operator
      properties:
        counts:
          $ref: '#/components/schemas/Counts'
        identity:
          $ref: '#/components/schemas/Identity'
        is_operator:
          type: boolean
          description: >-
            True when this caller is an HQ platform operator: an admin of an

            `is_platform` tenant (migration 0182; today `tic`). Drives whether
            the

            SPA shows the `/operator` back-office nav + route. Presentation only
            -

            the real boundary is `platform_admin::require_operator` on
            `/v1/admin/*`.
        onboarding:
          $ref: '#/components/schemas/OnboardingBlock'
          description: |-
            Onboarding v2 state (docs/onboarding-v2.md). The web-ui router reads
            this to enforce the hard gate client-side - the same state the API
            enforces as a 409 - so `/me` is the single source of truth.
        out_of_credits:
          type: boolean
          description: >-
            True when the workspace is out of HQ credits. The SPA mirrors the
            API's

            402 hard-block by disabling the New-thread / New-ask actions +
            composer

            and showing an "upgrade to continue" prompt. Presentation only - the

            real boundary is the 402 on the create + send endpoints.
        persona:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Persona'
    Counts:
      type: object
      required:
        - schedules_owned
      properties:
        schedules_owned:
          type: integer
          format: int64
    Identity:
      type: object
      required:
        - user_id
        - external_user_id
        - tenant_slug
        - source_kind
        - slack_connected
        - teams_connected
        - default_locale
        - is_admin
        - is_bot
        - profile_consent
        - time_format
        - time_zone
        - discovered_at
        - profile_editable
      properties:
        avatar_url:
          type:
            - string
            - 'null'
          description: >-
            Profile avatar. Always an internal
            `/v1/api/artifacts/{uuid}/download`

            URL (the schema CHECK constraint refuses anything else) or

            null if no avatar is on file yet. The SPA can render with

            the same cookie auth that loaded the page; the browser never

            hits a third-party host.
        default_locale:
          type: string
          description: >-
            Workspace-wide default UI language (tenants.default_locale, default
            'en').

            The SPA's locale chain is `locale ?? default_locale ?? 'en'`, so
            this is

            the fallback for members with no `locale` of their own (e.g. an

            operator-created tenant with no Slack profile to derive one from).
        discovered_at:
          type: string
          format: date-time
        display_name:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        external_user_id:
          type: string
          description: >-
            External id from the connected workspace (Slack `U…`, Teams
            `aad-…`).
        is_admin:
          type: boolean
        is_bot:
          type: boolean
        last_seen_at:
          type:
            - string
            - 'null'
          format: date-time
        locale:
          type:
            - string
            - 'null'
        profile_consent:
          type: string
          description: |-
            `pending` / `granted` / `denied` - tenant-side consent for
            per-user persona distillation.
        profile_editable:
          type: boolean
          description: >-
            True when this user's name / timezone / locale are self-editable:
            only

            `origin = 'email'` users (no Slack/Teams connector to sync those
            from).

            Connector users are read-only here - their profile is managed
            upstream,

            so a local edit would be clobbered by the next sync. Drives both the

            PATCH /v1/api/me gate and the /me UI's editable controls.
        real_name:
          type:
            - string
            - 'null'
        slack_connected:
          type: boolean
          description: >-
            True when THIS tenant has a live (non-revoked) Slack install. Gates

            Slack-channel delivery targets in the SPA (a tenant with no Slack
            must

            not be offered a Slack channel/DM). Mirrors the truth the

            `/v1/api/slack/channels` `connected` flag computes from
            `slack_installs`.
        source_kind:
          type: string
          description: >-
            Source connector kind - `slack` / `teams` / `manual`. This is the

            caller's identity kind IN THIS workspace: a person can be a Slack

            identity in one tenant and an email/manual identity in another (each

            tenant binds its own Slack instance), so this is per-session truth,
            not

            a global "this user uses Slack". Gates Slack-DM delivery targets.
        source_workspace:
          type:
            - string
            - 'null'
          description: Display name of the connected workspace (e.g. "Truespar").
        teams_connected:
          type: boolean
          description: >-
            True when THIS tenant has a live (non-revoked) Microsoft Teams
            install.

            The Teams mirror of `slack_connected`: lets the SPA detect a tenant
            with

            no channel connected (neither Slack nor Teams) and nudge an admin to
            add

            one. Computed from `teams_installs`, exactly as `connect_api`'s
            status

            endpoint does.
        tenant_slug:
          type: string
          description: |-
            Tenant slug the caller is signed in to - the same value
            carried on `X-Hq-Workspace`. Exposed so the SPA can hold
            onto it without parking it in sessionStorage (which doesn't
            survive a direct-navigation download or share link).
        time_format:
          type: string
          description: |-
            Web-UI clock preference (migration 0169): `auto` / `12h` / `24h`.
            `auto` lets the browser locale decide the hour-cycle; the SPA reads
            this to drive its central date/time formatter.
        time_zone:
          type: string
          description: >-
            Web-UI timezone preference (migration 0170): `auto` (browser zone)
            or

            `profile` (render in `tz`). The SPA resolves it against `tz`.
        title:
          type:
            - string
            - 'null'
        tz:
          type:
            - string
            - 'null'
        user_id:
          type: string
          format: uuid
          description: HQ-internal workspace_users.id.
    OnboardingBlock:
      type: object
      required:
        - track
        - unread_notifications
      properties:
        business_domain:
          type:
            - string
            - 'null'
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Non-null once the wizard has completed; null => the hard gate is
            active.
        domain_confirmed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Non-null once the admin confirmed the business domain; null =>
            profiling

            has not been allowed to run yet.
        track:
          type: string
          description: '`slack` / `teams` / `web` - which wizard track the SPA renders.'
        unread_notifications:
          type: integer
          format: int64
          description: Unread in-app notifications for this caller - drives the bell badge.
    Persona:
      type: object
      required:
        - profile
        - generated_at
        - message_count
        - prompt_version
      properties:
        generated_at:
          type: string
          format: date-time
        last_message_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of the latest message included.
        message_count:
          type: integer
          format: int64
          description: How many messages this distillation considered.
        model:
          type:
            - string
            - 'null'
          description: Model that produced the doc (e.g. `claude-haiku-4-5`).
        profile:
          description: |-
            The distilled profile JSON. Shape:
              { topics:[...], style:{tone,length,emoji_rate,punctuation},
                role_summary:"...", active_hours:{start,end,tz},
                top_channels:[...], top_collaborators:[...],
                recurring_themes:[...] }
        prompt_version:
          type: integer
          format: int32
  securitySchemes:
    bearer_pat:
      type: http
      scheme: bearer
      bearerFormat: hq_pat
      description: 'Personal Access Token. Send as `Authorization: Bearer hq_pat_...`.'
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.hq.zone/v1/oauth/authorize
          tokenUrl: https://api.hq.zone/v1/oauth/token
          refreshUrl: https://api.hq.zone/v1/oauth/token
          scopes:
            admin: Administer the workspace (users, settings, integrations)
            agents:read: View the agents in your workspace
            agents:write: Create and configure agents
            billing:read: View usage and billing information
            conversations:read: Read your conversations and their messages
            conversations:write: Start conversations and send messages on your behalf
            documents:read: Read your documents library
            documents:write: Upload and manage documents in your library
            memory:read: Read what the assistant remembers about you
            memory:write: Correct or delete what the assistant remembers
            schedules:read: View your scheduled tasks
            schedules:write: Create and manage scheduled tasks
            tables:read: Read your tables and their rows
            tables:write: Create tables and add, edit, or delete rows

````