---
title: "Return the current API session"
method: GET
path: "/current-api-session"
tags: ["Current API Session"]
---

# Return the current API session

`GET /current-api-session`

## Request

- Base URL: `https://demo.ziti.dev/edge/client/v1`
- URL: `https://demo.ziti.dev/edge/client/v1/current-api-session`
- Auth: one of:
  - API key in header `zt-session`
  - OAuth 2
    - Authorization code: `/oidc/authorize`
    - Token URL: `/oidc/token` scopes: `openid`
- TypeScript: <https://skmtc.dev/openziti/apis/ziti-edge-client/docs/current-api-session/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves the API session that was used to issue the current request

## Response `200`

The API session associated with the session used to issue the request

- CurrentApiSessionDetailEnvelope
  - `data` CurrentApiSessionDetail, required: An API Session object for the current API session
    - `_links` object, required: A map of named links
    - `createdAt` string, date-time, required
    - `id` string, required
    - `tags` Tags
    - `updatedAt` string, date-time, required
    - `authQueries` AuthQueryDetail[], required
      - `clientId` string
      - `format` 'numeric' | 'alpha' | 'alphaNumeric'
      - `httpMethod` string
      - `httpUrl` string
      - `id` string
      - `isTotpEnrolled` boolean
      - `maxLength` integer
      - `minLength` integer
      - `provider` 'ziti' | 'url', required
      - `scopes` string[]
      - `typeId` 'MFA' | 'TOTP' | 'EXT-JWT'
    - `authenticatorId` string, required
    - `cachedLastActivityAt` string, date-time
    - `configTypes` string[], required
    - `identity` EntityRef, required: A reference to another resource and links to interact with it
      - `_links` object: A map of named links
      - `entity` string
      - `id` string
      - `name` string
    - `identityId` string, required
    - `improperClientCertChain` boolean
    - `ipAddress` string, required
    - `isCertExtendRequested` boolean
    - `isCertExtendable` boolean, required
    - `isCertKeyRollRequested` boolean
    - `isMfaComplete` boolean, required
    - `isMfaRequired` boolean, required
    - `lastActivityAt` string, date-time
    - `token` string, required
    - `expirationSeconds` integer, required
    - `expiresAt` string, date-time, required
  - `meta` Meta, required
    - `apiEnrollmentVersion` string
    - `apiVersion` string
    - `filterableFields` string[]
    - `pagination` Pagination
      - `limit` number, required
      - `offset` number, required
      - `totalCount` number, required

## Other responses

- `401`: The supplied session does not have the correct access rights to request this resource

## Changes

- **2026-10-14** `f7b51eaafbbb`: 1 breaking
  - the response property `data/allOf[#/components/schemas/apiSessionDetail]/allOf[#/components/schemas/baseEntity]/tags` became nullable for the status `200`
- **2025-11-04** `e8b8c6cc7e72`: 4 info
  - added the optional property `data/allOf[#/components/schemas/apiSessionDetail]/allOf[subschema #2]/authQueries/items/isTotpEnrolled` to the response with the `200` status
  - added the optional property `data/allOf[#/components/schemas/apiSessionDetail]/allOf[subschema #2]/improperClientCertChain` to the response with the `200` status
  - added the optional property `data/allOf[#/components/schemas/apiSessionDetail]/allOf[subschema #2]/isCertExtendRequested` to the response with the `200` status
  - added the optional property `data/allOf[#/components/schemas/apiSessionDetail]/allOf[subschema #2]/isCertKeyRollRequested` to the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/openziti/apis/ziti-edge-client/changes/current-api-session/get.md)

---

[API](https://skmtc.dev/openziti/apis/ziti-edge-client.md) - [All operations](https://skmtc.dev/openziti/apis/ziti-edge-client/llms.txt) - [OpenAPI document](https://skmtc.dev/openziti/apis/ziti-edge-client/revisions/f7b51eaafbbb?raw)
