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

# Get the connected account

> Returns the identity behind the access token. Any valid token works; no particular scope is required. Suitable as a connection test.



## OpenAPI

````yaml /api-reference/openapi.json get /whoami
openapi: 3.1.0
info:
  title: Life Note Agent API
  version: 1.0.0
  description: >-
    Read-only HTTP API for connecting AI agents and automation tools (such as
    Zapier) to a user's Life Note account. Authenticate with OAuth 2.0
    authorization code + PKCE (S256) and send the access token as
    `Authorization: Bearer <access_token>`. Journal content is decrypted
    server-side and returned only to the authorizing user's own token.
servers:
  - url: https://mylifenote.ai/api/agent/v1
    description: Production
security: []
tags:
  - name: OAuth
    description: Authorization and token exchange
  - name: Account
  - name: Journal
paths:
  /whoami:
    get:
      tags:
        - Account
      summary: Get the connected account
      description: >-
        Returns the identity behind the access token. Any valid token works; no
        particular scope is required. Suitable as a connection test.
      operationId: whoami
      responses:
        '200':
          description: Token identity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoAmI'
              example:
                user_id: 4821
                email: jane.doe@example.com
                name: Jane Doe
                token_name: Example Client
                client_kind: browser
                scopes:
                  - journal:read
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - oauth2: []
components:
  schemas:
    WhoAmI:
      type: object
      properties:
        user_id:
          type: integer
        email:
          type:
            - string
            - 'null'
          format: email
        name:
          type:
            - string
            - 'null'
        token_name:
          type: string
          description: Name of the connected client as registered.
        client_kind:
          type: string
          enum:
            - cli
            - mcp_stdio
            - mcp_remote
            - browser
          description: '`browser` for OAuth authorization-code tokens.'
        scopes:
          type: array
          items:
            type: string
          description: Sorted.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable code.
        detail:
          type: string
          description: Human-readable detail; not always present.
  responses:
    Unauthorized:
      description: >-
        Missing, malformed, expired or revoked access token. The response
        carries a `WWW-Authenticate: Bearer realm="lifenote",
        resource_metadata="https://mylifenote.ai/.well-known/oauth-protected-resource"`
        header (plus `error="invalid_token"` when a token was sent but
        rejected).
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: Bearer challenge with a pointer to the protected-resource metadata.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: No Authorization header
              value:
                error: missing_token
            invalid:
              summary: Bad, expired or revoked token
              value:
                error: invalid_token
    RateLimited:
      description: >-
        A rate limit was exceeded. No `Retry-After` header is sent. `reason` is
        one of: `per-token per-minute limit exceeded`, `per-token daily limit
        exceeded`, `per-ip per-minute limit exceeded`, `per-user daily limit
        exceeded`.
      content:
        application/json:
          schema:
            type: object
            required:
              - error
              - reason
            properties:
              error:
                type: string
                enum:
                  - rate_limited
              reason:
                type: string
          example:
            error: rate_limited
            reason: per-token per-minute limit exceeded
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.0 authorization code with mandatory PKCE (S256). Public clients;
        no client secret. Send the access token as `Authorization: Bearer
        <access_token>`.
      flows:
        authorizationCode:
          authorizationUrl: https://mylifenote.ai/api/agent/v1/oauth/authorize
          tokenUrl: https://mylifenote.ai/api/agent/v1/oauth/token
          refreshUrl: https://mylifenote.ai/api/agent/v1/oauth/token
          scopes:
            journal:read: Read journal entries and mentor responses, and search them
            chat:read: Read mentor chat conversations and search chat messages

````

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