---
title: "Terminate an existing session"
method: DELETE
path: "/v1/sessions/{session_id}"
tags: ["Sessions"]
---

# Terminate an existing session

`DELETE /v1/sessions/{session_id}`

Terminate a running Devin session by sending a stop event. This will gracefully
stop the session and prevent further execution.

**Permission Requirements:**
- If the `session-write-only-owner` feature flag is enabled for your organization,
  only the session owner can terminate the session.
- Otherwise, any user in the organization with access to the session can terminate it.

**Status Validation:**
- Cannot terminate a session that has already exited (status: "exit")
- Sessions in other states (running, blocked, suspended) can be terminated

## Path parameters

- `session_id` string, required

## Response `200`

Session terminated successfully

- object
  - `detail` string

## Other responses

- `400` — Bad Request - Session already exited or invalid state
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - Only session owner can terminate (when feature flag enabled)
- `404` — Resource not found
- `500` — Internal Server Error

---

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