---
title: "Lists SRA sessions."
method: POST
path: "/list-sra-sessions"
tags: ["Secure Remote Access"]
---

# Lists SRA sessions.

`POST /list-sra-sessions`

## Request

- Base URL: `https://api.akeyless.io`
- URL: `https://api.akeyless.io/list-sra-sessions`
- Auth: none declared

Results are returned newest first, ordered by start time, then by session ID.
Responses contain up to 1000 sessions.

Pagination:
Pass the response's `next_page` value as the `pagination-token` in subsequent
requests to fetch the next page. Pagination is complete when `next_page` is empty.
Sending an empty `pagination-token` retrieves the first page. Filters must remain
identical across paginated requests to maintain cursor validity.

## Request body

- ListSRASessions: listSRASessions is a command that returns the sra sessions the caller is entitled to see
  - `json` boolean: Set output format to JSON
  - `pagination-token` string: Next page reference
  - `resource-type` string[]: session resource type. In case it is empty, all resources type will be returned. options: [mysql, k8s, ssh, mongodb, mssql, postgres, aws, eks, gke, rdp]
  - `status-type` string[]: session status type. In case it is empty, only active sessions will be returned. options: [connecting, connected, failed, completed, terminated]
  - `token` string: Authentication token (see `/auth` and `/configure`)
  - `uid-token` string: The universal identity token, Required only for universal_identity authentication

## Response `200`

listSRASessionsResponse wraps response body.

- ListSraSessionsOutput
  - `allowed_gateways` GatewayNameInfo[]: Gateways whose sessions the caller may see in full. Omitted when the request asks for own sessions only, and when it carries a pagination token
    - `cluster_display_name` string
    - `cluster_name` string
  - `next_page` string: Cursor for the following page, sent back as the pagination token. Empty when the result set is exhausted, so stop when it is empty rather than waiting for the field to disappear
  - `sessions` SraSessionEntryOut[]: The requested page of sessions, newest first by start time then session id
    - `access_id` string
    - `client_type` string
    - `cluster_unique_id` integer
    - `connection_type` string
    - `end_time` string, date-time
    - `error_msg` string
    - `gateway_info` GatewayNameInfo
      - `cluster_display_name` string
      - `cluster_name` string
    - `instance_id` string
    - `secret_name` string
    - `session_id` string
    - `start_time` string, date-time
    - `status` string
    - `target_host` string
    - `target_id` integer
    - `target_name` string
    - `target_type` string
    - `ttl` string
    - `user_identifier` string

## Other responses

- `default`: errorResponse wraps any error to return it as a JSON object with one "error" field.

---

[API](https://skmtc.dev/akeyless/apis/infrastructure-connectivity.md) - [All operations](https://skmtc.dev/akeyless/apis/infrastructure-connectivity/llms.txt) - [OpenAPI document](https://skmtc.dev/akeyless/apis/infrastructure-connectivity/revisions/62dc62fea89d?raw)
