Skip to main content
PATCH
/
notes
/
{id}
JavaScript
import Moonbase from '@moonbaseai/sdk';

const client = new Moonbase({
  apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});

const note = await client.notes.update('id', {
  body: { markdown: "# A note title\n\nHere's a note for me! Yay!" },
  lock_version: 0,
});

console.log(note.id);
{
  "id": "1CLJt2vAHeRtXfj4Bq5piD",
  "type": "note",
  "lock_version": 1,
  "body": {
    "markdown": "# A note title\n\nHere's a note for me! Yay!"
  },
  "created_at": "2025-02-17T16:00:00.000Z",
  "updated_at": "2025-02-17T16:00:00.000Z",
  "title": "A note title",
  "creator": {
    "id": "1CLJt2v6pHdDoet4Thyb5M",
    "type": "item",
    "collection": {
      "id": "1CLJt2ubZ7zAZFBxUxeBHo",
      "type": "collection",
      "ref": "people"
    }
  },
  "associations": []
}

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Path Parameters

id
string
required

The ID of the note to update.

Body

application/json

The Note object to update.

lock_version
integer
required

The current lock version of the note for optimistic concurrency control.

body
FormattedText · object
required

The main content of the note.

Response

Successful response.

The Note object represents a block of text content, often used for meeting notes or summaries.

type
string
required

String representing the object’s type. Always note for this object.

Allowed value: "note"
id
string
required

Unique identifier for the object.

lock_version
integer
required

The current lock version of the note for optimistic concurrency control.

body
FormattedText · object
required

The main content of the note.

created_at
string<date-time>
required

Time at which the object was created, as an ISO 8601 timestamp in UTC.

updated_at
string<date-time>
required

Time at which the object was last updated, as an ISO 8601 timestamp in UTC.

associations
Pointer · object[]
required

A list of items, meetings or calls this note is associated with.

title
string

An optional title for the note.

summary
string

A short, system-generated summary of the note's content.

creator
ItemPointer · object

The person that created the note.