Workspaces
monday.com Workspaces are used by teams to organize and manage their accounts by departments/teams/projects. Workspaces can contain boards, dashboards, and folders.
You can find more information about workspaces here.
Workspaces Queries
Required scope: workspaces:read
Workspaces are not a root field. However, you can query workspaces as part of a boards query.
Every account will have a workspace called the Main Workspace by default. The ID of this Workspace is null
. Here is a sample query that returns the Board ID, as well as all of the details of the workspace it is in.
query {
boards {
workspace {
id
name
kind
description
}
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YourSuperSecretAPIkey'
},
body: JSON.stringify({
query : "query { boards { workspace { id name kind description }}}"
})
})
curl --location --request POST 'https://api.monday.com/v2' \
--header 'Authorization: YourSuperSecretAPIkey' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query { boards { workspace { id name kind description }}}"}'
If you only need the ID of a workspace, you only need the boards:read
scope.
query {
boards {
id
workspace_id
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YourSuperSecretAPIkey'
},
body: JSON.stringify({
query : "query { boards { id workspace_id }}"
})
})
curl --location --request POST 'https://api.monday.com/v2' \
--header 'Authorization: YourSuperSecretAPIkey' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query { boards { id workspace_id }}"}'
Fields
Fields are used to return specific properties in an object. The following fields will determine what information is returned from your workspaces query.
FIeld | Field Description |
---|---|
id | The workspace identifier; |
name | The workspace name; |
kind | Will return Open for Open Workspaces, and Closed for Closed Workspaces. |
description | The description added to this workspace. |
Note:
When querying
workspaces
in aboards
query, you will need to have theworkspaces:read
scope enabled.
Workspace Mutations
Required scope: workspaces:write
Create a Workspace
Allows you to create a new workspace. After the mutation runs, you can create boards in it as shown in the creating boards section.
mutation {
create_workspace (name:"New Cool Workspace", kind: open, description: "This is a cool description") {
id
description
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YourSuperSecretAPIkey'
},
body: JSON.stringify({
query : "mutation { create_workspace (name: \"New Cool Workspace\", kind: open, description: \"This is a cool description\") { id description } }"
})
})
curl --location --request POST 'https://api.monday.com/v2' \
--header 'Authorization: YourSuperSecretAPIkey' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { create_workspace (name: \"New Cool Workspace\", kind: open, description: \"This is a cool description\") { id description } }"}'
Arguments for Create a Workspace
The following create_workspace()
arguments define the new workspace's characteristics.
Arguments | Description |
---|---|
name | The new workspace's name. |
kind | The new workspace's kind (open/closed). |
description | The new workspace's description. |
Add Users to a Workspace
Allows you to add users to a workspace. You can define if users will be added as regular subscribers or as owners of the workspace.
mutation {
add_users_to_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941], kind: subscriber) {
id
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YourSuperSecretAPIkey'
},
body: JSON.stringify({
query : "mutation { add_users_to_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941], kind: subscriber) { id } }"
})
})
curl --location --request POST 'https://api.monday.com/v2' \
--header 'Authorization: YourSuperSecretAPIkey' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { add_users_to_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941], kind: subscriber) { id } }"}'
Arguments for Add Users to a Workspace
The following add_users_to_workspace()
arguments define which users to add to the workspace, as well as their subscription type.
Arguments | Description |
---|---|
workspace_id | The workspace's unique identifier. |
user_ids | User IDs to subscribe to the workspace. |
kind | Kind of subscribers added (subscriber / owner). |
Delete Users from Workspace
Allows you to delete users from a workspace.
mutation {
delete_users_from_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941]) {
id
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YourSuperSecretAPIkey'
},
body: JSON.stringify({
query : "mutation { delete_users_from_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941]) { id } }"
})
})
curl --location --request POST 'https://api.monday.com/v2' \
--header 'Authorization: YourSuperSecretAPIkey' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { delete_users_from_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941]) { id } }"}'
Arguments for Delete Users from Workspace
The following delete_users_from_workspace()
arguments define which users to remove from the workspace.
Arguments | Description |
---|---|
workspace_id | The workspace's unique identifier. |
user_ids | User IDs to unsubscribe from the workspace. |
Add Teams to a Workspace
Allows you to add teams to a workspace.
mutation {
add_teams_to_workspace (workspace_id: 20178755, team_ids: [105939, 105940, 105941]) {
id
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YourSuperSecretAPIkey'
},
body: JSON.stringify({
query : "mutation { add_teams_to_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941]) { id } }"
})
})
curl --location --request POST 'https://api.monday.com/v2' \
--header 'Authorization: YourSuperSecretAPIkey' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { add_teams_to_workspace (workspace_id: 20178755, team_ids: [105939, 105940, 105941]) { id } }"}'
Arguments for Add Teams to a Workspace
The following add_teams_to_workspace()
arguments define which teams to add to the workspace.
Arguments | Description |
---|---|
workspace_id | The workspace's unique identifier. |
team_ids | Team ids to subscribe to the workspace. |
Delete Teams from a Workspace
Allows you to delete teams from a workspace.
mutation {
delete_teams_from_workspace (workspace_id: 20178755, team_ids: [105939, 105940, 105941]) {
id
}
}
fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YourSuperSecretAPIkey'
},
body: JSON.stringify({
query : "mutation { delete_teams_from_workspace (workspace_id: 20178755, user_ids: [105939, 105940, 105941]) { id } }"
})
})
curl --location --request POST 'https://api.monday.com/v2' \
--header 'Authorization: YourSuperSecretAPIkey' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation { delete_teams_from_workspace (workspace_id: 20178755, team_ids: [105939, 105940, 105941]) { id } }"}'
Arguments for Delete Teams from a Workspace
The following delete_teams_from_workspace()
arguments define which teams to remove from the workspace.
Arguments | Description |
---|---|
workspace_id | The workspace's unique identifier. |
team_ids | Team IDs to unsubscribe from the workspace. |
Updated about 1 year ago