Workspace
Access and manage workspaces via the client.workspace resource.
What are Workspaces?
Workspaces are the highest level of organization in monday.com. They group related boards together and control access permissions. Think of them as team spaces or departmental hubs where you organize boards by project, team, or purpose.
Methods
query
Retrieves workspaces from your account.
client.workspace.query(args: {}, select: DEFAULT_SELECT)Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
args | Hash | {} | Query arguments (see workspaces query) |
select | Array | ["id", "name", "description"] | Fields to retrieve |
Returns: Monday::Response
Common args:
ids- Array of workspace IDslimit- Number of results to returnpage- Page number for paginationstate- Workspace state (:active,:archived,:deleted, or:all)
Example:
response = client.workspace.query(
select: ["id", "name", "description"]
)
workspaces = response.body.dig("data", "workspaces")
# => [{"id"=>"7451845", "name"=>"Test Workspace", "description"=>"A test workspace"}, ...]With specific IDs:
response = client.workspace.query(
args: { ids: [123, 456] },
select: ["id", "name"]
)GraphQL: query { workspaces { ... } }
See: monday.com workspaces query
create
Creates a new workspace.
client.workspace.create(args: {}, select: DEFAULT_SELECT)Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
args | Hash | {} | Creation arguments (required) |
select | Array | ["id", "name", "description"] | Fields to retrieve |
Required args:
name- String (workspace name)kind- Symbol (:openor:closed)
Optional args:
description- String (workspace description)
Workspace kinds:
:open- Open workspace (visible to all account members):closed- Closed workspace (visible only to workspace members)
Returns: Monday::Response
Example:
response = client.workspace.create(
args: {
name: "Product Team",
kind: :open,
description: "Workspace for product development"
}
)
workspace = response.body.dig("data", "create_workspace")
# => {"id"=>"7451865", "name"=>"Product Team", "description"=>"Workspace for product development"}GraphQL: mutation { create_workspace { ... } }
See: monday.com create_workspace
delete
Permanently deletes a workspace.
client.workspace.delete(workspace_id, select: ["id"])Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
workspace_id | Integer | - | Workspace ID to delete (required) |
select | Array | ["id"] | Fields to retrieve |
Returns: Monday::Response
Permanent Deletion
This operation cannot be undone. The workspace and all its boards will be permanently deleted.
Note: Unique Method Signature
Unlike most resource methods, delete takes workspace_id as a positional parameter rather than in an args hash.
Example:
response = client.workspace.delete(7451868)
workspace = response.body.dig("data", "delete_workspace")
# => {"id"=>"7451868"}GraphQL: mutation { delete_workspace { ... } }
See: monday.com delete_workspace
Response Structure
All methods return a Monday::Response object. Access data using:
response.success? # => true/false
response.status # => 200
response.body # => Hash with GraphQL responseTypical Response Pattern
response = client.workspace.query
if response.success?
workspaces = response.body.dig("data", "workspaces")
# Work with workspaces
else
# Handle error
endConstants
DEFAULT_SELECT
Default fields returned by query and create:
["id", "name", "description"]Error Handling
See the Error Handling guide for common errors and how to handle them.
Common Errors
Invalid Workspace ID:
begin
client.workspace.delete(123)
rescue Monday::InvalidRequestError => e
puts "Workspace not found: #{e.message}"
# => "InvalidWorkspaceIdException: ..."
endInvalid Workspace Kind:
begin
client.workspace.create(
args: { name: "Test", kind: "public" } # Wrong: String instead of Symbol
)
rescue Monday::Error => e
puts "Invalid kind: #{e.message}"
end