---
title: "getSession"
method: GET
path: "/v1/files/session"
tags: ["Session"]
---

# getSession

`GET /v1/files/session`

Start a browser session by converting a Bearer token into a server-side cookie.

**Use case:** After calling this endpoint, you can use preview URLs directly in `<img>` tags
without needing to set the Authorization header manually.

**Example flow:**
1. Call this endpoint with your Bearer token: `GET /v1/files/session` with `Authorization: Bearer <token>`
2. The server sets an HTTP-only cookie named `token`
3. Use preview URLs directly: `<img src="https://file.sls.epilot.io/v1/files/{id}/preview" />`

## Response `200`

Session started successfully. A session cookie has been set.

## Other responses

- `401` — Authentication required or invalid credentials

---

[API](https://skmtc.net/epilot/apis/file-api.md) · [All operations](https://skmtc.net/epilot/apis/file-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/epilot/file-api/versions/e4fee5bc1196/schema)
