Workspace Sharing
Send an invitation to a user to join a workspace with specified permissions. Only workspace owners can send invitations.
The workspace ID
Permission level for the invited user
read
Possible values: Invitation sent successfully
Bad Request - Invalid input, disposable email, or user already has access
Forbidden - Only workspace owner can invite users
Workspace not found
Internal server error
POST /api/v2/workspaces/{workspaceId}/invite HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 56
{
"invitedEmail": "[email protected]",
"permissions": "read"
}
{
"message": "Invitation sent successfully",
"invitationId": "123e4567-e89b-12d3-a456-426614174000",
"invitedEmail": "[email protected]"
}
Accept or reject a pending workspace invitation. The invitation must be for the authenticated user.
The invitation ID
Whether to accept or reject the invitation
Email address of the user responding to the invitation
[email protected]
Invitation response processed successfully
Bad Request - Invitation expired, already processed, or invalid status
Forbidden - Invitation is not for this user
Invitation not found
Internal server error
POST /api/v2/workspaceInvitations/{invitationId} HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"status": "accepted",
"userEmail": "[email protected]"
}
{
"message": "Invitation accepted successfully"
}
Update the expiration date of a pending workspace invitation. Only the inviter or workspace owner can update expiration.
The invitation ID
New expiration date for the invitation
2024-12-31T23:59:59.000Z
Invitation expiration updated successfully
Bad Request - Invalid date format
Forbidden - Only inviter or workspace owner can update expiration
Invitation or workspace not found
Internal server error
POST /api/v2/workspaceInvitations/{invitationId}/expiration HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 45
{
"expirationDate": "2024-12-31T23:59:59.000Z"
}
{
"message": "Invitation expiration updated successfully",
"invitationId": "123e4567-e89b-12d3-a456-426614174000",
"expiresAt": "2025-10-19T12:44:28.178Z"
}
Remove a shared user's access to a workspace. Only workspace owners can remove users.
The workspace ID
The user ID to remove from workspace
User removed from workspace successfully
Forbidden - Only workspace owner can remove users
Workspace not found or user already removed
Internal server error
POST /api/v2/workspaces/{workspaceId}/sharedUsers/{userId}/remove HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
"message": "User removed from workspace successfully",
"userId": "text",
"workspace": "123e4567-e89b-12d3-a456-426614174000"
}
Update the permission level of a shared user in a workspace. Only workspace owners can update permissions.
The workspace ID
The user ID whose permissions to update
New permission level for the user
write
Possible values: Permissions updated successfully
Bad Request - Invalid permissions
Forbidden - Only workspace owner can update permissions
Workspace not found or user does not have access
Internal server error
POST /api/v2/workspaces/{workspaceId}/sharedUsers/{userId} HTTP/1.1
Host: api-dev.jsmon.sh
Content-Type: application/json
Accept: */*
Content-Length: 23
{
"permissions": "write"
}
{
"message": "Permissions updated successfully",
"userId": "text",
"workspace": "123e4567-e89b-12d3-a456-426614174000",
"permissions": "read"
}
Get a list of all users who have access to the workspace along with their permissions.
The workspace ID
Successfully retrieved shared users list
Forbidden - No access to this workspace
Workspace not found
Internal server error
GET /api/v2/workspaces/{workspaceId}/sharedUsers HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
"workspaceId": "123e4567-e89b-12d3-a456-426614174000",
"sharedUsers": [
{
"userId": "user123",
"name": "John Doe",
"email": "[email protected]",
"permissions": "write",
"addedAt": "2024-01-15T10:30:00Z"
}
]
}
Get a list of all pending invitations for a workspace. Workspace owners can see all invitations, other users can only see invitations they sent.
The workspace ID
Successfully retrieved pending invitations
Forbidden - No access to this workspace
Workspace not found
Internal server error
POST /api/v2/workspaces/{workspaceId}/pendingInvitations HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
"workspaceId": "123e4567-e89b-12d3-a456-426614174000",
"pendingInvitations": [
{
"invitationId": "456e7890-e89b-12d3-a456-426614174000",
"inviterId": "user123",
"inviterName": "Jane Smith",
"invitedEmail": "[email protected]",
"status": "pending",
"permissions": "read",
"expiresAt": "2024-02-15T23:59:59Z",
"createdAt": "2024-01-15T10:30:00Z"
}
]
}
Resend an invitation email for a pending workspace invitation. Only the original inviter or workspace owner can resend invitations.
The invitation ID to resend
Invitation resent successfully
Bad Request - Invitation already processed
Forbidden - Only inviter or workspace owner can resend
Invitation not found
Internal server error
POST /api/v2/workspaceInvitations/{invitationId}/resend HTTP/1.1
Host: api-dev.jsmon.sh
Accept: */*
{
"message": "Invitation resent successfully",
"invitationId": "123e4567-e89b-12d3-a456-426614174000",
"invitedEmail": "[email protected]"
}