---
title: "Get CLI session details by ID or code"
method: GET
path: "/api/v3.1/cli/get-session"
tags: ["CLI Authentication", "x-internal"]
---

# Get CLI session details by ID or code

`GET /api/v3.1/cli/get-session`

Retrieves the current state of a CLI session using either the session ID (UUID) or the 6-character code. This endpoint is used by both the CLI client to check if the session has been linked, and by the web interface to display session details before linking.

## Query parameters

- `id` string, required — The CLI session ID or code to check

## Response `200`

CLI session retrieved successfully. Returns full session details including linked account information if available.

- object
  - `id` string, required — The unique identifier for the CLI session
  - `code` string, required — The 6-character hexadecimal code used for CLI login
  - `status` 'pending' | 'linked', required — The current status of the session
  - `expiresAt` string, required — The ISO timestamp when the session expires
  - `account` object, nullable, required — Information about the linked account, if any. Null if the session status is "pending".
    - `id` string, required — The ID of the linked account
    - `email` string, email, required — The email address of the linked account
    - `name` string, required — The display name of the linked account
  - `api_key` string, nullable, required — The API key for the linked account
  - `scope` 'project' | 'user', nullable, required — The key scope for this session

## Other responses

- `400` — Invalid session ID or code format. The ID must be either a valid UUID or a 6-character hexadecimal code.
- `404` — CLI session not found or expired, or the linked user API key has been revoked. Sessions expire after 10 minutes from creation. Re-run the CLI login flow to create a new session.
- `500` — Internal server error. An unexpected error occurred while processing the request.

---

[API](https://skmtc.net/composiohq/apis/composio-platform-api-v3-1.md) · [All operations](https://skmtc.net/composiohq/apis/composio-platform-api-v3-1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/composiohq/composio-platform-api-v3-1/versions/4239836857f8/schema)
