> For the complete documentation index, see [llms.txt](https://llmvision.gitbook.io/getting-started/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://llmvision.gitbook.io/getting-started/timeline-api/readme.md).

# Introduction

{% hint style="info" %}
Timeline API is available on v1.6.0 and later.
{% endhint %}

This API reference describes the RESTful API endpoints you can use to interact with the LLM Vision Timeline. All endpoints require authentication.

## Getting Started

### Authentication

The Timeline API uses Home Assistant long-lived tokens for authentication. To create a long-lived token, head to Profile → Security → Create Token and give the token a name. Always store tokens in a secure place as you won’t be able to view it again. Do not share tokens with anyone.

{% stepper %}
{% step %}

### Navigate to Profile → Security&#x20;

In Home Assistant, click you profile in the bottom left corner and navigate to the security tab.
{% endstep %}

{% step %}

### Create Long-lived access token

Click "Create token" and give your token a name.
{% endstep %}

{% step %}

### Store your token

Store your token somewhere safe as you wont be able to see this token again. Never share long-lived access tokens with anyone.
{% endstep %}
{% endstepper %}

Long lived tokens must be provided via [HTTP Bearer authentication](https://swagger.io/docs/specification/v3_0/authentication/bearer-authentication/):

```
Authorization: Bearer HA_LONG_LIVED_TOKEN
```

## Base Path

All endpoints use the following base path:

```yaml
http(s)://<HA_URL>/api/llmvision/timeline
```

## Event Object

Some endpoints return an `event` object or a list of multiple `event` objects.

| Key          | Type                      | Description                                               |
| ------------ | ------------------------- | --------------------------------------------------------- |
| uid          | String                    | A unique id to identify the event                         |
| title        | String                    | The title of the event                                    |
| start        | Unix Timestamp            | Timestamp of event start                                  |
| end          | Unix Timestamp            | Timestamp of event end                                    |
| description  | String                    | Description of the event                                  |
| key\_frame   | String (Path in `/media`) | Snapshot of the event used as preview in Timeline Card    |
| camera\_name | String                    | entity\_id of camera that capture the event               |
| category     | String                    | Category that label belongs to                            |
| label        | String                    | Label to classify events. See labels for possible values. |
