docs/help/contents/inbox-api/getting-started.md
Think of the Inbox API as a private mailbox for your Notesnook account. You give other apps or services a key to drop notes into it, and those notes show up in your Notesnook account the next time you sync — fully encrypted, readable only by you.
You don't need to be a developer to use it. You can use services like Zapier and IFTTT to send data directly to the Inbox API without writing a single line of code. If you do write code, it's a single HTTP POST request.
Some common use cases include:
{{enableInboxAPI}} toggle::: info The PGP keys are validated (round-trip encrypt/decrypt) before being saved.
:::
You create your own API keys — none is generated for you when you turn the Inbox API on. You can hold up to 10 keys at a time and revoke them individually, so each service you connect can have its own.
Each key gets an expiry: {{expiryOneDay}}, {{expiryOneWeek}}, {{expiryOneMonth}} (the default), {{expiryOneYear}}, or {{never}}.
{{createKey}} in the {{viewAPIKeys}} sectionEndpoint: POST https://inbox.notesnook.com/
| Header | Type | Status | Description |
|---|---|---|---|
Content-Type | string | Required | Must be application/json |
Authorization | string | Required | Your inbox API key |
| Field | Type | Status | Description |
|---|---|---|---|
title | string | Required | Note title. Minimum 1 character. |
type | string | Required | Entity type. Currently only "note" is supported. |
source | string | Required | Source identifier (e.g., "zapier", "my-app"). |
version | number | Required | Schema version. Must be 1. |
content | object | Optional | Note content. |
content.type | string | Required (if content provided) | Content format. Currently only "html" is supported. |
content.data | string | Required (if content provided) | HTML content string. |
pinned | boolean | Optional | Pin the note. Default: false. |
favorite | boolean | Optional | Mark as favorite. Default: false. |
readonly | boolean | Optional | Make the note read-only. Default: false. |
archived | boolean | Optional | Archive the note. Default: false. |
notebookIds | string[] | Optional | Array of notebook IDs to assign the note to. |
tagIds | string[] | Optional | Array of tag IDs to apply to the note. |
::: info Notebook & Tag IDs
Notebook and Tag IDs can be found by right clicking on a notebook/tag and selecting {{copyId}}.
:::
content.data is an HTML string, and content.type must be "html" — it is the only content format the Inbox API accepts. There is no "text" or "markdown" type, but you can send plain text with no tags in it at all and it becomes a paragraph.
You don't have to send a fragment. A whole document works too: a <!doctype>, <html>, <head> or <body> wrapper is unwrapped for you and only the body content is kept, so you can pipe an email body or a scraped page straight through.
The HTML is sanitized on your own device, after decryption and before the note is saved. Ordinary document markup survives:
<strong>, <em>, <u>, <s>, <code>, <sub>, <sup>http or https address<iframe> with a safe src, so embeds are not strippedAnything that could run code is removed, and the surrounding text is kept:
<script> tags and their contentsonclick, onerror, onmouseover and the restjavascript: and data: addresses in href and src<object>, <embed> and <base>::: warning Unbalanced tags turn the whole note into a code block Your HTML is checked for balanced tags before anything else. An unclosed or mismatched tag anywhere in the payload is not repaired — the entire string is escaped and stored as one code block, so the note arrives showing your raw markup instead of formatted text. If a note lands looking like source code, that is why. Close every tag before you post.
:::
Notesnook stores the result in its own editor format, so markup is kept to the extent that it maps onto something the editor can represent. Presentational details that have no equivalent — most inline style attributes and layout scaffolding, for example — are dropped, and the text and structure remain.
| Limit | Value |
|---|---|
| Max body size | 10 MB |
| Rate limit | 60 requests per minute per IP |
| Status | Body | Condition |
|---|---|---|
200 OK | { "success": true } | Note successfully encrypted and queued. |
400 Bad Request | { "error": "invalid item", "details": [...] } | Request body failed validation. The details array contains field-level errors. |
401 Unauthorized | { "error": "unauthorized" } | Authorization header is missing. |
403 Forbidden | { "error": "inbox public key not found" } | Inbox is not enabled or no PGP public key is associated with your account. |
429 Too Many Requests | — | Rate limit exceeded. Retry after 1 minute. |
500 Internal Server Error | { "error": "internal server error", "description": "..." } | Unexpected server error. |
curl -X POST https://inbox.notesnook.com/ \
-H "Content-Type: application/json" \
-H "Authorization: <your-inbox-api-key-here>" \
-d '{
"title": "My Important Note",
"type": "note",
"source": "my-app",
"version": 1,
"content": {
"type": "html",
"data": "<h1>Meeting Notes</h1><p>Discussed Q4 roadmap</p>"
},
"favorite": true,
"tagIds": ["67aecf3b9e1398484554bc90"]
}'
This Zap sends every new email you receive in your Gmail inbox to your Notesnook account as a note.
1. Create a new Zap and set up the trigger:
2. Add an action step:
3. Configure the Webhooks action:
| Field | Value |
|---|---|
| URL | https://inbox.notesnook.com/ |
| Payload Type | json |
Data — title | (Gmail) Subject |
Data — type | note |
Data — source | zapier-gmail |
Data — version | 1 |
Data — content__type | html |
Data — content__data | (Gmail) Body HTML |
Headers — Authorization | <your-inbox-api-key> |
::: info
In Zapier's nested JSON syntax, use double underscores (__) to represent nested keys. content__type maps to content.type and content__data maps to content.data in the JSON body.
:::
4. Test and activate the Zap. Zapier will POST a note to your Notesnook inbox for every matching email. The note will appear after your next sync.
This Applet sends any email you forward to your IFTTT trigger address into your Notesnook account as a note.
1. Create a new Applet:
[email protected]). Forward any email there to fire the Applet.2. Then that: choose Webhooks → Make a web request.
3. Configure the Webhooks action:
| Field | Value |
|---|---|
| URL | https://inbox.notesnook.com/ |
| Method | POST |
| Content Type | application/json |
| Additional Headers | Authorization: <your-inbox-api-key> |
| Body | (see below) |
Use the following JSON body template, substituting IFTTT ingredients:
{
"title": "{{Subject}}",
"type": "note",
"source": "ifttt-email",
"version": 1,
"content": {
"type": "html",
"data": "{{BodyHTML}}"
}
}
4. Save the Applet. Any email forwarded to your IFTTT trigger address will be relayed to your Notesnook inbox and appear after the next sync.
Check the self hosting guide here.
Inbox uses OpenPGP asymmetric encryption to ensure your data is encrypted before it ever reaches Notesnook's servers and can only be decrypted on your own devices. The flow is:
When you enable Inbox from settings:
{{never}}. They tell the inbox server which account to deliver the note to. You can create multiple keys (one per service) and revoke them individually without affecting your account.When data is posted to the Inbox API:
alg: pgp-aes256). The result is an armored PGP ciphertext blob.When your client syncs:
Every item the Inbox API processes is recorded, and anything that fails is kept with the reason it failed — a decryption failure, invalid JSON, or a payload that didn't match the schema, with the offending field named.
{{settings}}.{{account}} > Inbox.{{failedInboxItems}}, click {{show}}.You can delete individual entries or clear the whole list. If a service keeps failing, check that type is "note", version is 1, and content.type is "html".
A note that arrives as a code block full of raw markup is not a failure and won't show up in this list — it means the HTML you sent had an unclosed or mismatched tag. See what HTML can I send?.
::: danger Disabling revokes every key
Turning off the Inbox API deletes all your unsynced inbox items and revokes every API key you have created. Any service still posting to your inbox will start getting 401 unauthorized, and you will have to create new keys and update every integration if you turn it back on.
:::