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

# Get caller identity and projects

> Returns who the API key belongs to: their profile, the teams they belong to, and the projects in the workspace the key is scoped to.

**Example:** Read the caller's profile and the projects their key can act on to start a session.

**Usage:** Call this first. It takes no input and returns the project ids you need to scope every other endpoint to a specific project.

**Response:** the caller's profile (name, email, role, teams), the active workspace id, and the projects in that workspace, each with its id, name, and website.



## OpenAPI

````yaml https://mcp.agents.writesonic.com/openapi.json get /api/v1/business/whoami
openapi: 3.1.0
info:
  title: 'hq-backend: Business API'
  description: Public Business API endpoints, authenticated with an API key.
  version: 0.1.0
servers:
  - url: https://api.agents.writesonic.com
security: []
paths:
  /api/v1/business/whoami:
    get:
      tags:
        - business
      summary: Get caller identity and projects
      description: >-
        Returns who the API key belongs to: their profile, the teams they belong
        to, and the projects in the workspace the key is scoped to.


        **Example:** Read the caller's profile and the projects their key can
        act on to start a session.


        **Usage:** Call this first. It takes no input and returns the project
        ids you need to scope every other endpoint to a specific project.


        **Response:** the caller's profile (name, email, role, teams), the
        active workspace id, and the projects in that workspace, each with its
        id, name, and website.
      operationId: whoami_api_v1_business_whoami_get
      parameters:
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Overrides the key's workspace
            title: X-Workspace-Id
          description: Overrides the key's workspace
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    WhoamiResponse:
      properties:
        identity:
          $ref: '#/components/schemas/MeResponse'
        active_workspace_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Active Workspace Id
          description: The user's active workspace, scoping the projects below.
        projects:
          items:
            $ref: '#/components/schemas/ProjectSummary'
          type: array
          title: Projects
          description: >-
            Projects in the active workspace; empty when no workspace is
            resolved.
      type: object
      required:
        - identity
      title: WhoamiResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MeResponse:
      properties:
        id:
          type: string
          title: Id
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Name
        photo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo Url
        role:
          anyOf:
            - $ref: '#/components/schemas/UserRole'
            - type: 'null'
        teams:
          items:
            $ref: '#/components/schemas/TeamSummary'
          type: array
          title: Teams
        classic_tools_enabled:
          type: boolean
          title: Classic Tools Enabled
        subscription:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionInfo'
            - type: 'null'
          deprecated: true
      type: object
      required:
        - id
        - email
        - full_name
        - photo_url
        - role
        - teams
        - classic_tools_enabled
      title: MeResponse
    ProjectSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        owner_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Id
        root_website:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Website
        project_type:
          $ref: '#/components/schemas/ProjectType'
        project_scope:
          $ref: '#/components/schemas/ProjectScope'
        is_default:
          type: boolean
          title: Is Default
        created_date:
          type: string
          format: date-time
          title: Created Date
        updated_date:
          type: string
          format: date-time
          title: Updated Date
        has_access:
          type: boolean
          title: Has Access
          description: >-
            HQ is enabled for this project. False: make no HQ project-scoped
            call. GEO tools are unaffected - keep using them for brand-level
            questions on this project.
      type: object
      required:
        - id
        - name
        - owner_id
        - root_website
        - project_type
        - project_scope
        - is_default
        - created_date
        - updated_date
        - has_access
      title: ProjectSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserRole:
      type: string
      enum:
        - super_admin
        - admin
        - member
      title: UserRole
      description: Preserve lowercase enum names to match the Writesonic DB enum values.
    TeamSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        role:
          anyOf:
            - $ref: '#/components/schemas/RoleLevel'
            - type: string
          title: Role
        plan_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Plan Name
      type: object
      required:
        - id
        - name
        - role
        - plan_name
      title: TeamSummary
    SubscriptionInfo:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        is_active:
          type: boolean
          title: Is Active
        subscription_for:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionTypeEnum'
            - type: 'null'
        is_trial:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Trial
        current_period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Current Period Start
        current_period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Current Period End
        cancel_at_period_end:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Cancel At Period End
        user_seats:
          anyOf:
            - type: integer
            - type: 'null'
          title: User Seats
        plan:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionPlanInfo'
            - type: 'null'
      type: object
      required:
        - id
        - is_active
      title: SubscriptionInfo
    ProjectType:
      type: string
      enum:
        - STANDARD
        - PITCH
      title: ProjectType
      description: >-
        Names mirror the writesonic-backend postgres enum labels — do not
        rename.
    ProjectScope:
      type: string
      enum:
        - domain
        - subdomain
        - exact
        - path
      title: ProjectScope
      description: >-
        Names mirror the writesonic-backend postgres enum labels — do not
        rename.
    RoleLevel:
      type: string
      enum:
        - owner
        - super_admin
        - admin
        - member
      title: RoleLevel
    SubscriptionTypeEnum:
      type: string
      enum:
        - webapp
        - mobile
        - botsonic
      title: SubscriptionTypeEnum
    SubscriptionPlanInfo:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        plan_type:
          anyOf:
            - $ref: '#/components/schemas/PlanTypeEnum'
            - type: 'null'
        interval:
          anyOf:
            - $ref: '#/components/schemas/IntervalEnumV2'
            - type: 'null'
        price:
          anyOf:
            - type: integer
            - type: 'null'
          title: Price
        currency_code:
          anyOf:
            - $ref: '#/components/schemas/CurrencyCodeEnum'
            - type: 'null'
        credits:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credits
        words:
          anyOf:
            - type: integer
            - type: 'null'
          title: Words
        is_unlimited:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Unlimited
      type: object
      required:
        - id
      title: SubscriptionPlanInfo
    PlanTypeEnum:
      type: string
      enum:
        - unlimited_words_plan
        - limited_words_plan
        - unlimited_credits_plan
        - limited_credits_plan
        - hybrid_credits_plan
        - fixed_generations_plan
      title: PlanTypeEnum
    IntervalEnumV2:
      type: string
      enum:
        - monthly
        - annual
        - quarterly
        - semi_annual
      title: IntervalEnumV2
    CurrencyCodeEnum:
      type: string
      enum:
        - USD
        - INR
        - HUF
        - GBP
        - PHP
        - PLN
        - BDT
        - JPY
        - THB
        - KRW
        - QAR
        - SAR
        - SEK
        - KES
        - UAH
        - NGN
        - PKR
        - CZK
        - CRC
        - LKR
        - MAD
        - NOK
        - RON
        - NZD
        - MOP
        - EGP
        - SGD
        - COP
        - BGN
        - MMK
        - MYR
        - CAD
        - EUR
        - TWD
        - RUB
        - HKD
        - DKK
        - RSD
        - AED
        - TRY
        - BOB
        - IDR
        - GHS
        - TZS
        - ILS
        - AUD
        - VND
        - ZAR
        - CLP
        - CHF
        - MXN
        - PEN
        - BRL
        - CNY
      title: CurrencyCodeEnum
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Writesonic API key
      in: header
      name: X-API-Key

````

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