---
type: api
title: Add or update a note
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-persistnoteroute
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-persistnoteroute
products:
  - Kibana
---

# Add or update a note

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

## Paths

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

## Description

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

Add a note to a Timeline or update an existing note.

## 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 note to add or update, along with additional metadata.

`application/json`

- `note` (object) — required
  - `created` (number) — optional — nullable
    The time the note was created, using a 13-digit Epoch timestamp.
  - `createdBy` (string) — optional — nullable
    The user who created the note.
  - `updated` (number) — optional — nullable
    The last time the note was updated, using a 13-digit Epoch timestamp
  - `updatedBy` (string) — optional — nullable
    The user who last updated the note
  - `eventId` (string) — optional — nullable
    The `_id` of the associated event for this note.
  - `note` (string) — optional — nullable
    The text of the note
  - `timelineId` (string) — required
    The `savedObjectId` of the Timeline that this note is associated with
- `noteId` (string) — optional — nullable
  The `savedObjectId` of the note
- `version` (string) — optional — nullable
  The version of the note

## Response

Indicates the note was successfully created.

`application/json`

- `data` (object)
  - `persistNote` (object)
    - `code` (number)
    - `message` (string)
    - `note` (object)
      - `created` (number) — nullable
        The time the note was created, using a 13-digit Epoch timestamp.
      - `createdBy` (string) — nullable
        The user who created the note.
      - `updated` (number) — nullable
        The last time the note was updated, using a 13-digit Epoch timestamp
      - `updatedBy` (string) — nullable
        The user who last updated the note
      - `eventId` (string) — nullable
        The `_id` of the associated event for this note.
      - `note` (string) — nullable
        The text of the note
      - `timelineId` (string)
        The `savedObjectId` of the Timeline that this note is associated with
      - `noteId` (string)
        The `savedObjectId` of the note
      - `version` (string)
        The version of the note
## Code examples

#### Console

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

#### curl

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

