canonical: https://jentic.com/apis/hjarni.com/hjarni

# Hjarni REST API

The Hjarni REST API reads and writes the same Markdown notes, folders, and tags that its knowledge base shares between people and AI assistants. It searches notes by keyword, writes and revises them, organizes them into nested folders called containers, links related notes, and tracks each note's revision history. Use it to let an agent maintain a durable Markdown knowledge base alongside the people editing it.

## For AI agents

Search, write, and organize Markdown notes in a shared knowledge base: create notes, move them between folders, tag and link them, and read revision history.

## Scope

Does not send email, manage calendars, or run real-time chat. Use for reading and writing Markdown notes, folders, and tags only.

## Capabilities

- Search notes by keyword across the knowledge base
- Write new Markdown notes and revise existing ones
- Organize notes into nested folders and reorder them
- Link related notes together and list a note's linked notes
- Tag notes and merge duplicate tags into one
- Archive, trash, and restore notes and folders
- Read a note's revision history and revert it to an earlier version

## Use cases

### Shared Human-and-Agent Notes

Keep one Markdown knowledge base that both people and an agent read and update, rather than a separate store the agent cannot see. The API searches notes by keyword, returns a note's full content by id, and updates it in place, so an agent can append findings to the same note a person is editing. Research and documentation teams use this to keep a single source of notes current.

Example prompt: Call GET /search to find a note, GET `/notes/{id}` to read it, then PATCH `/notes/{id}` to append the new content.

### Knowledge Base Organization

Sort notes into nested folders and keep tags consistent so a growing knowledge base stays navigable. The API creates folders, called containers, and moves notes between them, and it can merge duplicate tags into a single canonical tag. Teams use this to reorganize a note collection without manual drag-and-drop in the app.

Example prompt: POST /containers to create a folder, then PATCH `/notes/{id}/move` to move each matching note into it.

### Linked Notes and Backlinks

Connect related notes so a knowledge graph forms across the base and backlinks stay discoverable. The API links two notes, lists the notes linked to a given note, and can remove a link when it no longer applies. Writers use this to weave reference notes into a navigable web.

Example prompt: POST `/notes/{id}/link` to connect two notes, then GET `/notes/{id}/linked` to confirm the link was created.

### Agent-Maintained Knowledge Base

An AI agent keeps a Markdown knowledge base current by searching existing notes, reading the relevant ones, and writing a consolidated summary note. Through Jentic the agent discovers the search and note operations, loads their schemas, and chains them without bespoke client code. This lets a research assistant capture and file knowledge directly.

Example prompt: Search Jentic for 'search notes', call GET /search, read candidates with GET `/notes/{id}`, and file a summary with POST /notes.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/search` | Search notes by keyword |
| GET | `/notes` | List notes |
| POST | `/notes` | Create a note |
| GET | `/notes/{id}` | Get a note |
| PATCH | `/notes/{id}` | Update a note |
| POST | `/notes/{id}/link` | Link two notes |
| GET | `/containers` | List folders |
| GET | `/tags` | List tags |

## Key resources

- **Notes** — Search, create, read, update, link, archive, trash, and restore Markdown notes
- **Containers** — List, create, update, and reorder the nested folders that hold notes
- **Tags** — Create, rename, delete, and merge tags and list a tag's notes
- **Revisions** — Read a note's revision history and revert it to an earlier version

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 71 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 83 / 100
  - Developer Experience & Jentic Compatibility: 64 / 100
  - AI-Readiness & Agent Experience: 58 / 100
  - Agent Usability: 94 / 100
  - Security: 60 / 100
  - AI Discoverability: 87 / 100
- **View full report:** https://jentic.com/apis/hjarni.com/hjarni/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Hjarni by hand means handling its bearer auth and reading pagination totals out of the X-Total-Count, X-Page, and X-Per-Page headers yourself. Through Jentic you install once, import Hjarni from the API Directory, store the token once, and your agent calls the note and folder endpoints.
- **Permission scoping:** Hjarni puts the note and folder id in the URL path, such as `/notes/{id}` and `/containers/{id}`, so a rule can pin your agent to read operations like searching and fetching notes. You choose the operations it may call, so destructive ones like moving a note to the Trash are not included unless you add them.
- **Credential handling:** Your Hjarni bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'search notes' or 'create a note in a folder', and Jentic returns the matching Hjarni operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Notion API** — Blocks-and-pages workspace with databases
- **Coda API** — Docs with tables and automations
- **Chroma API** — Vector database for semantic search over note content

## FAQ

### Is there a Hjarni MCP server?

You do not need an MCP server to give your agent the Hjarni knowledge base. Jentic connects it directly from the API Directory: import Hjarni, store your bearer token once, and your agent calls the note, folder, and tag endpoints. Operations are discovered on demand, so no extra server's tool definitions load into the agent's context.

### What authentication does the Hjarni REST API use?

The Hjarni REST API authenticates with a bearer token in the Authorization header, per its OpenAPI spec, and GET /me returns the account and token for a given key. Through Jentic the token is stored encrypted by your own Jentic One instance and injected at call time, so it never enters the agent's prompt or logs.

### Can I search and update notes with the Hjarni REST API?

Yes. GET /search finds notes by keyword, GET `/notes/{id}` returns one note's full Markdown, and PATCH `/notes/{id}` updates it in place. List responses page with page and per_page and report totals in the X-Total-Count, X-Page, and X-Per-Page headers.

### What are the rate limits for the Hjarni REST API?

The Hjarni spec documents a limit of 100 requests per minute per account across all of its tokens, and going over returns 429 with a Retry-After header. Back off for the number of seconds the Retry-After header indicates.

### How do I search notes through Jentic?

Search Jentic with the query 'search notes', load the schema for GET /search, and execute it with your keyword, then read matches with GET `/notes/{id}.` To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the Hjarni REST API?

Yes. Write a rule that allows only GET /search, GET /notes, and GET `/notes/{id}`, so the agent can find and read notes but cannot create, move, or trash them, and every call it makes is logged. Because note ids live in the URL path, you can even confine a read to a single note.
