---
title: "Get the current session"
---

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

# Get the current session

Path: Simplcron API › Session

`GET /auth/session`

Read the signed-in user, workspace, project and selected environment.

## Authentication

Requires one of the following:

- `browserSession`, apiKey, in cookie
- `localBrowserSession`, apiKey, in cookie

## Header parameters

- `X-Simplcron-Environment` (`getSession.header.X-Simplcron-Environment`; string, optional) — Environment for a browser session. Bearer keys always use their fixed environment.
  - one of `"production"`, `"development"` · default: `"production"`

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/auth/session' \
  --cookie '__Host-simplcron_session=<__Host-simplcron_session>'
```

### TypeScript

```typescript
const url = '<base-url>/auth/session';
const options = {
  method: 'GET',
  headers: {cookie: '__Host-simplcron_session=<__Host-simplcron_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>/auth/session"

headers = {"cookie": "__Host-simplcron_session=<__Host-simplcron_session>"}

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

print(response.text)
```

## Responses

### 200

Account and selected scope

#### Example

```json
{
  "user": {
    "id": "string",
    "email": "user@example.com"
  },
  "workspace": {
    "id": "string",
    "name": "string"
  },
  "project": {
    "id": "string",
    "name": "string"
  },
  "environment": "production"
}
```

- `user` (`getSession.response.200.user`; object, required)
  - `id` (`getSession.response.200.user.id`; string, required)
  - `email` (`getSession.response.200.user.email`; string, required)
    - format: `email`
- `workspace` (`getSession.response.200.workspace`; object, required)
  - `id` (`getSession.response.200.workspace.id`; string, required)
  - `name` (`getSession.response.200.workspace.name`; string, required)
    - maxLength: `80` · minLength: `1`
- `project` (`getSession.response.200.project`; object, required)
  - `id` (`getSession.response.200.project.id`; string, required)
  - `name` (`getSession.response.200.project.name`; string, required)
    - maxLength: `80` · minLength: `1`
- `environment` (`getSession.response.200.environment`; string, required)
  - one of `"production"`, `"development"`

### 401

Authentication is required

#### Example

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

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

### 403

The credential lacks permission

#### Example

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

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


Source: https://simplcron.dev/docs/api/get-session/index.md
