Skip to content

Documents

Documents are the core resource in Notebind. Each document has a title and markdown content.

{
"id": "6240800a-1234-5678-abcd-ef0123456789",
"owner_id": "user-uuid",
"title": "My Document",
"content": "# Hello World\n\nThis is markdown content.",
"created_at": "2026-03-13T12:00:00.000Z",
"updated_at": "2026-03-13T12:00:00.000Z"
}
FieldTypeDescription
idUUIDUnique document identifier
owner_idUUIDID of the user who owns the document
titlestringDocument title (max 500 characters)
contentstringMarkdown content
created_atISO 8601When the document was created
updated_atISO 8601When the document was last modified

GET /api/documents

Returns all documents owned by the authenticated user, sorted by updated_at descending.

ParameterTypeDefaultMaxDescription
limitint50100Number of documents to return
offsetint0-Number of documents to skip
Terminal window
curl https://notebind.com/api/documents?limit=10&offset=0 \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": [
{
"id": "6240800a-...",
"title": "My Document",
"created_at": "2026-03-13T12:00:00.000Z",
"updated_at": "2026-03-13T12:00:00.000Z"
}
],
"error": null
}

POST /api/documents
FieldTypeRequiredDefaultDescription
titlestringNo"Untitled"Document title (max 500 characters)
contentstringNo""Markdown content
Terminal window
curl -X POST https://notebind.com/api/documents \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "My Document", "content": "# Hello\n\nWorld"}'
{
"data": {
"id": "6240800a-...",
"owner_id": "user-uuid",
"title": "My Document",
"content": "# Hello\n\nWorld",
"created_at": "2026-03-13T12:00:00.000Z",
"updated_at": "2026-03-13T12:00:00.000Z"
},
"error": null
}

An empty body {} creates a document with the title “Untitled” and empty content.


GET /api/documents/:id

Returns a single document with full content.

ParameterTypeDescription
idUUIDDocument ID
Terminal window
curl https://notebind.com/api/documents/6240800a-1234-5678-abcd-ef0123456789 \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": {
"id": "6240800a-...",
"owner_id": "user-uuid",
"title": "My Document",
"content": "# Hello\n\nWorld",
"created_at": "2026-03-13T12:00:00.000Z",
"updated_at": "2026-03-13T12:00:00.000Z"
},
"error": null
}

Documents can also be accessed with a share token:

Terminal window
curl "https://notebind.com/api/documents/DOC_ID?share_token=TOKEN"

The response includes an additional permission field indicating the access level:

{
"data": {
"id": "...",
"title": "...",
"content": "...",
"permission": "view"
},
"error": null
}

PATCH /api/documents/:id

Update a document’s title and/or content. Only provided fields are updated.

FieldTypeRequiredDescription
titlestringNoNew title (max 500 characters)
contentstringNoNew markdown content

At least one field must be provided.

Terminal window
curl -X PATCH https://notebind.com/api/documents/DOC_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Updated Title", "content": "# Updated\n\nNew content"}'
{
"data": {
"id": "...",
"owner_id": "...",
"title": "Updated Title",
"content": "# Updated\n\nNew content",
"created_at": "2026-03-13T12:00:00.000Z",
"updated_at": "2026-03-13T12:05:00.000Z"
},
"error": null
}

Edit share tokens can update document content (but not title):

Terminal window
curl -X PATCH "https://notebind.com/api/documents/DOC_ID?share_token=EDIT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content": "Updated via share link"}'

DELETE /api/documents/:id

Permanently deletes a document and all associated comments, suggestions, and share links.

Terminal window
curl -X DELETE https://notebind.com/api/documents/DOC_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": { "deleted": true },
"error": null
}

StatusCodeDescription
400VALIDATION_ERRORTitle too long, no valid fields, or invalid JSON
401UNAUTHORIZEDMissing or invalid authentication
404NOT_FOUNDDocument doesn’t exist or you don’t own it
500DB_ERRORInternal database error