monday_ruby 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env +1 -1
- data/.rspec +0 -1
- data/.rubocop.yml +19 -0
- data/.simplecov +1 -0
- data/CHANGELOG.md +49 -0
- data/CONTRIBUTING.md +165 -0
- data/README.md +167 -88
- data/docs/.vitepress/config.mjs +255 -0
- data/docs/.vitepress/theme/index.js +4 -0
- data/docs/.vitepress/theme/style.css +43 -0
- data/docs/README.md +80 -0
- data/docs/explanation/architecture.md +507 -0
- data/docs/explanation/best-practices/errors.md +478 -0
- data/docs/explanation/best-practices/performance.md +1084 -0
- data/docs/explanation/best-practices/rate-limiting.md +630 -0
- data/docs/explanation/best-practices/testing.md +820 -0
- data/docs/explanation/column-values.md +857 -0
- data/docs/explanation/design.md +795 -0
- data/docs/explanation/graphql.md +356 -0
- data/docs/explanation/migration/v1.md +808 -0
- data/docs/explanation/pagination.md +447 -0
- data/docs/guides/advanced/batch.md +1274 -0
- data/docs/guides/advanced/complex-queries.md +1114 -0
- data/docs/guides/advanced/errors.md +818 -0
- data/docs/guides/advanced/pagination.md +934 -0
- data/docs/guides/advanced/rate-limiting.md +981 -0
- data/docs/guides/authentication.md +286 -0
- data/docs/guides/boards/create.md +386 -0
- data/docs/guides/boards/delete.md +405 -0
- data/docs/guides/boards/duplicate.md +511 -0
- data/docs/guides/boards/query.md +530 -0
- data/docs/guides/boards/update.md +453 -0
- data/docs/guides/columns/create.md +452 -0
- data/docs/guides/columns/metadata.md +492 -0
- data/docs/guides/columns/query.md +455 -0
- data/docs/guides/columns/update-multiple.md +459 -0
- data/docs/guides/columns/update-values.md +509 -0
- data/docs/guides/files/add-to-column.md +40 -0
- data/docs/guides/files/add-to-update.md +37 -0
- data/docs/guides/files/clear-column.md +33 -0
- data/docs/guides/first-request.md +285 -0
- data/docs/guides/folders/manage.md +750 -0
- data/docs/guides/groups/items.md +626 -0
- data/docs/guides/groups/manage.md +501 -0
- data/docs/guides/installation.md +169 -0
- data/docs/guides/items/create.md +493 -0
- data/docs/guides/items/delete.md +514 -0
- data/docs/guides/items/query.md +605 -0
- data/docs/guides/items/subitems.md +483 -0
- data/docs/guides/items/update.md +699 -0
- data/docs/guides/updates/manage.md +619 -0
- data/docs/guides/use-cases/dashboard.md +1421 -0
- data/docs/guides/use-cases/import.md +1962 -0
- data/docs/guides/use-cases/task-management.md +1381 -0
- data/docs/guides/workspaces/manage.md +502 -0
- data/docs/index.md +69 -0
- data/docs/package-lock.json +2468 -0
- data/docs/package.json +13 -0
- data/docs/reference/client.md +540 -0
- data/docs/reference/configuration.md +586 -0
- data/docs/reference/errors.md +693 -0
- data/docs/reference/resources/account.md +208 -0
- data/docs/reference/resources/activity-log.md +369 -0
- data/docs/reference/resources/board-view.md +359 -0
- data/docs/reference/resources/board.md +393 -0
- data/docs/reference/resources/column.md +543 -0
- data/docs/reference/resources/file.md +236 -0
- data/docs/reference/resources/folder.md +386 -0
- data/docs/reference/resources/group.md +507 -0
- data/docs/reference/resources/item.md +348 -0
- data/docs/reference/resources/subitem.md +267 -0
- data/docs/reference/resources/update.md +259 -0
- data/docs/reference/resources/workspace.md +213 -0
- data/docs/reference/response.md +560 -0
- data/docs/tutorial/first-integration.md +713 -0
- data/lib/monday/client.rb +41 -2
- data/lib/monday/configuration.rb +13 -0
- data/lib/monday/deprecation.rb +23 -0
- data/lib/monday/error.rb +5 -2
- data/lib/monday/request.rb +19 -1
- data/lib/monday/resources/base.rb +4 -0
- data/lib/monday/resources/board.rb +52 -0
- data/lib/monday/resources/column.rb +6 -0
- data/lib/monday/resources/file.rb +56 -0
- data/lib/monday/resources/folder.rb +55 -0
- data/lib/monday/resources/group.rb +66 -0
- data/lib/monday/resources/item.rb +62 -0
- data/lib/monday/util.rb +33 -1
- data/lib/monday/version.rb +1 -1
- data/lib/monday_ruby.rb +1 -0
- metadata +92 -11
- data/monday_ruby.gemspec +0 -39
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# Update
|
|
2
|
+
|
|
3
|
+
Access and manage updates (comments) via the `client.update` resource.
|
|
4
|
+
|
|
5
|
+
::: tip <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>What are Updates?</span>
|
|
6
|
+
Updates are comments or posts made on items in monday.com. They appear in the item's updates section and can include text, mentions, and attachments.
|
|
7
|
+
:::
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### query
|
|
12
|
+
|
|
13
|
+
Retrieves updates from your account.
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
client.update.query(args: {}, select: DEFAULT_SELECT)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Parameters:**
|
|
20
|
+
|
|
21
|
+
| Name | Type | Default | Description |
|
|
22
|
+
|------|------|---------|-------------|
|
|
23
|
+
| `args` | Hash | `{}` | Query arguments (see [updates query](https://developer.monday.com/api-reference/reference/updates#queries)) |
|
|
24
|
+
| `select` | Array | `["id", "body", "created_at"]` | Fields to retrieve |
|
|
25
|
+
|
|
26
|
+
**Returns:** `Monday::Response`
|
|
27
|
+
|
|
28
|
+
**Common args:**
|
|
29
|
+
- `ids` - Array of update IDs to retrieve
|
|
30
|
+
- `limit` - Number of results (default: 25)
|
|
31
|
+
- `page` - Page number
|
|
32
|
+
|
|
33
|
+
**Example:**
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
response = client.update.query(
|
|
37
|
+
args: { limit: 10 },
|
|
38
|
+
select: ["id", "body", "created_at", "creator { id name }"]
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
updates = response.body.dig("data", "updates")
|
|
42
|
+
updates.each do |update|
|
|
43
|
+
puts "#{update.dig('creator', 'name')}: #{update['body']}"
|
|
44
|
+
end
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**GraphQL:** `query { updates { ... } }`
|
|
48
|
+
|
|
49
|
+
**See:** [monday.com updates query](https://developer.monday.com/api-reference/reference/updates#queries)
|
|
50
|
+
|
|
51
|
+
### create
|
|
52
|
+
|
|
53
|
+
Creates a new update (comment) on an item.
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
client.update.create(args: {}, select: DEFAULT_SELECT)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Parameters:**
|
|
60
|
+
|
|
61
|
+
| Name | Type | Default | Description |
|
|
62
|
+
|------|------|---------|-------------|
|
|
63
|
+
| `args` | Hash | `{}` | Creation arguments (required) |
|
|
64
|
+
| `select` | Array | `["id", "body", "created_at"]` | Fields to retrieve |
|
|
65
|
+
|
|
66
|
+
**Required args:**
|
|
67
|
+
- `item_id` - Integer or String - Item to add update to
|
|
68
|
+
- `body` - String - Update text content
|
|
69
|
+
|
|
70
|
+
**Returns:** `Monday::Response`
|
|
71
|
+
|
|
72
|
+
**Example:**
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
response = client.update.create(
|
|
76
|
+
args: {
|
|
77
|
+
item_id: 123456,
|
|
78
|
+
body: "This is a comment on the item"
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
update = response.body.dig("data", "create_update")
|
|
83
|
+
# => {"id"=>"3325555116", "body"=>"This is a comment on the item", "created_at"=>"2024-07-25T03:46:49Z"}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**GraphQL:** `mutation { create_update { ... } }`
|
|
87
|
+
|
|
88
|
+
**See:** [monday.com create_update](https://developer.monday.com/api-reference/reference/updates#create-update)
|
|
89
|
+
|
|
90
|
+
### like
|
|
91
|
+
|
|
92
|
+
Likes an update.
|
|
93
|
+
|
|
94
|
+
```ruby
|
|
95
|
+
client.update.like(args: {}, select: ["id"])
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Parameters:**
|
|
99
|
+
|
|
100
|
+
| Name | Type | Default | Description |
|
|
101
|
+
|------|------|---------|-------------|
|
|
102
|
+
| `args` | Hash | `{}` | Arguments (required) |
|
|
103
|
+
| `select` | Array | `["id"]` | Fields to retrieve |
|
|
104
|
+
|
|
105
|
+
**Required args:**
|
|
106
|
+
- `update_id` - Integer or String - Update ID to like
|
|
107
|
+
|
|
108
|
+
**Returns:** `Monday::Response`
|
|
109
|
+
|
|
110
|
+
**Example:**
|
|
111
|
+
|
|
112
|
+
```ruby
|
|
113
|
+
response = client.update.like(
|
|
114
|
+
args: { update_id: 3325555116 }
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
liked_update = response.body.dig("data", "like_update")
|
|
118
|
+
# => {"id"=>"221186448"}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**GraphQL:** `mutation { like_update { ... } }`
|
|
122
|
+
|
|
123
|
+
**See:** [monday.com like_update](https://developer.monday.com/api-reference/reference/updates#like-update)
|
|
124
|
+
|
|
125
|
+
### clear_item_updates
|
|
126
|
+
|
|
127
|
+
Clears all updates from an item.
|
|
128
|
+
|
|
129
|
+
```ruby
|
|
130
|
+
client.update.clear_item_updates(args: {}, select: ["id"])
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Parameters:**
|
|
134
|
+
|
|
135
|
+
| Name | Type | Default | Description |
|
|
136
|
+
|------|------|---------|-------------|
|
|
137
|
+
| `args` | Hash | `{}` | Arguments (required) |
|
|
138
|
+
| `select` | Array | `["id"]` | Fields to retrieve |
|
|
139
|
+
|
|
140
|
+
**Required args:**
|
|
141
|
+
- `item_id` - Integer or String - Item to clear updates from
|
|
142
|
+
|
|
143
|
+
**Returns:** `Monday::Response`
|
|
144
|
+
|
|
145
|
+
::: warning <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>Destructive Operation</span>
|
|
146
|
+
This permanently deletes all updates from the item. This cannot be undone.
|
|
147
|
+
:::
|
|
148
|
+
|
|
149
|
+
**Example:**
|
|
150
|
+
|
|
151
|
+
```ruby
|
|
152
|
+
response = client.update.clear_item_updates(
|
|
153
|
+
args: { item_id: 123456 }
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
result = response.body.dig("data", "clear_item_updates")
|
|
157
|
+
# => {"id"=>"123456"}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**GraphQL:** `mutation { clear_item_updates { ... } }`
|
|
161
|
+
|
|
162
|
+
**See:** [monday.com clear_item_updates](https://developer.monday.com/api-reference/reference/updates#clear-item-updates)
|
|
163
|
+
|
|
164
|
+
### delete
|
|
165
|
+
|
|
166
|
+
Permanently deletes an update.
|
|
167
|
+
|
|
168
|
+
```ruby
|
|
169
|
+
client.update.delete(args: {}, select: ["id"])
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Parameters:**
|
|
173
|
+
|
|
174
|
+
| Name | Type | Default | Description |
|
|
175
|
+
|------|------|---------|-------------|
|
|
176
|
+
| `args` | Hash | `{}` | Arguments (required) |
|
|
177
|
+
| `select` | Array | `["id"]` | Fields to retrieve |
|
|
178
|
+
|
|
179
|
+
**Required args:**
|
|
180
|
+
- `id` - Integer or String - Update ID to delete
|
|
181
|
+
|
|
182
|
+
**Returns:** `Monday::Response`
|
|
183
|
+
|
|
184
|
+
::: warning <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>Permanent Deletion</span>
|
|
185
|
+
This operation cannot be undone. The update will be permanently deleted.
|
|
186
|
+
:::
|
|
187
|
+
|
|
188
|
+
**Example:**
|
|
189
|
+
|
|
190
|
+
```ruby
|
|
191
|
+
response = client.update.delete(
|
|
192
|
+
args: { id: 3325555116 }
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
deleted_update = response.body.dig("data", "delete_update")
|
|
196
|
+
# => {"id"=>"3325555116"}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**GraphQL:** `mutation { delete_update { ... } }`
|
|
200
|
+
|
|
201
|
+
**See:** [monday.com delete_update](https://developer.monday.com/api-reference/reference/updates#delete-update)
|
|
202
|
+
|
|
203
|
+
## Response Structure
|
|
204
|
+
|
|
205
|
+
All methods return a `Monday::Response` object. Access data using:
|
|
206
|
+
|
|
207
|
+
```ruby
|
|
208
|
+
response.success? # => true/false
|
|
209
|
+
response.status # => 200
|
|
210
|
+
response.body # => Hash with GraphQL response
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Typical Response Pattern
|
|
214
|
+
|
|
215
|
+
```ruby
|
|
216
|
+
response = client.update.create(
|
|
217
|
+
args: {
|
|
218
|
+
item_id: 123456,
|
|
219
|
+
body: "Status update"
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
if response.success?
|
|
224
|
+
update = response.body.dig("data", "create_update")
|
|
225
|
+
# Work with update
|
|
226
|
+
else
|
|
227
|
+
# Handle error
|
|
228
|
+
end
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Constants
|
|
232
|
+
|
|
233
|
+
### DEFAULT_SELECT
|
|
234
|
+
|
|
235
|
+
Default fields returned by `query` and `create`:
|
|
236
|
+
|
|
237
|
+
```ruby
|
|
238
|
+
["id", "body", "created_at"]
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Error Handling
|
|
242
|
+
|
|
243
|
+
Common errors when working with updates:
|
|
244
|
+
|
|
245
|
+
- `Monday::AuthorizationError` - Invalid or missing API token
|
|
246
|
+
- `Monday::InvalidRequestError` - Invalid item_id or update_id
|
|
247
|
+
- `Monday::Error` - Invalid field requested or other API errors
|
|
248
|
+
|
|
249
|
+
See the [Error Handling guide](/guides/advanced/errors) for more details.
|
|
250
|
+
|
|
251
|
+
## Related Resources
|
|
252
|
+
|
|
253
|
+
- [Item](/reference/resources/item) - Parent items that contain updates
|
|
254
|
+
- [Board](/reference/resources/board) - Boards containing items
|
|
255
|
+
|
|
256
|
+
## External References
|
|
257
|
+
|
|
258
|
+
- [monday.com Updates API](https://developer.monday.com/api-reference/reference/updates)
|
|
259
|
+
- [GraphQL API Overview](https://developer.monday.com/api-reference/docs/introduction-to-graphql)
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Workspace
|
|
2
|
+
|
|
3
|
+
Access and manage workspaces via the `client.workspace` resource.
|
|
4
|
+
|
|
5
|
+
::: tip <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>What are Workspaces?</span>
|
|
6
|
+
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.
|
|
7
|
+
:::
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### query
|
|
12
|
+
|
|
13
|
+
Retrieves workspaces from your account.
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
client.workspace.query(args: {}, select: DEFAULT_SELECT)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Parameters:**
|
|
20
|
+
|
|
21
|
+
| Name | Type | Default | Description |
|
|
22
|
+
|------|------|---------|-------------|
|
|
23
|
+
| `args` | Hash | `{}` | Query arguments (see [workspaces query](https://developer.monday.com/api-reference/reference/workspaces#queries)) |
|
|
24
|
+
| `select` | Array | `["id", "name", "description"]` | Fields to retrieve |
|
|
25
|
+
|
|
26
|
+
**Returns:** `Monday::Response`
|
|
27
|
+
|
|
28
|
+
**Common args:**
|
|
29
|
+
- `ids` - Array of workspace IDs
|
|
30
|
+
- `limit` - Number of results to return
|
|
31
|
+
- `page` - Page number for pagination
|
|
32
|
+
- `state` - Workspace state (`:active`, `:archived`, `:deleted`, or `:all`)
|
|
33
|
+
|
|
34
|
+
**Example:**
|
|
35
|
+
|
|
36
|
+
```ruby
|
|
37
|
+
response = client.workspace.query(
|
|
38
|
+
select: ["id", "name", "description"]
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
workspaces = response.body.dig("data", "workspaces")
|
|
42
|
+
# => [{"id"=>"7451845", "name"=>"Test Workspace", "description"=>"A test workspace"}, ...]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**With specific IDs:**
|
|
46
|
+
|
|
47
|
+
```ruby
|
|
48
|
+
response = client.workspace.query(
|
|
49
|
+
args: { ids: [123, 456] },
|
|
50
|
+
select: ["id", "name"]
|
|
51
|
+
)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**GraphQL:** `query { workspaces { ... } }`
|
|
55
|
+
|
|
56
|
+
**See:** [monday.com workspaces query](https://developer.monday.com/api-reference/reference/workspaces#queries)
|
|
57
|
+
|
|
58
|
+
### create
|
|
59
|
+
|
|
60
|
+
Creates a new workspace.
|
|
61
|
+
|
|
62
|
+
```ruby
|
|
63
|
+
client.workspace.create(args: {}, select: DEFAULT_SELECT)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Parameters:**
|
|
67
|
+
|
|
68
|
+
| Name | Type | Default | Description |
|
|
69
|
+
|------|------|---------|-------------|
|
|
70
|
+
| `args` | Hash | `{}` | Creation arguments (required) |
|
|
71
|
+
| `select` | Array | `["id", "name", "description"]` | Fields to retrieve |
|
|
72
|
+
|
|
73
|
+
**Required args:**
|
|
74
|
+
- `name` - String (workspace name)
|
|
75
|
+
- `kind` - Symbol (`:open` or `:closed`)
|
|
76
|
+
|
|
77
|
+
**Optional args:**
|
|
78
|
+
- `description` - String (workspace description)
|
|
79
|
+
|
|
80
|
+
**Workspace kinds:**
|
|
81
|
+
- `:open` - Open workspace (visible to all account members)
|
|
82
|
+
- `:closed` - Closed workspace (visible only to workspace members)
|
|
83
|
+
|
|
84
|
+
**Returns:** `Monday::Response`
|
|
85
|
+
|
|
86
|
+
**Example:**
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
response = client.workspace.create(
|
|
90
|
+
args: {
|
|
91
|
+
name: "Product Team",
|
|
92
|
+
kind: :open,
|
|
93
|
+
description: "Workspace for product development"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
workspace = response.body.dig("data", "create_workspace")
|
|
98
|
+
# => {"id"=>"7451865", "name"=>"Product Team", "description"=>"Workspace for product development"}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**GraphQL:** `mutation { create_workspace { ... } }`
|
|
102
|
+
|
|
103
|
+
**See:** [monday.com create_workspace](https://developer.monday.com/api-reference/reference/workspaces#create-workspace)
|
|
104
|
+
|
|
105
|
+
### delete
|
|
106
|
+
|
|
107
|
+
Permanently deletes a workspace.
|
|
108
|
+
|
|
109
|
+
```ruby
|
|
110
|
+
client.workspace.delete(workspace_id, select: ["id"])
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Parameters:**
|
|
114
|
+
|
|
115
|
+
| Name | Type | Default | Description |
|
|
116
|
+
|------|------|---------|-------------|
|
|
117
|
+
| `workspace_id` | Integer | - | Workspace ID to delete (required) |
|
|
118
|
+
| `select` | Array | `["id"]` | Fields to retrieve |
|
|
119
|
+
|
|
120
|
+
**Returns:** `Monday::Response`
|
|
121
|
+
|
|
122
|
+
::: warning <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>Permanent Deletion</span>
|
|
123
|
+
This operation cannot be undone. The workspace and all its boards will be permanently deleted.
|
|
124
|
+
:::
|
|
125
|
+
|
|
126
|
+
::: tip <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>Note: Unique Method Signature</span>
|
|
127
|
+
Unlike most resource methods, `delete` takes `workspace_id` as a positional parameter rather than in an `args` hash.
|
|
128
|
+
:::
|
|
129
|
+
|
|
130
|
+
**Example:**
|
|
131
|
+
|
|
132
|
+
```ruby
|
|
133
|
+
response = client.workspace.delete(7451868)
|
|
134
|
+
|
|
135
|
+
workspace = response.body.dig("data", "delete_workspace")
|
|
136
|
+
# => {"id"=>"7451868"}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**GraphQL:** `mutation { delete_workspace { ... } }`
|
|
140
|
+
|
|
141
|
+
**See:** [monday.com delete_workspace](https://developer.monday.com/api-reference/reference/workspaces#delete-workspace)
|
|
142
|
+
|
|
143
|
+
## Response Structure
|
|
144
|
+
|
|
145
|
+
All methods return a `Monday::Response` object. Access data using:
|
|
146
|
+
|
|
147
|
+
```ruby
|
|
148
|
+
response.success? # => true/false
|
|
149
|
+
response.status # => 200
|
|
150
|
+
response.body # => Hash with GraphQL response
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Typical Response Pattern
|
|
154
|
+
|
|
155
|
+
```ruby
|
|
156
|
+
response = client.workspace.query
|
|
157
|
+
|
|
158
|
+
if response.success?
|
|
159
|
+
workspaces = response.body.dig("data", "workspaces")
|
|
160
|
+
# Work with workspaces
|
|
161
|
+
else
|
|
162
|
+
# Handle error
|
|
163
|
+
end
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Constants
|
|
167
|
+
|
|
168
|
+
### DEFAULT_SELECT
|
|
169
|
+
|
|
170
|
+
Default fields returned by `query` and `create`:
|
|
171
|
+
|
|
172
|
+
```ruby
|
|
173
|
+
["id", "name", "description"]
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Error Handling
|
|
177
|
+
|
|
178
|
+
See the [Error Handling guide](/guides/advanced/errors) for common errors and how to handle them.
|
|
179
|
+
|
|
180
|
+
### Common Errors
|
|
181
|
+
|
|
182
|
+
**Invalid Workspace ID:**
|
|
183
|
+
|
|
184
|
+
```ruby
|
|
185
|
+
begin
|
|
186
|
+
client.workspace.delete(123)
|
|
187
|
+
rescue Monday::InvalidRequestError => e
|
|
188
|
+
puts "Workspace not found: #{e.message}"
|
|
189
|
+
# => "InvalidWorkspaceIdException: ..."
|
|
190
|
+
end
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Invalid Workspace Kind:**
|
|
194
|
+
|
|
195
|
+
```ruby
|
|
196
|
+
begin
|
|
197
|
+
client.workspace.create(
|
|
198
|
+
args: { name: "Test", kind: "public" } # Wrong: String instead of Symbol
|
|
199
|
+
)
|
|
200
|
+
rescue Monday::Error => e
|
|
201
|
+
puts "Invalid kind: #{e.message}"
|
|
202
|
+
end
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Related Resources
|
|
206
|
+
|
|
207
|
+
- [Board](/reference/resources/board) - Workspace boards
|
|
208
|
+
- [Folder](/reference/resources/folder) - Workspace folders
|
|
209
|
+
|
|
210
|
+
## External References
|
|
211
|
+
|
|
212
|
+
- [monday.com Workspaces API](https://developer.monday.com/api-reference/reference/workspaces)
|
|
213
|
+
- [GraphQL API Overview](https://developer.monday.com/api-reference/docs/introduction-to-graphql)
|