Skip to content

Suggestions

Suggestions propose replacing a specific text range in a document. The document owner can accept (applying the change) or reject each suggestion.

{
"id": "suggestion-uuid",
"document_id": "doc-uuid",
"author_id": "user-uuid",
"original_text": "Hello World",
"suggested_text": "Greetings World",
"anchor_start": 2,
"anchor_end": 13,
"status": "pending",
"resolved_at": null,
"resolved_by": null,
"created_at": "2026-03-13T12:00:00.000Z",
"updated_at": "2026-03-13T12:00:00.000Z",
"author": {
"id": "user-uuid",
"display_name": "Jane Doe",
"avatar_url": null
}
}
FieldTypeDescription
idUUIDSuggestion identifier
document_idUUIDParent document
author_idUUID or nullSuggestion author (null for anonymous)
original_textstringThe text to be replaced
suggested_textstringThe proposed replacement
anchor_startint or nullCharacter offset start
anchor_endint or nullCharacter offset end
statusstring"pending", "accepted", or "rejected"
resolved_atISO 8601 or nullWhen accepted/rejected
resolved_byUUID or nullWho accepted/rejected
authorobjectEmbedded author profile

GET /api/documents/:id/suggestions

Returns all suggestions on a document, sorted by created_at ascending.

Terminal window
curl https://notebind.com/api/documents/DOC_ID/suggestions \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": [
{
"id": "suggestion-uuid",
"original_text": "Hello World",
"suggested_text": "Greetings World",
"status": "pending",
"author": { "display_name": "Jane", "avatar_url": null },
"created_at": "2026-03-13T12:00:00.000Z"
}
],
"error": null
}

Any share token can list suggestions:

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

POST /api/documents/:id/suggestions
FieldTypeRequiredDescription
original_textstringYesThe text to replace
suggested_textstringYesThe proposed replacement
anchor_startintNoCharacter offset start
anchor_endintNoCharacter offset end
Terminal window
curl -X POST https://notebind.com/api/documents/DOC_ID/suggestions \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"original_text": "Hello World",
"suggested_text": "Greetings World",
"anchor_start": 2,
"anchor_end": 13
}'

Returns the created suggestion with embedded author.

Only edit share tokens can create suggestions:

Terminal window
curl -X POST "https://notebind.com/api/documents/DOC_ID/suggestions?share_token=EDIT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"original_text": "old text", "suggested_text": "new text"}'

GET /api/documents/:id/suggestions/:sid

Returns a single suggestion. Requires document owner or suggestion author access.

Terminal window
curl https://notebind.com/api/documents/DOC_ID/suggestions/SUGGESTION_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY"

PATCH /api/documents/:id/suggestions/:sid
FieldTypeRequiredValues
actionstringYes"accept" or "reject"

When accepted, the original_text is replaced with suggested_text in the document content.

Terminal window
curl -X PATCH https://notebind.com/api/documents/DOC_ID/suggestions/SUGGESTION_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "accept"}'
{
"data": {
"id": "suggestion-uuid",
"status": "accepted",
"resolved_at": "2026-03-13T12:10:00.000Z",
"resolved_by": "user-uuid"
},
"error": null
}
Terminal window
curl -X PATCH https://notebind.com/api/documents/DOC_ID/suggestions/SUGGESTION_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "reject"}'

If the document has been edited since the suggestion was created and the original_text can no longer be found:

{
"data": null,
"error": {
"message": "Original text no longer found in document. The document may have been edited since this suggestion was created.",
"code": "TEXT_NOT_FOUND"
}
}

Status: 409 Conflict


DELETE /api/documents/:id/suggestions/:sid
Terminal window
curl -X DELETE https://notebind.com/api/documents/DOC_ID/suggestions/SUGGESTION_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": { "deleted": true },
"error": null
}
  • Document owner can delete any suggestion
  • Suggestion author can delete their own suggestions

StatusCodeDescription
400VALIDATION_ERRORMissing required fields or invalid action
400ALREADY_RESOLVEDSuggestion already accepted or rejected
401UNAUTHORIZEDMissing or invalid credentials
403FORBIDDENOnly document owner can accept/reject
404NOT_FOUNDSuggestion or document not found
409TEXT_NOT_FOUNDOriginal text no longer in document