> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Close Session • AI Agent SDK

> close_session: Close a session.

# close\_session

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**GatewayProtocol**](../classes/GatewayProtocol) class in the [**protocols**](../modules/protocols) module.

Close a session.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def close_session(session_id: str) -> bool
```

## Parameters

<ParamField query="session_id" type="str" required={true}>
  The session ID to close
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if session was closed, False if not found
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L349">
  `praisonaiagents/gateway/protocols.py` at line 349
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Session Management" icon="clock" href="/docs/concepts/session-management" />

  <Card title="Sessions Feature" icon="folder" href="/docs/features/sessions" />

  <Card title="Session Persistence" icon="database" href="/docs/features/session-persistence" />
</CardGroup>
