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

# Get Session By Custom ID

> Retrieve a specific session by its Custom ID.

> [!WARNING]
>
> You are reading the docs of Galtea 5.11. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/session/get-by-custom-id.md).

## Returns

Returns a [Session](https://docs.galtea.ai/v5.11/concepts/product/version/session.md) object.

## Example

```python theme={"system"}
session_by_custom = galtea.sessions.get_by_custom_id(custom_id=custom_session_id, version_id=version_id)
```

## Parameters

**custom\_id** `string` *required*

The Custom ID associated with the session to retrieve.

> [!NOTE]
>
> A custom ID is unique only per version, so a `version_id` or `product_id` anchor is required to resolve it unambiguously.

**version\_id** `string`

The version to look the session up on. Provide this or `product_id` (at least one is required). If both are given, `version_id` wins and `product_id` is ignored.

**product\_id** `string`

The product to search across (any of its versions) when no `version_id` is given. If more than one version has a session with this custom ID, the most recently created one is returned.

## Errors

| Error | Cause |
| - | - |
| `EntityNotFoundException` | The platform holds nothing under the id or name you passed. Import it with `from galtea import EntityNotFoundException`. Read the status from `e.status_code`. When the API answered 404 the SDK raises the subclass `EntityNotFoundHTTPError`, which also derives from `requests.HTTPError` and carries `e.response`, so code catching `requests.HTTPError` keeps working. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.