Teams are the most efficient way to manage groups of users in monday.com. Teams are comprised of one or multiple users, and every user can be a part of multiple teams (or none).

Teams queries

Required scope: teams:read

Querying teams returns one or several teams. You can place teams at the root of your query or nest them within another query. Nesting teams in another query will increase the complexity of the query.

query {
    teams {
        name
        picture_url
        users {
            created_at
            phone
        }
    }
}
let query = "query { teams { name picture_url users { created_at phone } } }";

fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY_HERE'
   },
   body: JSON.stringify({
     query : query
   })
  })
   .then(res => res.json())
   .then(res => console.log(JSON.stringify(res, null, 2)));

Arguments

The following argument can reduce the number of teams returned.

ArgumentDescription
ids [Int]A list of teams' identifiers.

Fields

Fields are used to return specific properties in an object. The following fields will determine what information is returned from your teams() query. Some fields will have their own arguments.

FieldDescriptionArguments
id Int!The team's identifier.
name String!The team's name.
picture_url StringThe team's picture url.
users [User]The users in the team.ids [Int]
kind UserKind
newest_first Boolean
limit Int

Teams mutations

Add teams to a board

Required scope: boards:write

This method allows you to add teams to a board.

mutation {
  add_teams_to_board (board_id:123456789, team_ids: [12345,54321]) {
    id
    name
  }
}
let query = 'mutation { add_teams_to_board (board_id: 123456789, team_ids: [12345,54321]) { id } }';

fetch ("https://api.monday.com/v2", {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization' : 'YOUR_API_KEY_HERE'
},
body: JSON.stringify({
'query' : query
})
})
.then(res => res.json())
.then(res => console.log(JSON.stringify(res, null, 2)));

Arguments for add teams to a board

ArgumentDescription
board_id Int!The board's unique identifier.
team_ids [Int]!The IDs of the teams you want to subscribe to a board.

Add teams to a workspace

Required scope: workspaces:write

This mutation allows you to add teams to a workspace.

mutation {
    add_teams_to_workspace (workspace_id: 12345678, team_ids: [123456, 654321, 012345]) {
        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: 12345678, team_ids: [123456, 654321, 012345]) { id } }"
   })
  })

Arguments for add teams to a workspace

The following arguments define which teams to add to the workspace.

ArgumentsDescription
workspace_id Int!The workspace's unique identifier.
team_ids [Int!]Team IDs to add to the workspace.

Delete teams from a workspace

Required scope: workspaces:write

This mutation allows you to delete teams from a workspace.

mutation {
    delete_teams_from_workspace (workspace_id: 12345678, team_ids: [123456, 654321, 012345]) {
        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: 12345678, team_ids: [123456, 654321, 012345]) { id } }"
   })
  })

Arguments for delete teams from a workspace

ArgumentsDescription
workspace_id Int!The workspace's unique identifier.
team_ids [Int!]Team IDs to delete from the workspace.

📘

Have questions?

Join our developer community! You can share your questions and learn from fellow users and monday.com product experts.

Don’t forget to search before opening a new topic!