---
title: "Retrieve session"
method: GET
path: "/sessions/{session_id}"
tags: ["Sessions"]
---

# Retrieve session

`GET /sessions/{session_id}`

Retrieve a session by ID, including its messages, current state, agent metadata, and participants.

## Path parameters

- `session_id` string, required

## Response `200`

The session.

- object
  - `session` object
    - `id` string
    - `agent_id` string
    - `messages` object[]
      - `id` string, nullable
      - `role` string, nullable
      - `content` string, nullable
      - `created_at` string, date-time, nullable
      - `creator_id` string, nullable
      - `parts` object[], nullable
    - `created_at` string, date-time, nullable
    - `state` 'processing' | 'completed' | 'failed' | 'queued' | 'idle', nullable
    - `agent_name` string, nullable
    - `agent_team_id` string, nullable
    - `agent_creator_user_id` string, nullable
    - `agent_icon_url` string, nullable
    - `agent_tools` object[] — Tools available to the agent. Secret references are stripped before being returned.
    - `participants` object — Map of participant user IDs to participant metadata.
    - `creator` object, nullable — Creator of the session. `null` when no creator is recorded.
      - `id` string, nullable
      - `first_name` string, nullable
      - `last_name` string, nullable
      - `email` string, nullable
      - `profile_picture` string, nullable
    - `usage` object — Per-session usage totals. Credit and token counts accumulate as the agent runs and are `null` until the first run records usage.
      - `credit_cost` number, nullable — Total credits consumed by the session, including tool and flow (workflow) credits.
      - `tool_credit_cost` number, nullable — Credits consumed by tool calls.
      - `flow_credit_cost` number, nullable — Credits consumed by workflow (flow) runs invoked by the agent.
      - `input_tokens` integer, nullable — Total input tokens across the session.
      - `output_tokens` integer, nullable — Total output tokens across the session.
  - `queue_position` integer, nullable — Position in the per-agent queue. Populated only when the session is currently queued; otherwise `null`.

## Other responses

- `401` — Unauthorized — missing or invalid API key.
- `403` — Forbidden — the caller does not have read access on the session.
- `404` — Session not found.
- `500` — Internal server error.

---

[API](https://skmtc.dev/gumloop/apis/public-api.md) · [All operations](https://skmtc.dev/gumloop/apis/public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gumloop/public-api/revisions/115f2d6ce387/schema)
