---
type: api
title: Pin/unpin an event
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-persistpinnedeventroute
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-persistpinnedeventroute
products:
  - Kibana
---

# Pin/unpin an event

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

## Paths

- `PATCH` `/api/pinned_event`
- `PATCH` `/s/{space_id}/api/pinned_event`

- [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.

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

## Request Body

`application/json`

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

- `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 the event was successfully pinned to or unpinned from the Timeline.

`application/json`

- `data` (object)
  - `persistPinnedEventOnTimeline` (union) — nullable
    - **PinnedEvent**
      - `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
      - `code` (number)
      - `message` (string)
    - **object**
## Code Examples

#### Console

```console
PATCH /api/pinned_event
```

#### curl

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

