totask Workspace API Documentation
Workspace Routes
All workspace-related endpoints are prefixed with /w
.
Create Workspace
Endpoint: POST /w/create
Description: Creates a new workspace.
Request Body:
{
"name": "Workspace Name",
"description": "Workspace Description"
}
Response:
- 201 Createdjson
{ "_id": "workspace_id", "name": "Workspace Name", "description": "Workspace Description", ... }
Get Workspace
Endpoint: GET /w/:workspaceId
Description: Retrieves a workspace by ID.
Response:
- 200 OKjson
{ "_id": "workspace_id", "name": "Workspace Name", "description": "Workspace Description", ... }
Update Workspace
Endpoint: PUT /w/:workspaceId
Description: Updates a workspace by ID.
Request Body:
{
"name": "New Workspace Name",
"description": "New Workspace Description"
}
Response:
- 200 OKjson
{ "_id": "workspace_id", "name": "New Workspace Name", "description": "New Workspace Description", ... }
Delete Workspace
Endpoint: DELETE /w/:workspaceId
Description: Deletes a workspace by ID.
Response:
- 204 No Content
Get w for User
Endpoint: GET /w/my
Description: Retrieves w for the current user.
Response:
- 200 OKjson
{ "results": [ ... ], "page": 1, "limit": 10, "totalPages": 1, "totalResults": 1 }
Get All w
Endpoint: GET /w/
Description: Retrieves all w.
Response:
- 200 OKjson
{ "results": [ ... ], "page": 1, "limit": 10, "totalPages": 1, "totalResults": 1 }
Add Member to Workspace
Endpoint: POST /w/addUserTo/:workspaceId
Description: Adds a user to a workspace.
Request Body:
{
"userEmail": "user@example.com"
}
Response:
- 200 OKjson
{ "_id": "workspace_id", "name": "Workspace Name", ... }
Remove User from Workspace
Endpoint: PUT /w/removeUserFrom/:workspaceId
Description: Removes a user from a workspace.
Request Body:
{
"userEmail": "user@example.com"
}
Response:
- 200 OKjson
{ "_id": "workspace_id", "name": "Workspace Name", ... }
Get Workspace Members
Endpoint: GET /w/usersOf/:workspaceId
Description: Retrieves members of a workspace.
Response:
- 200 OKjson
{ "results": [ ... ] }
Get Workspace Admins
Endpoint: GET /w/adminsOf/:workspaceId
Description: Retrieves admins of a workspace.
Response:
- 200 OKjson
{ "results": [ ... ] }
Get w as Admin
Endpoint: GET /w/myAdminWorkspaces
Description: Retrieves w where the current user is an admin.
Response:
- 200 OKjson
{ "results": [ ... ] }
Get w as Member
Endpoint: GET /w/myMemberWorkspaces
Description: Retrieves w where the current user is a member but not an admin.
Response:
- 200 OKjson
{ "results": [ ... ] }
Promote Member to Admin
Endpoint: PUT /w/promoteMemberToAdmin
Description: Promotes a member to admin in a workspace.
Request Body:
{
"workspaceId": "workspace_id",
"member": "member_id"
}
Response:
- 200 OKjson
{ "_id": "workspace_id", "name": "Workspace Name", ... }
Remove Workspace Admin
Endpoint: PUT /w/removeWorkspaceAdmin
Description: Removes admin role from a user in a workspace.
Request Body:
{
"workspaceId": "workspace_id",
"member": "member_id"
}
Response:
- 200 OKjson
{ "_id": "workspace_id", "name": "Workspace Name", ... }
Change Member Access
Endpoint: PUT /w/changeAccess/:workspaceId
Description: Changes member access in a workspace.
Request Body:
{
"canMemberAddBoards": true
}
Response:
- 200 OKjson
{ "_id": "workspace_id", "name": "Workspace Name", ... }
Get All Members
Endpoint: GET /w/getAllMembers/:workspaceId
Description: Retrieves all members of a workspace.
Response:
- 200 OKjson
{ "results": [ ... ] }
Check If User Is Admin
Endpoint: GET /w/isUserAdmin/:workspaceId
Description: Checks if the current user is an admin in a workspace.
Response:
- 200 OKjson
true