## GET /v1/sessions/{id}/download

Download the session transcript.

Required permissions: read:sessions.
API key: Supported.
CLI user token: Supported.
Session token: Requires the ellipsis:api scope, and the session's permissions.ellipsis rules must allow the operation.
Higher permission levels include lower levels: read < write < delete.
Grant match patterns can further restrict access to individual resources.

### Response

```text
{
  "archived_through_feed_seq": int,
  "earliest_feed_seq": int,
  "format": str,
  "has_more": bool,
  "latest_feed_seq": int,
  "segments": [
    {
      "bytes": int,
      "download_url": str,
      "end_feed_seq": int,
      "expires_in": int,
      "record_count": int,
      "start_feed_seq": int
    }
  ],
  "session_id": str
}
```

### Python

```python
import os

from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])

result = client.sessions.download("...")
print(result)
```

### TypeScript

```typescript
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({
  apiKey: process.env.ELLIPSIS_API_TOKEN!,
});

const result = await client.sessions.download('...');
console.log(result);
```

### cURL

```bash
curl "https://api.ellipsis.dev/v1/sessions/{id}/download" \
  -H "Authorization: Bearer $ELLIPSIS_API_TOKEN"
```

### Response schema

```json
{
  "properties": {
    "archived_through_feed_seq": {
      "type": "integer"
    },
    "earliest_feed_seq": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "format": {
      "default": "ellipsis_session_log@1",
      "type": "string"
    },
    "has_more": {
      "type": "boolean"
    },
    "latest_feed_seq": {
      "type": "integer"
    },
    "segments": {
      "items": {
        "properties": {
          "bytes": {
            "type": "integer"
          },
          "download_url": {
            "type": "string"
          },
          "end_feed_seq": {
            "type": "integer"
          },
          "expires_in": {
            "type": "integer"
          },
          "record_count": {
            "type": "integer"
          },
          "start_feed_seq": {
            "type": "integer"
          }
        },
        "required": [
          "start_feed_seq",
          "end_feed_seq",
          "record_count",
          "bytes",
          "download_url",
          "expires_in"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "session_id": {
      "type": "string"
    }
  },
  "required": [
    "session_id",
    "earliest_feed_seq",
    "archived_through_feed_seq",
    "latest_feed_seq",
    "has_more",
    "segments"
  ],
  "type": "object"
}
```
