Skip to content

Notes API

Notes are the core entities in MuseNotes. You can List, Create, Read, Update, and Delete (CRUD) notes programmatically.

The Note Object

A Note object contains the following fields:

FieldTypeDescription
idstringUnique ULID of the note.
titlestringNote title.
bodystringContent in Markdown/Rich Text.
tagsstring[]Array of labels.
sourceUrlstring?Original source if clipped from web.

Listing Notes

Fetch a paginated list of your notes.

http
GET /notes?limit=20

Response

json
{
  "notes": [ ... ],
  "nextCursor": "01HB..."
}

Creating a Note

Post a JSON object to create a new note. Supports Markdown body.

http
POST /notes
Content-Type: application/json

{
  "title": "My API Note",
  "body": "**Hello** from the API!",
  "labels": ["api", "test"],
  "sourceUrl": "https://example.com"
}

Creating from Automation (Example)

You can use the API to pipe content from other tools directly into MuseNotes.

javascript
// Node.js Example
const createNote = async (title, content) => {
  await fetch('https://notes.nian.me/api/v1/notes', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ title, body: content })
  });
}