Skip to content

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:

json
{
  "name": "Workspace Name",
  "description": "Workspace Description"
}

Response:

  • 201 Created
    json
    {
      "_id": "workspace_id",
      "name": "Workspace Name",
      "description": "Workspace Description",
      ...
    }

Get Workspace

Endpoint: GET /w/:workspaceId

Description: Retrieves a workspace by ID.

Response:

  • 200 OK
    json
    {
      "_id": "workspace_id",
      "name": "Workspace Name",
      "description": "Workspace Description",
      ...
    }

Update Workspace

Endpoint: PUT /w/:workspaceId

Description: Updates a workspace by ID.

Request Body:

json
{
  "name": "New Workspace Name",
  "description": "New Workspace Description"
}

Response:

  • 200 OK
    json
    {
      "_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 OK
    json
    {
      "results": [ ... ],
      "page": 1,
      "limit": 10,
      "totalPages": 1,
      "totalResults": 1
    }

Get All w

Endpoint: GET /w/

Description: Retrieves all w.

Response:

  • 200 OK
    json
    {
      "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:

json
{
  "userEmail": "user@example.com"
}

Response:

  • 200 OK
    json
    {
      "_id": "workspace_id",
      "name": "Workspace Name",
      ...
    }

Remove User from Workspace

Endpoint: PUT /w/removeUserFrom/:workspaceId

Description: Removes a user from a workspace.

Request Body:

json
{
  "userEmail": "user@example.com"
}

Response:

  • 200 OK
    json
    {
      "_id": "workspace_id",
      "name": "Workspace Name",
      ...
    }

Get Workspace Members

Endpoint: GET /w/usersOf/:workspaceId

Description: Retrieves members of a workspace.

Response:

  • 200 OK
    json
    {
      "results": [ ... ]
    }

Get Workspace Admins

Endpoint: GET /w/adminsOf/:workspaceId

Description: Retrieves admins of a workspace.

Response:

  • 200 OK
    json
    {
      "results": [ ... ]
    }

Get w as Admin

Endpoint: GET /w/myAdminWorkspaces

Description: Retrieves w where the current user is an admin.

Response:

  • 200 OK
    json
    {
      "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 OK
    json
    {
      "results": [ ... ]
    }

Promote Member to Admin

Endpoint: PUT /w/promoteMemberToAdmin

Description: Promotes a member to admin in a workspace.

Request Body:

json
{
  "workspaceId": "workspace_id",
  "member": "member_id"
}

Response:

  • 200 OK
    json
    {
      "_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:

json
{
  "workspaceId": "workspace_id",
  "member": "member_id"
}

Response:

  • 200 OK
    json
    {
      "_id": "workspace_id",
      "name": "Workspace Name",
      ...
    }

Change Member Access

Endpoint: PUT /w/changeAccess/:workspaceId

Description: Changes member access in a workspace.

Request Body:

json
{
  "canMemberAddBoards": true
}

Response:

  • 200 OK
    json
    {
      "_id": "workspace_id",
      "name": "Workspace Name",
      ...
    }

Get All Members

Endpoint: GET /w/getAllMembers/:workspaceId

Description: Retrieves all members of a workspace.

Response:

  • 200 OK
    json
    {
      "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 OK
    json
    true