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

# Current user and workspace memberships



## OpenAPI

````yaml get /api/v1/me
openapi: 3.1.0
info:
  title: PlanSync API
  version: 1.0.0
  description: >
    Customer-facing PlanSync API reference for common integrations.

    Authenticate with a project API key (`x-api-key: psk_…`) on project-scoped
    routes,

    or with a Better Auth session cookie from the signed-in web app.
servers:
  - url: https://api.plansync.dev
    description: Production API origin
  - url: http://localhost:3000
    description: Local app origin (proxied to backend)
security:
  - apiKeyAuth: []
  - cookieAuth: []
tags:
  - name: Health
  - name: Identity
  - name: Workspaces
  - name: Projects
  - name: Files
  - name: Issues
  - name: RFIs
  - name: Punch
  - name: Field Reports
  - name: Proposals
  - name: Operations
  - name: Schedule
  - name: Materials
  - name: Public Portals
  - name: Billing
paths:
  /api/v1/me:
    get:
      tags:
        - Identity
      summary: Current user and workspace memberships
      responses:
        '200':
          description: Current user profile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    MeResponse:
      type: object
      properties:
        user:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            email:
              type: string
              format: email
          required:
            - id
            - name
            - email
        workspaces:
          type: array
          items:
            $ref: '#/components/schemas/Workspace'
      required:
        - user
        - workspaces
    Workspace:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        role:
          type: string
          enum:
            - SUPER_ADMIN
            - ADMIN
            - MEMBER
      required:
        - id
        - name
        - slug
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  responses:
    Unauthorized:
      description: Missing or invalid session
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >
        Project API key (`psk_…`) from Project Settings → API keys.

        Required scopes depend on the route (e.g. `issues:read` for listing
        issues).

        Only works on project-scoped `/api/v1/projects/{projectId}/…` routes.
    cookieAuth:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Better Auth session cookie from a signed-in browser session.

````