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

# Get Session

> Look up a single session by phone number, session ID, or session key. At least one query parameter is required.



## OpenAPI

````yaml GET /loglife/sessions
openapi: 3.1.0
info:
  title: LogLife Plugin API
  version: 0.1.0
  description: >-
    HTTP API exposed by the LogLife plugin running inside the OpenClaw gateway.
    All endpoints require Bearer token authentication.
servers:
  - url: http://localhost:18789
    description: Local development
security:
  - bearerAuth: []
paths:
  /loglife/sessions:
    get:
      summary: Get session data
      description: >-
        Look up a single session by phone number, session ID, or session key. At
        least one query parameter is required.
      operationId: getSessions
      parameters:
        - name: phone
          in: query
          schema:
            type: string
          description: >-
            Phone number (e.g. +15551234567). Matches against origin.from in
            sessions.json.
          example: '+15551234567'
        - name: sessionId
          in: query
          schema:
            type: string
          description: Session UUID
        - name: key
          in: query
          schema:
            type: string
          description: Session key (the top-level key in sessions.json)
      responses:
        '200':
          description: Session found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
        '400':
          description: Missing query parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized — missing or invalid API key
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Session:
      type: object
      properties:
        sessionKey:
          type: string
        sessionId:
          type: string
        updatedAt:
          type: number
          description: Unix timestamp (ms)
        abortedLastRun:
          type: boolean
        chatType:
          type: string
        lastChannel:
          type: string
        origin:
          type: object
          properties:
            label:
              type: string
            from:
              type: string
            to:
              type: string
        deliveryContext:
          type: object
          properties:
            channel:
              type: string
            to:
              type: string
        compactionCount:
          type: integer
        inputTokens:
          type: integer
        outputTokens:
          type: integer
        totalTokens:
          type: integer
        model:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The API key configured in openclaw.json under
        plugins.entries.loglife.config.apiKey

````