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

# Get User Context

> Fetches the context of the acting user (the API key's default user, or the `x-client-user` override). Workspace is derived from the key. Pass `?refreshCache=true` to bypass the cached context.



## OpenAPI

````yaml GET /api/v1/mgt/user-context
openapi: 3.1.0
info:
  title: Xenia Team API - User Context
  version: 1.0.0
  description: >-
    Returns the full user context (profile, role, workspace, permissions,
    features, usage limits) for the acting user. Response envelope is produced
    by `handleResponse`.
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/user-context:
    get:
      tags:
        - Users
      summary: Get User Context
      description: >-
        Fetches the context of the acting user (the API key's default user, or
        the `x-client-user` override). Workspace is derived from the key. Pass
        `?refreshCache=true` to bypass the cached context.
      parameters:
        - name: refreshCache
          in: query
          required: false
          description: >-
            When `true`, recomputes the user context instead of returning the
            cached copy.
          schema:
            type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/UserContext'
                  message:
                    type: string
                  extra_meta:
                    type: object
                    properties:
                      token:
                        type: string
              example:
                data:
                  id: dfea8b8a-5b22-4668-b68d-dc641eb3a101
                  fullName: Admin (Karachi)
                  emailId: nihad77@yopmail.com
                  phoneNo: '+923177974971'
                  isVerified: true
                  timezone: Asia/Karachi
                  role:
                    id: b1f0e150-26ee-40f5-bbdd-a47232fef68a
                    title: Owner
                    isActive: true
                    homepage:
                      mobile: DEFAULT
                      web: DEFAULT
                  workspace:
                    id: cb363f7e-c52a-4478-911d-f6a6f791090e
                    name: Acme Facilities
                    timezone: Asia/Karachi
                    currency: USD
                    status: Active
                    subscriptionPlan: Enterprise
                  permissions:
                    CAN_MANAGE_USERS: true
                    CAN_VIEW_TASKS: true
                  features:
                    SUB_LOCATIONS: true
                    CUSTOM_ROLES: true
                  verificationToken: eyJhbGciOiJI...
                message: Login Successfully
                extra_meta:
                  token: eyJhbGciOiJI...
        '401':
          description: Unauthorized - Invalid client credentials
        '500':
          description: Internal Server Error
      security:
        - clientKey: []
          clientSecret: []
components:
  schemas:
    UserContext:
      type: object
      properties:
        id:
          type: string
          format: uuid
        fullName:
          type: string
        emailId:
          type: string
        phoneNo:
          type: string
        isVerified:
          type: boolean
        timezone:
          type: string
        role:
          type: object
          properties:
            id:
              type: string
              format: uuid
            title:
              type: string
            isActive:
              type: boolean
            homepage:
              type: object
        workspace:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            timezone:
              type: string
            currency:
              type: string
            status:
              type: string
            subscriptionPlan:
              type: string
        permissions:
          type: object
          additionalProperties:
            type: boolean
        features:
          type: object
          additionalProperties:
            type: boolean
        verificationToken:
          type: string
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
      description: Client API key for authentication
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: Client secret for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.