Team Members
The Team Members
controller manages team members within workspaces, including viewing, editing, and deleting team members, as well as handling invitations.

1. View All Team Members
GET /view-team-members/:workspaceId/:id
Request Parameters
- workspaceId: The ID of the workspace.
- id: The ID of the company or operator whose team members are being fetched.
Response
Status | Description |
---|---|
200 OK | Successfully fetched the list of team members in the workspace. |
406 Not Acceptable | Invalid ID provided for either company or operator. |
500 Internal Server Error | Failed to fetch the team members due to an unexpected error. |
Response Object
{
"teamMembers": [
{
"id": "string",
"user_id": "string",
"workspace_id": "string",
"role": "member",
"area": "string",
"email": "string"
}
]
}
2. View Specific Team Member
GET /view-team-member/:workspaceId/:id/:memberId
Request Parameters
- workspaceId: The ID of the workspace.
- id: The ID of the company or operator.
- memberId: The ID of the team member to view.
Response
Status | Description |
---|---|
200 OK | Successfully fetched the specific team member details in the workspace. |
406 Not Acceptable | Invalid ID provided for either company or operator. |
500 Internal Server Error | Failed to fetch the team member details due to an unexpected error. |
Response Object
{
"teamMember": {
"id": "string",
"user_id": "string",
"workspace_id": "string",
"role": "member",
"area": "string",
"email": "string"
}
}
3. Edit Team Member
PUT /edit-team-member/:workspaceId/:id/:memberId
Request Body Parameters
- email: The updated email address of the team member.
- area: The updated area name for the team member.
Response
Status | Description |
---|---|
200 OK | Team member details updated successfully. |
406 Not Acceptable | Invalid ID provided for either company or operator. |
500 Internal Server Error | Failed to update the team member details due to an unexpected error. |
Response Object
{
"message": "Team member edited successfully",
"ok": true,
"member": {
"email": "string",
"area_id": "string",
"updated_at": "string"
}
}
4. Delete Team Member
DELETE /delete-team-member/:workspaceId/:id/:memberId
Request Parameters
- workspaceId: The ID of the workspace.
- id: The ID of the company or operator.
- memberId: The ID of the team member to delete.
Response
Status | Description |
---|---|
200 OK | Team member deleted successfully from the workspace. |
406 Not Acceptable | Invalid ID provided for either company or operator. |
500 Internal Server Error | Failed to delete the team member due to an unexpected error. |
Response Object
{
"message": "Team member deleted successfully",
"ok": true
}
5. View All Invitations

GET /view-invitations/:id
Request Parameters
- id: The ID of the company or operator whose invitations are being fetched.
Response
Status | Description |
---|---|
200 OK | Successfully fetched the list of pending invitations in the workspace. |
406 Not Acceptable | Invalid ID provided for either company or operator. |
500 Internal Server Error | Failed to fetch the invitations due to an unexpected error. |
Response Object
{
"invitations": [
{
"id": "string",
"user_id": "string",
"workspace_id": "string",
"role_name": "member",
"area_name": "string"
}
]
}
6. Delete Invitation
DELETE /delete-invitation/:workspaceId/:id/:invitationId
Request Parameters
- workspaceId: The ID of the workspace.
- id: The ID of the company or operator.
- invitationId: The ID of the invitation to delete.
Response
Status | Description |
---|---|
200 OK | Invitation deleted successfully from the workspace. |
406 Not Acceptable | Invalid ID provided for either company or operator. |
500 Internal Server Error | Failed to delete the invitation due to an unexpected error. |
Response Object
{
"message": "Invitation deleted successfully",
"ok": true
}