# List the runbook sessions of a workflow

> Source: https://elaichi.ai/docs/api-reference/workflows/automation/listautomationsessions/

`GET /automation/{id}/session`

Resource: **Workflow** · API: **Workflows**

## Path parameters

- **`id`** _(string, required)_
  Resource id

## Query parameters

- **`status`** _(string)_
  Allowed: `open`, `closed`
- **`q`** _(string)_
  Matches the session key and title. LIKE wildcards are matched literally. Max 200 characters.

## Response body

- **`result`** _(array<object>)_
  - **`session_id`** _(string)_
  - **`automation_id`** _(string)_
  - **`key`** _(string)_
  - **`title`** _(string)_
  - **`generation`** _(integer)_
  - **`status`** _(string)_
    Allowed: `open`, `closed`
  - **`close_reason`** _(string,null)_
    Allowed: `closed_by_user`, `idle`, `null`
  - **`closed_at`** _(string,null)_
  - **`closed_by`** _(string,null)_
  - **`run_count`** _(integer)_
  - **`last_run_id`** _(string,null)_
  - **`last_status`** _(string,null)_
  - **`active_run_id`** _(string,null)_
  - **`queued_runs`** _(integer)_
  - **`participant_count`** _(integer)_
  - **`artifact_count`** _(integer)_
  - **`artifacts_unrecorded`** _(integer)_
  - **`thread`** _(object | null)_
    _One of:_
    - **object**
      - **`kind`** _(unknown)_
      - **`team_id`** _(string)_
      - **`channel_id`** _(string)_
      - **`ts`** _(string)_
      - **`permalink`** _(string,null)_
  - **`created_at`** _(string)_
  - **`last_activity_at`** _(string)_
  - **`participant_preview`** _(object)_
    - **`names`** _(array<string>)_
      At most 3.
    - **`count`** _(integer)_
  - **`can_close`** _(boolean)_
  - **`can_continue`** _(boolean)_
- **`next_cursor`** _(string,null)_
- **`prev_cursor`** _(string,null)_

## Code examples

### curl

```bash
curl -X GET 'https://api.elaichi.ai/automation/<id>/session' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.elaichi.ai/automation/<id>/session', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/automation/<id>/session"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())
```
