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:
| Field | Type | Description |
|---|---|---|
id | string | Unique ULID of the note. |
title | string | Note title. |
body | string | Content in Markdown/Rich Text. |
tags | string[] | Array of labels. |
sourceUrl | string? | Original source if clipped from web. |
Listing Notes
Fetch a paginated list of your notes.
http
GET /notes?limit=20Response
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 })
});
}