---
title: "Pause session"
method: POST
path: "/agents/sessions/pause"
tags: ["Agents"]
---

# Pause session

`POST /agents/sessions/pause`

Pauses a session, whether it has started or not. A session that is running stops where it is and hands back the slot it was holding, so the next session in line can start; a session still waiting in line leaves the line. Either way it ends up Paused, and can be picked back up by sending it another message. Pausing a session that is already paused does nothing.

## Request body

- object
  - `sessionId` string, required — The ID of the session, as returned by POST /agents/execute

## Response `200`

The session is paused

- object
  - `sessionId` string, required — The ID of the session, as returned by POST /agents/execute
  - `status` 'Pending' | 'InProgress' | 'Completed' | 'Failed' | 'Paused' | 'WaitingInLine' | 'Sleeping', required — Lifecycle status of the session after the pause
  - `queueId` string, nullable, required — The ID of the queue the session was on, if it was enqueued onto one
  - `pausedSessionCount` integer, required — How many sessions were paused: the session itself plus any child sessions it started

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — The session does not exist. Code: AGENT_SESSION_NOT_FOUND.
- `409` — The session has already finished, so there is nothing to pause. Code: AGENT_SESSION_NOT_PAUSABLE.
- `500` — Internal server error

---

[API](https://skmtc.dev/kaizenautomation/apis/kaizen-api.md) · [All operations](https://skmtc.dev/kaizenautomation/apis/kaizen-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kaizenautomation/kaizen-api/revisions/4aa3664ceff2/schema)
