---
title: "PUT /code-interpreters/{codeInterpreterIdentifier}/sessions/stop#sessionId"
method: PUT
path: "/code-interpreters/{codeInterpreterIdentifier}/sessions/stop#sessionId"
---

# PUT /code-interpreters/{codeInterpreterIdentifier}/sessions/stop#sessionId

`PUT /code-interpreters/{codeInterpreterIdentifier}/sessions/stop#sessionId`

Terminates an active code interpreter session in Amazon Bedrock AgentCore. This operation stops the session, releases associated resources, and makes the session unavailable for further use.

To stop a code interpreter session, you must specify both the code interpreter identifier and the session ID. Once stopped, a session cannot be restarted; you must create a new session using `StartCodeInterpreterSession`.

The following operations are related to `StopCodeInterpreterSession`:

*   [StartCodeInterpreterSession](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StartCodeInterpreterSession.html)
    
*   [GetCodeInterpreterSession](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_GetCodeInterpreterSession.html)

## Path parameters

- `codeInterpreterIdentifier` string, required

## Query parameters

- `sessionId` string, required

## Headers

- `X-Amzn-Trace-Id` string
- `traceparent` string

## Request body

- object
  - `clientToken` string — A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error.

## Response `200`

Success

- StopCodeInterpreterSessionResponse
  - `codeInterpreterIdentifier` string, required — The identifier of the code interpreter.
  - `sessionId` string, required — The identifier of the code interpreter session.
  - `lastUpdatedAt` string, date-time, required — The timestamp when the code interpreter session was last updated.

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — AccessDeniedException
- `482` — ConflictException
- `483` — ValidationException
- `484` — ResourceNotFoundException
- `485` — ThrottlingException
- `486` — InternalServerException

---

[API](https://skmtc.net/aws/apis/bedrock-agentcore.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agentcore/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agentcore/versions/79623b33d495/schema)
