Skip to content

Share Links

Share links let you grant access to a document without requiring the recipient to have a Notebind account. Each link has a permission level and optional expiration.

{
"id": "link-uuid",
"document_id": "doc-uuid",
"created_by": "user-uuid",
"token": "a21e739e4fcf3cc2844e4b23a3b14b14",
"permission": "comment",
"expires_at": null,
"created_at": "2026-03-13T12:00:00.000Z"
}
FieldTypeDescription
idUUIDShare link identifier
document_idUUIDThe shared document
created_byUUIDWho created the link
tokenstring32-character hex token
permissionstring"view", "comment", or "edit"
expires_atISO 8601 or nullWhen the link expires (null = never)
created_atISO 8601When the link was created
PermissionView documentList commentsCreate commentsEdit contentCreate suggestions
viewYesYesNoNoNo
commentYesYesYesNoNo
editYesYesYesYesYes
https://notebind.com/share/{token}

This URL loads the document in a public viewer with controls matching the permission level.


GET /api/documents/:id/share

Returns all share links for a document. Only the document owner can list share links.

Terminal window
curl https://notebind.com/api/documents/DOC_ID/share \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": [
{
"id": "link-uuid",
"token": "a21e739e4fcf3cc2844e4b23a3b14b14",
"permission": "comment",
"expires_at": null,
"created_at": "2026-03-13T12:00:00.000Z"
}
],
"error": null
}

POST /api/documents/:id/share
FieldTypeRequiredDefaultDescription
permissionstringNo"view""view", "comment", or "edit"
expires_atISO 8601NonullWhen the link should expire
Terminal window
curl -X POST https://notebind.com/api/documents/DOC_ID/share \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"permission": "comment"}'
{
"data": {
"id": "link-uuid",
"document_id": "doc-uuid",
"created_by": "user-uuid",
"token": "a21e739e4fcf3cc2844e4b23a3b14b14",
"permission": "comment",
"expires_at": null,
"created_at": "2026-03-13T12:00:00.000Z"
},
"error": null
}
Terminal window
curl -X POST https://notebind.com/api/documents/DOC_ID/share \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"permission": "edit", "expires_at": "2026-04-01T00:00:00.000Z"}'

DELETE /api/documents/:id/share?link_id=LINK_ID

Revokes a share link. Anyone with the token will no longer be able to access the document.

ParameterTypeRequiredDescription
link_idUUIDYesThe share link ID to revoke
Terminal window
curl -X DELETE "https://notebind.com/api/documents/DOC_ID/share?link_id=LINK_ID" \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": { "deleted": true },
"error": null
}

Share tokens can be passed as query parameters to access document endpoints without authentication:

Terminal window
# Read a document
curl "https://notebind.com/api/documents/DOC_ID?share_token=TOKEN"
# List comments
curl "https://notebind.com/api/documents/DOC_ID/comments?share_token=TOKEN"
# Create a comment (requires comment or edit permission)
curl -X POST "https://notebind.com/api/documents/DOC_ID/comments?share_token=COMMENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"body": "Looks great!"}'
# Update content (requires edit permission)
curl -X PATCH "https://notebind.com/api/documents/DOC_ID?share_token=EDIT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content": "Updated content"}'

Expired or revoked tokens return:

{
"data": null,
"error": { "message": "Unauthorized", "code": "UNAUTHORIZED" }
}

StatusCodeDescription
400VALIDATION_ERRORMissing link_id on delete
401UNAUTHORIZEDMissing or invalid credentials
404NOT_FOUNDDocument not found or not owned by you