---
title: "POST /#X-Amz-Target=AmazonAthena.TerminateSession"
method: POST
path: "/#X-Amz-Target=AmazonAthena.TerminateSession"
---

# POST /#X-Amz-Target=AmazonAthena.TerminateSession

`POST /#X-Amz-Target=AmazonAthena.TerminateSession`

Terminates an active session. A <code>TerminateSession</code> call on a session that is already inactive (for example, in a <code>FAILED</code>, <code>TERMINATED</code> or <code>TERMINATING</code> state) succeeds but has no effect. Calculations running in the session when <code>TerminateSession</code> is called are forcefully stopped, but may display as <code>FAILED</code> instead of <code>STOPPED</code>.

## Headers

- `X-Amz-Target` 'AmazonAthena.TerminateSession', required

## Request body

- TerminateSessionRequest
  - `SessionId` string, required — The session ID.

## Response `200`

Success

- TerminateSessionResponse
  - `State` 'CREATING' | 'CREATED' | 'IDLE' | 'BUSY' | 'TERMINATING' | 'TERMINATED' | 'DEGRADED' | 'FAILED' — <p>The state of the session. A description of each state follows.</p> <p> <code>CREATING</code> - The session is being started, including acquiring resources.</p> <p> <code>CREATED</code> - The session has been started.</p> <p> <code>IDLE</code> - The session is able to accept a calculation.</p> <p> <code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p> <p> <code>TERMINATING</code> - The session is in the process of shutting down.</p> <p> <code>TERMINATED</code> - The session and its resources are no longer running.</p> <p> <code>DEGRADED</code> - The session has no healthy coordinators.</p> <p> <code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>

## Other responses

- `480` — InternalServerException
- `481` — InvalidRequestException
- `482` — ResourceNotFoundException

---

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