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

# Auth API

> Login, logout, and session management.

## Endpoints

| Method | Path              | Description               |
| ------ | ----------------- | ------------------------- |
| `POST` | `/v1/auth/login`  | Login, set session cookie |
| `POST` | `/v1/auth/logout` | Logout, clear session     |
| `GET`  | `/v1/auth/me`     | Get current user          |

***

## POST /v1/auth/login

```json theme={null}
{
  "email": "you@example.com",
  "password": "your-password"
}
```

**Response `200`** — sets `schedkit_session` HTTP-only cookie

```json theme={null}
{
  "id": 42,
  "email": "you@example.com",
  "name": "Your Name",
  "slug": "yourname",
  "plan": "starter"
}
```

***

## POST /v1/auth/logout

Clears the session cookie. No body required.

**Response `200`**

```json theme={null}
{ "ok": true }
```

***

## GET /v1/auth/me

Returns the currently authenticated user. Works with both cookie and `x-api-key` auth.

**Response `200`**

```json theme={null}
{
  "id": 42,
  "email": "you@example.com",
  "name": "Your Name",
  "slug": "yourname",
  "plan": "starter",
  "timezone": "America/Chicago",
  "created_at": "2026-03-01T00:00:00Z"
}
```

**Response `401`** — not authenticated

```json theme={null}
{ "error": "Unauthorized" }
```
