---
title: "getSession"
---

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

# getSession

Path: agenthold API › sessions

`GET /sessions/{sessionId}`

URL: `/api/v1/sessions/{sessionId}`

## Authentication

Requires one of the following:

- `session`, apiKey, in cookie
- `token`, http bearer, header `Authorization`

## Path parameters

- `sessionId` (`getSession.path.sessionId`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/api/v1/sessions/<sessionId>' \
  --cookie 'agenthold_session=<agenthold_session>'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/sessions/<sessionId>';
const options = {
  method: 'GET',
  headers: {cookie: 'agenthold_session=<agenthold_session>'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/api/v1/sessions/<sessionId>"

headers = {"cookie": "agenthold_session=<agenthold_session>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The session.

#### Example

```json
{
  "id": "string",
  "agentId": "string",
  "origin": {
    "agentId": "string",
    "agentName": "string",
    "sessionId": "string"
  },
  "title": "string",
  "running": true,
  "createdBy": {
    "id": "string",
    "email": "string",
    "name": "string",
    "avatarUrl": "string"
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
```

- `id` (`getSession.response.200.id`; string, required)
- `agentId` (`getSession.response.200.agentId`; string, required)
- `title` (`getSession.response.200.title`; string, required)
- `running` (`getSession.response.200.running`; boolean, required)
- `createdBy` (`getSession.response.200.createdBy`; object, required)
  - `id` (`getSession.response.200.createdBy.id`; string, required)
  - `email` (`getSession.response.200.createdBy.email`; string, required)
  - `name` (`getSession.response.200.createdBy.name`; string, required)
  - `avatarUrl` (`getSession.response.200.createdBy.avatarUrl`; string, required)
- `createdAt` (`getSession.response.200.createdAt`; string, required)
  - format: `date-time`
- `updatedAt` (`getSession.response.200.updatedAt`; string, required)
  - format: `date-time`
- `origin` (`getSession.response.200.origin`; object, optional) — Set when another agent started the session (send_message or ask).
  - `agentId` (`getSession.response.200.origin.agentId`; string, required)
  - `agentName` (`getSession.response.200.origin.agentName`; string, required)
  - `sessionId` (`getSession.response.200.origin.sessionId`; string, required) — The other agent's session that sent the messages.

### 404

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`getSession.response.404.error`; string, required)


Source: https://agenthold.dev/api/sessions/retrieve/index.md
