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

# Whoami

> Returns the authenticated user or API-key workspace context.



## OpenAPI

````yaml /openapi/program.openapi.json get /whoami
openapi: 3.1.0
info:
  title: Questra Program API
  version: 0.0.1
  description: >-
    REST API for the Questra Program product. Browser users authenticate through
    Questra Auth SSO; automation uses workspace-scoped API keys (`Authorization:
    Bearer qpk_live_…`). API keys carry scopes enforced before handlers.
    Outbound webhooks follow Standard Webhooks (at-least-once delivery;
    consumers must be idempotent).
servers:
  - url: /v1
    description: Program API base path
security: []
paths:
  /whoami:
    get:
      tags:
        - Meta
      summary: Whoami
      description: Returns the authenticated user or API-key workspace context.
      responses:
        '200':
          description: Authenticated identity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      security:
        - bearerAuth: []
components:
  schemas:
    WhoamiResponse:
      type: object
      properties:
        service:
          type: string
          example: questra-program
        workspace_id:
          type: string
        workspace_name:
          type: string
        subject:
          type: string
        auth_method:
          type: string
          enum:
            - session
            - api_key
            - placeholder
            - cron
            - ops_agent
        permissions:
          type: array
          items:
            type: string
            enum:
              - '*'
              - meta:read
              - members:read
              - members:write
              - billing:read
              - billing:write
              - privacy:read
              - privacy:write
              - integrations_settings:read
              - integrations_settings:write
              - programming_settings:read
              - programming_settings:write
              - api_keys:read
              - api_keys:write
              - webhooks:read
              - webhooks:write
              - surveys:read
              - surveys:write
              - surveys:share
              - integrations:read
              - integrations:write
              - workflows:read
              - workflows:write
        scopes:
          type: array
          items:
            type: string
            enum:
              - '*'
              - meta:read
              - members:read
              - members:write
              - billing:read
              - billing:write
              - privacy:read
              - privacy:write
              - integrations_settings:read
              - integrations_settings:write
              - programming_settings:read
              - programming_settings:write
              - api_keys:read
              - api_keys:write
              - webhooks:read
              - webhooks:write
              - surveys:read
              - surveys:write
              - surveys:share
              - integrations:read
              - integrations:write
              - workflows:read
              - workflows:write
        survey_access_mode:
          type: string
          enum:
            - all
            - granted
        email:
          type: string
          format: email
        name:
          type: string
        workspace_role:
          type: string
        features:
          $ref: '#/components/schemas/ProgramFeatures'
      required:
        - service
        - workspace_id
        - subject
        - auth_method
        - permissions
        - scopes
        - survey_access_mode
        - features
    ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        resource:
          type: string
        slug:
          type: string
        file_id:
          type: string
        endpoint_id:
          type: string
        event_id:
          type: string
        delivery_id:
          type: string
        api_key_id:
          type: string
        integration_id:
          type: string
        audit_id:
          type: string
        status:
          type: string
        details: {}
        question_ids:
          type: array
          items:
            type: string
        survey_ids:
          type: array
          items:
            type: string
        revisions:
          type: array
          items:
            type: number
      required:
        - error
    ProgramFeatures:
      type: object
      properties:
        publish_target:
          type: boolean
        regressions:
          type: boolean
      required:
        - publish_target
        - regressions
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Questra Program session token or workspace API key (`qpk_live_…`)

````