H2O.ai Admin Sessions API

The Admin Sessions API from H2O.ai — 3 operation(s) for admin sessions.

Operations 3

GET /admin/sessions List live sessions #
GET /admin/sessions/stats Get session inventory stats #
DELETE /admin/sessions/{session_id} Revoke a session #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/h2o-ai-admin-sessions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

h2o-ai-admin-sessions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: h2oGPTe REST Admin Sessions API
  description: '# Overview


    Users can easily interact with the h2oGPTe API through its REST API, allowing HTTP requests from any programming language.'
  version: v1.0.0
servers:
- url: https://h2ogpte.genai.h2o.ai/api/v1
security:
- bearerAuth: []
tags:
- name: Admin Sessions
paths:
  /admin/sessions:
    get:
      operationId: list_admin_sessions
      summary: List live sessions
      description: Allows admins to enumerate live sessions stored in Redis. Returns metadata only — never access tokens, refresh tokens, or CSRF values. Pagination is cursor-based; pass back the `next_cursor` from a previous response to continue, or omit to start fresh. Iteration is complete when `next_cursor` is absent.
      tags:
      - Admin Sessions
      parameters:
      - name: cursor
        in: query
        description: Opaque cursor returned by a previous call. Omit on the first call.
        required: false
        schema:
          type: string
      - name: limit
        in: query
        description: Maximum number of sessions to return in this page. Defaults to 100, hard-capped at 500.
        required: false
        schema:
          type: integer
          default: 100
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminSessionsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Caller is not an admin.
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/Unexpected'
  /admin/sessions/stats:
    get:
      operationId: get_admin_sessions_stats
      summary: Get session inventory stats
      description: Returns aggregate counters across all live sessions (total, by transport, anonymous count, Azure exchange-cache count). Result is cached per-process for ~30 seconds; the `cache_age_seconds` field communicates freshness so a polling dashboard can render it.
      tags:
      - Admin Sessions
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminSessionsStatsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Caller is not an admin.
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/Unexpected'
  /admin/sessions/{session_id}:
    delete:
      operationId: revoke_admin_session
      summary: Revoke a session
      description: Force-revokes a live session by ID. Reuses the same revoke path as user-driven sign-out, so peer mux replicas drop their cached copy via pub/sub. DELETE is idempotent — returns 204 whether the session existed or not.
      tags:
      - Admin Sessions
      parameters:
      - name: session_id
        in: path
        description: ID of the session to revoke.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successful operation
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Caller is not an admin.
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/Unexpected'
components:
  schemas:
    AdminSessionItem:
      required:
      - session_id
      - user_id
      - username
      - transport
      - is_anonymous
      - expires_in_seconds
      type: object
      properties:
        session_id:
          description: Unique identifier of the session.
          type: string
        user_id:
          description: ID of the user the session belongs to.
          type: string
        username:
          description: Username of the user the session belongs to.
          type: string
        subject:
          description: OIDC subject claim for the user (when known).
          type: string
        transport:
          description: How the session authenticated. One of `keycloak`, `anonymous`, `spoof`, or `unknown`.
          type: string
          enum:
          - keycloak
          - anonymous
          - spoof
          - unknown
        is_anonymous:
          description: True if the session is for a guest / anonymous user.
          type: boolean
        expires_in_seconds:
          description: Remaining Redis TTL on the session key, in seconds.
          type: integer
          format: int64
        expires_at:
          description: Access-token expiry from the underlying OAuth2 token. Zero for anonymous or spoofed sessions.
          type: string
          format: date-time
    AdminSessionsListResponse:
      required:
      - items
      type: object
      properties:
        items:
          description: Page of session metadata.
          type: array
          items:
            $ref: '#/components/schemas/AdminSessionItem'
        next_cursor:
          description: Opaque cursor for the next page. Absent when iteration is complete.
          type: string
    EndpointError:
      required:
      - code
      - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error message
    AdminSessionsStatsResponse:
      required:
      - total
      - by_transport
      - anonymous_count
      - azure_cache_count
      - computed_at
      - cache_age_seconds
      - session_default_ttl
      type: object
      properties:
        total:
          description: Total number of live sessions.
          type: integer
          format: int64
        by_transport:
          description: Counters partitioned by `transport` (keycloak, anonymous, spoof, unknown).
          type: object
          additionalProperties:
            type: integer
        anonymous_count:
          description: Number of guest / anonymous sessions.
          type: integer
        azure_cache_count:
          description: Number of distinct Azure tokens currently cached for federation exchange. Approximate; not a user count.
          type: integer
          format: int64
        computed_at:
          description: When the cached stats were computed.
          type: string
          format: date-time
        cache_age_seconds:
          description: Wall-clock age of the cached stats, in seconds. Useful for rendering freshness in a polling UI.
          type: integer
          format: int64
        session_default_ttl:
          description: Configured default TTL for session keys (Go duration string, e.g. `168h0m0s`).
          type: string
  responses:
    Unexpected:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EndpointError'
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EndpointError'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EndpointError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Using an API key generated by H2OGPTe