---
title: "Stop a session"
method: POST
path: "/sessions/{id}/stop"
tags: ["Sessions"]
---

# Stop a session

`POST /sessions/{id}/stop`

## Request

- Base URL: `https://api.parley.so/v1`
- URL: `https://api.parley.so/v1/sessions/{id}/stop`
- Auth: HTTP bearer

Stop the assistant and any subagents it started, if they are working. What it has already finished is kept, and messages it hasn't read yet are dropped. Returns the session, which is usually idle by then; if it is still working, get it again in a few seconds. Send a message to continue.

## Path parameters

- `id` string, required: The session ID.

## Response `200`

OK

- object
  - `id` string, required: The session ID.
  - `title` string, nullable, required: The session's title, written by Parley after the first reply unless someone named it, or null until then.
  - `status` 'working' | 'idle', required: working: Parley's assistant is working, a message is waiting for it, or it is waiting on subagents it started in the background. idle: the assistant has stopped and is waiting for the next message.
  - `origin` 'web' | 'word' | 'outlook' | 'automation' | 'api', required: Where the session was started: web (Parley's web app, or an email to Parley's assistant), word or outlook (the add-in), automation (an automation run), or api (the REST API, MCP, or the CLI).
  - `project` ProjectRef, required: The project's type, ID, and name.
    - `type` 'project', required
    - `id` string, required: Its ID.
    - `name` string, required: The project name.
  - `automation` object, nullable, required: The automation's type, ID, and name.
    - `type` 'automation', required
    - `id` string, required: Its ID.
    - `name` string, required: The automation name.
  - `lastRun` object, nullable, required: The assistant's most recent pass over the session's messages, or null before it starts.
    - `status` 'running' | 'completed' | 'interrupted' | 'failed', required: running: in progress. completed: the assistant finished. interrupted: someone stopped it. failed: it ended with an error.
    - `startedAt` string, date-time, required: When the assistant started.
    - `endedAt` string, date-time, nullable, required: When the assistant stopped, or null while it is running.
    - `error` object, nullable, required: Why a failed run failed, or null.
      - `code` string, nullable, required: Machine-readable reason, such as CONTEXT_WINDOW_EXCEEDED, or null.
      - `message` string, required: Human-readable description.
  - `url` string, uri, required: Where to open the session in Parley.
  - `createdAt` string, date-time, required: When the session was started.
  - `updatedAt` string, date-time, required: When the session last changed, such as by a new message.

## Other responses

- `400`: The request was invalid. VALIDATION_FAILED.
- `401`: Missing or invalid credentials. UNAUTHORIZED.
- `403`: You don't have permission. FORBIDDEN.
- `404`: Not found. NOT_FOUND.
- `429`: Too many requests, or a usage limit was reached. TOO_MANY_REQUESTS.

---

[API](https://skmtc.dev/parley/apis/parley-api.md) - [All operations](https://skmtc.dev/parley/apis/parley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/parley/apis/parley-api/revisions/6b78aeee07bc?raw)
