Folders
Users can create folders to help organize their boards, dashboards, and workdocs within a workspace.
As a developer working with monday.com, it is important to familiarize yourself with the folders
API so you know how to access folder data. This document will walk you through the available queries to read and update the folders
object via the API.
Queries
Required scope: workspaces:read
Querying folders
will return metadata about one or a collection of folders. This method accepts various arguments and returns an array.
You can only query folders
directly at the root, so it can't be nested within another query.
query {
folders (workspace_ids: 1234567890) {
name
id
children {
id
name
}
}
}
let query = "query { folders (workspace_ids: 1234567890) { name id children { id name }}}";
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
You can use the following argument(s) to reduce the number of results returned in your folders
query.
Argument | Description |
---|---|
ids [Int!] | The specific folders to return. Please note that this argument's type is [ID!] in API versions 2023-10 and later. |
limit Int | The number of folders to get. The default is 25 and the maximum is 100. |
page Int | The page number to return. Starts at 1. |
workspace_ids [Int] | The unique identifiers of the specific workspaces to return. You can query [null] to return folders in the Main Workspace. Please note that this argument's type is [ID] in API versions 2023-10 and later. |
Fields
You can use the following field(s) to specify what information your folders
query will return.
Field | Description |
---|---|
children [Board]! | The folder's contents, excluding dashboards and subfolders. |
color FolderColor | The folder's color. |
created_at Date! | The folder's creation date. |
id Int! | The folder's unique identifier. Please note that this field's type is ID! in API versions 2023-10 and later. |
name String! | The folder's name. |
owner_id Int | The unique identifier of the folder's owner. Please note that this argument's type is ID in API versions 2023-10 and later. |
parent Folder | The folder's parent folder. |
sub_folders [Folder]! | The folders inside of the parent folder. |
workspace Workspace! | The workspace that contains the folder. |
Mutations
Required scope: workspaces:write
Create a folder
The create_folder
mutation allows you to create a new folder in a workspace via the API. You can also specify what fields to query back from the new folder when you run the mutation.
mutation {
create_folder (name: "New folder", workspace_id: 1234567890) {
id
}
}
let query = "mutation { create_folder (name: \"New folder\" , workspace_id: 1234567890) { 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
You can use the following arguments to define the new folder's characteristics.
Argument | Description |
---|---|
color FolderColor | The folder's color. |
name String! | The folder's name. |
parent_folder_id Int | The ID of the folder you want to nest the new one under. Please note that this argument's type is ID in API versions 2023-10 and later. |
workspace_id Int | The unique identifier of the workspace to create the new folder in. Please note that this argument's type is ID in API versions 2023-10 and later. |
Update a folder
The update_folder
mutation allows you to update a folder's color, name, or parent folder via the API. You can also specify what fields to query back from the updated folder when you run the mutation.
mutation {
update_folder (folder_id: 1234567890, name: "Updated folder name") {
id
}
}
let query = "mutation { update_folder (folder_id: 1234567890, name: \"Updated folder name\") { 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
You can use the following arguments to define the updated folder's characteristics.
Argument | Description |
---|---|
color FolderColor | The folder's color. |
folder_id Int! | The folder's unique identifier. Please note that this argument's type is ID! in API versions 2023-10 and later. |
name String | The folder's name. |
parent_folder_id Int | The ID of the folder you want to nest the updated one under. Please note that this argument's type is ID in API versions 2023-10 and later. |
Delete a folder
The delete_folder
mutation allows you to delete and folder and all its contents via the API. You can also specify what fields to query back from the deleted folder when you run the mutation.
mutation {
delete_folder (folder_id: 1234567890) {
id
}
}
let query = "mutation { delete_folder (folder_id: 1234567890) { 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
You can use the following arguments to specify which folder to delete.
Argument | Description |
---|---|
folder_id Int! | The folder's unique identifier. Please note that this argument's type is ID! in API versions 2023-10 and later. |
Join our developer community!
We've created a community specifically for our devs where you can search through previous topics to find solutions, ask new questions, hear about new features and updates, and learn tips and tricks from other devs. Come join in on the fun! 😎
Updated 27 days ago