> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiIyYWE0MTRjYS1hYThiLTQ3ZTUtYTRlYS05MTEwODY5MmYyMWMiLCJleHAiOjE3NzgyNTg3NzAsImlhdCI6MTc3ODI1ODQ3MH0.rWRb81aC74uV4Cb8rlgJVlntFKB_G20IoIU3bux9DeA
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Current user information

GET https://docs.example.com/api/fern-docs/whoami

Get authentication information for the current user, including their name, email, and roles.

Reference: https://buildwithfern.com/learn/docs/fern-api-reference/whoami

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: mcp-tools
  version: 1.0.0
paths:
  /api/fern-docs/whoami:
    get:
      operationId: whoami
      summary: Current user information
      description: >-
        Get authentication information for the current user, including their
        name, email, and roles.
      tags:
        - ''
      parameters:
        - name: FERN_TOKEN
          in: header
          description: JWT token for this user.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved user information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/whoami_Response_200'
        '400':
          description: Bad request (authentication not accessible in local preview mode)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiRequestBadRequestError'
        '401':
          description: Unauthorized (user not authenticated or invalid/expired token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiRequestUnauthorizedError'
        '500':
          description: >-
            Internal server error (authentication configuration not found or
            server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiRequestInternalServerError'
servers:
  - url: https://docs.example.com
components:
  schemas:
    ApiFernDocsWhoamiGetResponsesContentApplicationJsonSchemaUserInfo:
      type: object
      properties:
        name:
          type: string
          description: User's display name
        email:
          type: string
          description: User's email address
        roles:
          type: array
          items:
            type: string
          description: User's assigned roles
      required:
        - name
        - email
        - roles
      title: ApiFernDocsWhoamiGetResponsesContentApplicationJsonSchemaUserInfo
    whoami_Response_200:
      type: object
      properties:
        fern_token:
          type: string
          description: JWT token for the authenticated user
        user_info:
          $ref: >-
            #/components/schemas/ApiFernDocsWhoamiGetResponsesContentApplicationJsonSchemaUserInfo
      required:
        - fern_token
        - user_info
      title: whoami_Response_200
    WhoamiRequestBadRequestError:
      type: object
      properties:
        error:
          type: string
      title: WhoamiRequestBadRequestError
    WhoamiRequestUnauthorizedError:
      type: object
      properties:
        error:
          type: string
      title: WhoamiRequestUnauthorizedError
    WhoamiRequestInternalServerError:
      type: object
      properties:
        error:
          type: string
      title: WhoamiRequestInternalServerError
  securitySchemes:
    FernToken:
      type: apiKey
      in: header
      name: FERN_TOKEN
      description: JWT token for this user.

```