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

# Auth & Account

> Sign in and manage your own account

## Sign in

<ParamField body="username" type="string" required>Account username</ParamField>
<ParamField body="password" type="string" required>Account password</ParamField>

```bash theme={null}
curl -X POST http://<server>:9014/login \
  -H "Content-Type: application/json" \
  -H "Device-Id: my-device-1" \
  -H "Device-OS: Roku OS" \
  -d '{"username": "you", "password": "your-password"}'
```

<ResponseField name="auth.token" type="string">Bearer token to send on every subsequent request</ResponseField>
<ResponseField name="auth.device_id" type="string">Device ID this session was registered under</ResponseField>

```json theme={null}
{"auth": {"token": "<jwt>", "device_id": "<id>"}}
```

`POST /login`, no auth required

***

## Get current user

```bash theme={null}
curl http://<server>:9014/me -H "Authorization: Bearer <jwt>"
```

```json theme={null}
{
  "user": {
    "id": 1,
    "username": "you",
    "active": true,
    "admin": false,
    "all_libraries_access": true,
    "favorites": [12, 45]
  }
}
```

`GET /me`

***

## Favorite / unfavorite a channel

<ParamField body="channel_id" type="integer" required>Channel to favorite or unfavorite</ParamField>

```bash theme={null}
curl -X POST http://<server>:9014/me/favorite \
  -H "Authorization: Bearer <jwt>" -H "Content-Type: application/json" \
  -d '{"channel_id": 12}'
```

`POST /me/favorite` to add, `DELETE /me/favorite` (same body) to remove.

***

## Change password

<ParamField body="current_password" type="string" required />

<ParamField body="new_password" type="string" required />

`PUT /api/user/me/password`

***

## Upload avatar

`POST /api/user/me/avatar`, multipart/form-data, field `avatar`

***

## Server version

```bash theme={null}
curl http://<server>:9014/api/version
```

```json theme={null}
{"version": "0.9.2"}
```

`GET /api/version`, no auth required


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.