Workspaces Methods

Method Name Method Type Description
get_workspaces() Getter Retrieves all workspaces.
create_workspace(name, kind, description) Setter Creates a new workspace.
add_users_to_workspace(workspace_id, user_ids, kind) Setter Adds users to a workspace.
delete_workspace(workspace_id) Deleter Deletes a workspace.
delete_users_from_workspace(workspace_id, user_ids) Deleter Removes users from a workspace.
add_teams_to_workspace(workspace_id, team_ids, kind) Setter Adds teams to a workspace.
update_workspace(workspace_id, name, description) Setter Updates workspace attributes.
delete_teams_from_workspace(workspace_id, team_ids) Deleter Removes teams from a workspace.

Method Details

get_workspaces()

get_workspaces()

Description: Retrieves all workspaces.

Returns: List of dictionaries containing workspace details. Returns None or an error message on API failure.

Example:

workspaces = monday.workspaces.get_workspaces()

create_workspace()

create_workspace(name, kind, description)

Description: Creates a new workspace.

Arguments:

  • name (str): The name of the new workspace.
  • kind (str): The type of workspace ('open' or 'closed'). Default is 'open'.
  • description (str): Optional description of the workspace.

Returns: UUID of the newly created workspace. Returns None or an error message on API failure.

Example:

new_workspace = monday.workspaces.create_workspace(name="Project Workspace", 
                                                   kind="open", 
                                                   description="A workspace for projects")

add_users_to_workspace()

add_users_to_workspace(workspace_id, user_ids, kind)

Description: Adds users to a workspace.

Arguments:

  • workspace_id (int): The ID of the workspace.
  • user_ids (list of int): List of user IDs to add to the workspace.
  • kind (str): The role of the users in the workspace ('subscriber' or 'owner'). Default is 'subscriber'.

Returns: JSON response confirming the addition of users.

Example:

response = monday.workspaces.add_users_to_workspace(workspace_id=1234567, 
                                                    user_ids=[123456, 654321], 
                                                    kind="subscriber")

delete_workspace()

delete_workspace(workspace_id)

Description: Deletes a workspace.

Arguments:

  • workspace_id (int): The ID of the workspace to delete.

Returns: True if successful. Returns None or an error message on API failure.

Example:

success = monday.workspaces.delete_workspace(12345)

delete_users_from_workspace()

delete_users_from_workspace(workspace_id, user_ids)

Description: Removes users from a workspace.

Arguments:

  • workspace_id (int): The ID of the workspace.
  • user_ids (list of int): List of user IDs to remove from the workspace.

Returns: True if successful. Returns None or an error message on API failure.

Example:

success = monday.workspaces.delete_users_from_workspace(workspace_id=123456, user_ids=[123456, 654321])

add_teams_to_workspace()

add_teams_to_workspace(workspace_id, team_ids, kind)

Description: Adds teams to a workspace.

Arguments:

  • workspace_id (int): The ID of the workspace.
  • team_ids (list of int): List of team IDs to add to the workspace.
  • kind (str): The subscriber's role ('owner' or 'subscriber'). Default is 'subscriber'.

Returns: True if successful. Returns None or an error message on API failure.

Example:

success = monday.workspaces.add_teams_to_workspace(worspace_id=123456,
                                                   team_ids=[12345, 54321],
                                                   kind="subscriber")

update_workspace()

update_workspace(workspace_id, name, description)

Description: Updates workspace attributes.

Arguments:

  • workspace_id (int): The ID of the workspace.
  • name (str): The new name for the workspace (optional).
  • description (str): The new description for the workspace (optional).

Returns: Updated workspace data. Returns None or an error message on API failure.

Example:

updated_workspace = monday.workspaces.update_workspace(workspace_id=123456, 
                                                       name="Updated Workspace", 
                                                       description="Updated description")

delete_teams_from_workspace()

delete_teams_from_workspace(workspace_id, team_ids)

Description: Removes teams from a workspace.

Arguments:

  • workspace_id (int): The ID of the workspace.
  • team_ids (list of int): List of team IDs to remove from the workspace.

Returns: True if successful. Returns None or an error message on API failure.

Example:

success = monday.workspaces.delete_teams_from_workspace(workspace_id=123456, team_ids=[12345, 54321])