Skip to main content

Share Note

Share a note with another user and set their permission level (View or Edit).

Headers

Authorization
string
required
Bearer token for authentication

Body Parameters

notes_id
string
required
The ID of the note to share
sharedWith
object
required
User object to share the note with
sharedWith.id
number
required
ID of the user to share with
permissions
string
required
Permission level for the shared user. Must be either View or Edit

Response

message
string
Success message
data
object
The created shared status object
data.id
number
Unique identifier for the shared status
data.sharedById
number
ID of the user who shared the note
data.sharedWithId
number
ID of the user who received the share
data.noteId
number
ID of the shared note
data.permissions
string
Permission level: “View” or “Edit”
data.sharedAt
string
Timestamp when the note was shared
curl -X POST https://api.noteverse.com/api/notes/shared-statuses \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "notes_id": "123",
    "sharedWith": {
      "id": 42
    },
    "permissions": "View"
  }'

Response Example

{
  "message": "Shared statuses fetched successfully",
  "data": {
    "id": 789,
    "sharedById": 1,
    "sharedWithId": 42,
    "noteId": 123,
    "permissions": "View",
    "sharedAt": "2026-03-03T10:30:00.000Z"
  }
}
The authenticated user (from the Authorization header) is automatically set as the sharedById user.

Error Responses

400 Bad Request - Missing note ID
{
  "error": "Note id is required",
  "statusCode": 400
}
400 Bad Request - Authentication failure
{
  "error": "Error fetching shared statuses",
  "statusCode": 400
}

Get Shared Statuses

Retrieve all sharing information for a specific note, including who has access and their permission levels.

Headers

Authorization
string
required
Bearer token for authentication

Query Parameters

notes_id
string
required
The ID of the note to get sharing information for

Response

message
string
Success message
data
array
Array of shared status objects
data[].id
number
Shared status ID
data[].noteId
number
The note ID
data[].permissions
string
Permission level: “View” or “Edit”
data[].sharedBy
object
User who shared the note
data[].sharedBy.id
number
User ID
data[].sharedBy.email
string
User email
data[].sharedBy.username
string
Username
data[].sharedWith
object
User who received the share
data[].sharedWith.id
number
User ID
data[].sharedWith.email
string
User email
data[].sharedWith.username
string
Username
curl -X GET "https://api.noteverse.com/api/notes/shared-statuses?notes_id=123" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Example

{
  "message": "Shared statuses fetched successfully",
  "data": [
    {
      "id": 789,
      "noteId": 123,
      "permissions": "View",
      "sharedBy": {
        "id": 1,
        "email": "owner@example.com",
        "username": "noteowner"
      },
      "sharedWith": {
        "id": 42,
        "email": "user@example.com",
        "username": "johndoe"
      }
    },
    {
      "id": 790,
      "noteId": 123,
      "permissions": "Edit",
      "sharedBy": {
        "id": 1,
        "email": "owner@example.com",
        "username": "noteowner"
      },
      "sharedWith": {
        "id": 43,
        "email": "collaborator@example.com",
        "username": "janedoe"
      }
    }
  ]
}

Error Responses

400 Bad Request - Missing note ID
{
  "error": "Note id is required",
  "statusCode": 400
}
400 Bad Request - Authentication failure
{
  "error": "Error fetching shared statuses",
  "statusCode": 400
}

Update Sharing Permissions

Update the permission level for an existing shared status.

Headers

Authorization
string
required
Bearer token for authentication

Query Parameters

status_id
string
required
The ID of the shared status to update

Body Parameters

permissions
string
required
New permission level: “View” or “Edit”

Response

message
string
Success message
data
object
Updated shared status object with new permissions
curl -X PATCH "https://api.noteverse.com/api/notes/shared-statuses?status_id=789" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "permissions": "Edit"
  }'

Response Example

{
  "message": "Shared statuses updated successfully",
  "data": {
    "id": 789,
    "sharedById": 1,
    "sharedWithId": 42,
    "noteId": 123,
    "permissions": "Edit",
    "sharedAt": "2026-03-03T10:30:00.000Z"
  }
}

Delete Shared Status

Remove sharing access for a user by deleting the shared status.

Headers

Authorization
string
required
Bearer token for authentication

Query Parameters

status_id
string
required
The ID of the shared status to delete

Response

message
string
Success message
data
object
Deleted shared status object
curl -X DELETE "https://api.noteverse.com/api/notes/shared-statuses?status_id=789" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Example

{
  "message": "Shared statuses deleted successfully",
  "data": {
    "id": 789,
    "sharedById": 1,
    "sharedWithId": 42,
    "noteId": 123,
    "permissions": "View",
    "sharedAt": "2026-03-03T10:30:00.000Z"
  }
}
Deleting a shared status immediately revokes the user’s access to the note. This action cannot be undone.

Permission Types

The sharing system supports two permission levels defined in the Prisma schema:
  • View: User can only view the note content
  • Edit: User can view and modify the note content
These permissions are enforced as an enum type in the database schema.

Build docs developers (and LLMs) love