---
type: api
title: Favorite a Timeline or Timeline template
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-persistfavoriteroute
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-persistfavoriteroute
products:
  - Kibana
---

# Favorite a Timeline or Timeline template

- Server: `https://{kibana_url}`

## Paths

- `PATCH` `/api/timeline/_favorite`
- `PATCH` `/s/{space_id}/api/timeline/_favorite`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v8/authentication#basicauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Favorite a Timeline or Timeline template for the current user.

## Request Body

`application/json`

The required fields used to favorite a (template) Timeline.

- `templateTimelineId` (string) — required — nullable
- `templateTimelineVersion` (number) — required — nullable
- `timelineId` (string) — required — nullable
- `timelineType` (enum) — required
  The type of Timeline.
  Values: `default`, `template`

## Responses

#### `200`

Indicates the favorite status was successfully updated.

`application/json`

- `data` (object)
  - `persistFavorite` ({})
    - `code` (number) — nullable
    - `favorite` ([] object)
      - `favoriteDate` (number) — nullable
      - `fullName` (string) — nullable
      - `userName` (string) — nullable
    - `message` (string) — nullable
    - `savedObjectId` (string)
    - `templateTimelineId` (string) — nullable
    - `templateTimelineVersion` (number) — nullable
    - `timelineType` (enum)
      The type of Timeline.
      Values: `default`, `template`
    - `version` (string)
#### `403`

Indicates the user does not have the required permissions to persist the favorite status.

`application/json`

- `body` (string)
- `statusCode` (number)
## Code Examples

#### Console

```console
PATCH /api/timeline/_favorite
```

#### curl

```curl
curl -X PATCH "https://{kibana_url}/api/timeline/_favorite"
```

