---
type: api
title: Pin/unpin an event
description: Pin/unpin an event to/from an existing Timeline.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-persistpinnedeventroute
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-persistpinnedeventroute
products:
  - Kibana
---

# Pin/unpin an event

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

## Paths

- `PATCH` `/api/pinned_event`

## Description

Pin/unpin an event to/from an existing Timeline.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Request body

The pinned event to add or unpin, along with additional metadata.

`application/json`

- `eventId` (string) — required
  The `_id` of the associated event for this pinned event.
- `pinnedEventId` (string) — optional — nullable
  The `savedObjectId` of the pinned event you want to unpin.
- `timelineId` (string) — required
  The `savedObjectId` of the timeline that you want this pinned event unpinned from.

## Response

Indicates a successful call.

`application/json`

One of:
- **{ created, createdBy, updated, … }**
  - `created` (number) — nullable
    The time the pinned event was created, using a 13-digit Epoch timestamp.
  - `createdBy` (string) — nullable
    The user who created the pinned event.
  - `updated` (number) — nullable
    The last time the pinned event was updated, using a 13-digit Epoch timestamp
  - `updatedBy` (string) — nullable
    The user who last updated the pinned event
  - `eventId` (string)
    The `_id` of the associated event for this pinned event.
  - `timelineId` (string)
    The `savedObjectId` of the timeline that this pinned event is associated with
  - `pinnedEventId` (string)
    The `savedObjectId` of this pinned event
  - `version` (string)
    The version of this pinned event
- **{ unpinned }**
  - `unpinned` (boolean)
    Indicates whether the event was successfully unpinned
## Code examples

#### Console

```console
PATCH kbn:/api/pinned_event
{
  "eventId": "d3a1d35a3e84a81b2f8f3859e064c224cdee1b4bc",
  "timelineId": "15c1929b-0af7-42bd-85a8-56e234cc7c4e"
}
```

#### curl

```curl
curl -X PATCH "${KIBANA_URL}/api/pinned_event" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "eventId": "d3a1d35a3e84a81b2f8f3859e064c224cdee1b4bc",
    "timelineId": "15c1929b-0af7-42bd-85a8-56e234cc7c4e"
  }'
```

## Response examples

#### Pinned event saved object

```json
{
  "eventId": "d3a1d35a3e84a81b2f8f3859e064c224cdee1b4bc",
  "pinnedEventId": "10r1929b-0af7-42bd-85a8-56e234f98h2f3",
  "timelineId": "15c1929b-0af7-42bd-85a8-56e234cc7c4e",
  "version": "WzQ2LDFe"
}
```

#### Unpin response

```json
{
  "unpinned": true
}
```

