Skip to content

APIs for Workspace

Create Workspace

http
POST /api/workspace/create

Request Body

ts
type CreateWorkspace = {
  workspace_name: string;
  workspace_team_size: string;
  slug: string;
  file: file;
};

Response

ts
type CreateWorkspaceResponse = {
  success: boolean;
  message: string;
  data: Data;
};

export interface Data {
  workspace_id: string;
  workspace_logo_url: string;
  workspace_name: string;
  workspace_team_size: number;
  slug: string;
}

Get All Workspaces

http
GET /api/workspace/all

Request Body

No body required

Response

ts
type Workspace = {
  success: boolean;
  message: string;
  data: Data[];
};

type Data = {
  workspace_id: string;
  workspace_logo_url: string;
  workspace_name: string;
  workspace_team_size: number;
  slug: string;
  created_at: Date;
  role: string;
};

Get Workspace by Id

http
GET /api/workspace/{workspace_id}

Request Body

No body required

Response

ts
type Workspace = {
  success: boolean;
  message: string;
  data: Data;
};

type Data = {
  workspace_id: string;
  workspace_logo_url: string;
  workspace_name: string;
  workspace_team_size: number;
  slug: string;
  created_at: Date;
};

Update Workspace

http
PUT /api/workspace/{workspace_id}

Request Body

ts
type UpdateWorkspace = {
  workspace_name: string;
  workspace_team_size: string;
  slug: string;
  file: file;
};

Response

ts
type UpdateWorkspaceResponse = {
  success: boolean;
  message: string;
};

Delete Workspace

http
DELETE /api/workspace/{workspace_id}

Request Body

No body required

Response

ts
type DeleteWorkspaceResponse = {
  success: boolean;
  message: string;
};

Add Role of Workspace

http
POST /api/workspace/{workspace_id}/roles

Request Body

ts
type AddRole = {
  owner: string;
  role: string;
};

Response

ts
type AddRoleResponse = {
  success: boolean;
  message: string;
  data: Data;
};

type Data = {
  role_id: string;
  owner: string;
  role: string;
  workspace_id: string;
  position: string;
  team: string;
  timezone: string;
};

Update Role of Workspace

http
PUT /api/workspace/{workspace_id}/roles/{role_id}

Request Body

ts
type UpdateRole = {
  owner?: string;
  role?: string;
};

Response

ts
type UpdateRoleResponse = {
  success: boolean;
  message: string;
  data: Data;
};

type Data = {
  role_id: string;
  owner: string;
  role: string;
  workspace_id: string;
  position: string;
  team: string;
  timezone: string;
};

Remove Role of Workspace

http
DELETE /api/workspace/{workspace_id}/roles/{role_id}

Request Body

No body required

Response

ts
type RemoveRoleResponse = {
  success: boolean;
  message: string;
};

Invite a user to Workspace

http
POST /api/workspace/{workspace_id}/invite

Request Body

ts
type WorkspaceInvite = {
  email: string;
  role: string;
};

Response

ts
type WorkspaceInviteResponse = {
  success: boolean;
  message: string;
};

Respond to an Invitation

http
POST /api/workspace/{workspace_id}/invite

Request Body

ts
type WorkspaceInvitation = {
  status: string;
  inviteId: string;
};

Response

ts
type WorkspaceInvitationResponse = {
  success: boolean;
  message: string;
  data: Data;
};

type Data = {
  invite_id: string;
  workspace_id: string;
  email: string;
  role: string;
  status: string;
  sent_by: string;
  sent_at: Date;
  responded_at: Date;
  position: null;
  team: null;
  timezone: string;
};

Delete an invitation

http
DELETE /api/workspace/{workspace_id}/invite/{invite_id}

Request Body

No body required

Response

ts
type WorkspaceInvitationResponse = {
  success: boolean;
  message: string;
};

Update role of a member in workspace

http
PUT /api/workspace/workspaceId/role

Request Body

ts
type WorkspaceRoleUpdate = {
  owner: string; // here owner means email of the invitee
  role: string;
};

Response

ts
type WorkspaceRoleUpdateResponse = {
  success: boolean;
  message: string;
};

Get All Members of Workspace

http
GET /api/workspace/{workspace_id}/members

Request Body

No body required

Response

ts
type Response = {
  success: boolean;
  message: string;
  data: Data[];
};

type Data = {
  role_id: null | string;
  invite_id: null | string;
  email: string;
  name: string;
  role: string;
  status: null | string;
};

Get all todos of a workspace

http
GET /api/workspace/{workspace_id}/tasks

Request Body

No body required

Response

ts
type Response = {
  success: boolean;
  message: string;
  data: Data[];
};

type Data = {
  id: string;
  project_id: string;
  project_name: string;
  title: string;
  description: string;
  status: string;
  priority: ["low", "medium", "high"];
  due_date: Date;
  comments_count: string;
  assignees: Assignee[];
  created_by: CreatedBy;
  created_at: Date;
};

type Assignee = {
  id: Email;
  name: Name;
  email: Email;
};

type CreatedBy = {
  name: Name;
  email: Email;
};

Get All Activities of Workspace

http
GET /api/workspace/{workspace_id}/activities

Request Body

No body required

Response

ts
type Response = {
  success: boolean;
  message: string;
  data: Data[];
};

type Data = {
  id: string;
  workspace_id: string;
  project_id: null | string;
  user_email: string;
  type: string;
  metadata: Metadata;
  created_at: Date;
  level: number | null;
  name: Name;
  photo: null;
};

type Metadata = {
  task_id?: string;
  task_name?: string;
  task_description?: string;
};

Leave Workspace

http
DELETE api/workspace/:workspaceId/leave

Request Body

No Body required

Response

ts
type Response = {
  success: boolean;
  message: string;
};