Standard Garden API
the Standard Garden API provides programmatic access to your garden’s data, including authentication, notes, and file uploads.
Authentication
All protected endpoints require an API Key. You can find your API Key in the Standard Gate command ::api.
Header: x-api-key: YOUR_KEY
Endpoints
User
GET /me
Returns the currently authenticated user’s profile.
Response:
{
"id": 1,
"email": "[email protected]",
"username": "user",
"tier": "FREE",
"created_at": "2024-01-01T00:00:00.000Z"
}
Notes
POST /notes
Create a new note.
Body: {"content": "Markdown content"}
PUT /notes/:id
Edit a note.
Body: {"content": "Updated content"}
DELETE /notes/:id
Delete a note.
GET /notes/latest
Get the most recently created note.
GET /notes/search?q=query
Search notes by content. Returns a list of matching notes.
GET /notes/random
Get a random note.
Publishing & Uploads
POST /upload
Upload a file (e.g., image) to the Garden’s storage (R2).
Format: multipart/form-data with field file.
Response:
{
"success": true,
"key": "uploads/uuid-filename.jpg",
"url": "/uploads/uuid-filename.jpg"
}
PUT /publish/:slug
Sync or publish a note using a slug/filename as the identifier. This is useful for "one-way sync" from tools like Obsidian.
Body: {"content": "Markdown...", "title": "Optional Title"}
Behavior: Creates or updates the note associated with the slug.
See Also
- Frontmatter Schema Reference – Complete guide to note metadata
- CLI Documentation – Command-line interface reference