forked from RocketChat/Rocket.Chat-Open-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-management.yaml
849 lines (837 loc) · 28.4 KB
/
content-management.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
openapi: 3.0.0
info:
version: 1.0.0
title: Content Management
# description: |-
# The following endpoints are used to manage workspace resources:
# * **Assets**: Set and unset various [assets](https://docs.rocket.chat/use-rocket.chat/workspace-administration/settings/assets) to customize your workspace.
# * **Custom Emoji**: Create and manage custom [emojis](https://docs.rocket.chat/use-rocket.chat/workspace-administration/emoji).
# * **Custom Sounds**: View custom [sounds](https://docs.rocket.chat/use-rocket.chat/workspace-administration/sounds).
# * **Custom User Status**: Create and manager custom [user status](https://docs.rocket.chat/use-rocket.chat/workspace-administration/user-status).
servers:
- url: https://apiexplorer.support.rocket.chat
paths:
/api/v1/emoji-custom.all:
get:
tags:
- Custom Emoji
summary: List All Custom Emojis
description: |-
List all custom emojis.
### Changelog
| Version | Description |
| ---------------- | ------------|
|0.63.0 | Added |
operationId: get-api-v1-emoji-custom.all
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
emojis:
type: array
items:
type: object
properties:
_id:
type: string
name:
type: string
aliases:
type: array
items:
type: string
extension:
type: string
_updatedAt:
type: string
count:
type: integer
offset:
type: integer
total:
type: integer
success:
type: boolean
examples:
Example:
value:
emojis:
- _id: 6542e83aa2f73c7460e18efb
name: happy
aliases:
- happy-gang
extension: png
_updatedAt: '2023-11-02T00:07:22.433Z'
count: 1
offset: 0
total: 1
success: true
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/emoji-custom.create:
post:
tags:
- Custom Emoji
summary: Create an Emoji
description: |
Create a custom emoji.
### Changelog
| Version | Description |
| ---------------- | ------------|
|0.74.0 | Added |
operationId: post-api-v1-emoji-custom.create
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
emoji:
type: string
description: The image file to use as the new custom emoji.
format: binary
name:
type: string
description: The name of the new custom emoji.
aliases:
type: string
description: The alias of the new custom emoji.
required:
- emoji
- name
- aliases
responses:
'200':
$ref: '#/components/responses/trueSuccess'
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/emoji-custom.delete:
post:
tags:
- Custom Emoji
summary: Delete a Custom Emoji
description: |-
Delete a custom emoji.
### Changelog
| Version | Description |
| ---------------- | ------------|
|0.74.0 | Added |
operationId: post-api-v1-emoji-custom.delete
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
application/json:
schema:
type: object
properties:
emojiId:
type: string
description: The id of the emoji to delete
required:
- emojiId
examples:
Example:
value:
emojiId: 6542e83aa2f73c7460e18efb
responses:
'200':
$ref: '#/components/responses/trueSuccess'
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/emoji-custom.list:
get:
tags:
- Custom Emoji
summary: Get Updated List of Custom Emojis
description: |-
Get an updated list of custom emojis.
### Changelog
| Version | Description |
| ---------------- | ------------|
|0.75.0 | Added |
operationId: get-api-v1-emoji-custom.list
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
- name: updatedSince
in: query
description: 'Date since the emojis were updated. Format: ISO string. When you provide the `updatedSince` query parameter in the URL then the `update` and `remove` in the response will contain only those updated and removed since this date and time.'
schema:
type: string
example: '2017-11-25T15:08:17.248Z'
- $ref: '#/components/parameters/query'
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
emojis:
type: object
properties:
update:
type: array
items:
type: object
properties:
_id:
type: string
name:
type: string
aliases:
type: array
items:
type: object
extension:
type: string
_updatedAt:
type: string
remove:
type: array
items:
type: object
properties:
_id:
type: string
name:
type: string
aliases:
type: array
items:
type: object
extension:
type: string
_updatedAt:
type: string
success:
type: boolean
examples:
Success Example:
value:
emojis:
update:
- _id: S5XvYppoLrLd9JvQm
name: teste
aliases: []
extension: jpg
_updatedAt: '2019-02-18T16:48:35.119Z'
remove:
- _id: 2dbVBG434dnsdh23
name: teste3
aliases: []
extension: jpg
_updatedAt: '2019-02-18T16:48:35.119Z'
success: true
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/emoji-custom.update:
post:
tags:
- Custom Emoji
summary: Update a Custom Emoji
description: |-
Update a custom emoji.
### Changelog
| Version | Description |
| ---------------- | ------------|
|0.74.0 | Added |
operationId: post-api-v1-emoji-custom.update
parameters:
- $ref: '#/components/parameters/UserId'
- $ref: '#/components/parameters/Auth-Token'
requestBody:
description: 'If you are updating the image, provide the image file as form data.'
content:
application/json:
schema:
type: object
properties:
emoji:
type: string
description: 'The image file to use as custom emoji, as form data.'
example: '@my-custom-emoji.png'
_id:
type: string
description: The ID of the custom emoji.
example: AG7DSB2H32YHS
name:
type: string
description: The name of the custom emoji.
example: my-custom-emoji
aliases:
type: string
description: The alias of the custom emoji.
example: emoji-alias
required:
- _id
- name
responses:
'200':
$ref: '#/components/responses/trueSuccess'
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/custom-sounds.list:
get:
tags:
- Custom Sounds
summary: List Custom Sounds
description: |-
List all custom sounds.
### Changelog
| Version | Description |
| ---------------- | ------------|
|2.4.0 | Added |
operationId: get-api-v1-custom-sounds.list
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/count'
- $ref: '#/components/parameters/sort'
- $ref: '#/components/parameters/query'
- $ref: '#/components/parameters/fields'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
sounds:
type: array
items:
type: object
properties:
_id:
type: string
name:
type: string
extension:
type: string
_updatedAt:
type: string
count:
type: integer
offset:
type: integer
total:
type: integer
success:
type: boolean
examples:
Success:
value:
sounds:
- _id: 65462caea2f73c7460e18f83
name: doremi
extension: mp3
_updatedAt: '2023-11-04T11:36:14.171Z'
count: 1
offset: 0
total: 1
success: true
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/custom-user-status.list:
get:
tags:
- Custom User Status
summary: List Custom User Status
description: |-
Lists all available custom user's status.
### Changelog
| Version | Description |
| ---------------- | ------------|
|2.4.0 | Added |
operationId: get-api-v1-custom-user-status.list
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
statuses:
type: array
items:
type: object
properties:
_id:
type: string
name:
type: string
statusType:
type: string
_updatedAt:
type: string
count:
type: integer
offset:
type: integer
total:
type: integer
success:
type: boolean
examples:
Success Example:
value:
statuses:
- _id: 63f61be0b000b6b6d86704c8
name: brb
statusType: away
_updatedAt: '2023-02-22T13:42:56.811Z'
count: 1
offset: 0
total: 1
success: true
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/custom-user-status.create:
post:
tags:
- Custom User Status
summary: Create Custom Status
description: |
Create a custom user status.
### Changelog
| Version | Description |
| ---------------- | ------------|
|2.4.0 | Added |
operationId: post-api-v1-custom-user-status.create
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The name of the custom status.
statusType:
type: string
description: 'The `statusType` of the custom status. Valid status type includes: `Online`, `Busy`, `Away`, `Offline`.'
required:
- name
- statusType
examples:
Example:
value:
name: caught up
statusType: busy
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
customUserStatus:
type: object
properties:
_id:
type: string
name:
type: string
statusType:
type: string
_updatedAt:
type: string
success:
type: boolean
examples:
Success Example:
value:
customUserStatus:
_id: 65462e97a2f73c7460e18f84
name: caught up
statusType: busy
_updatedAt: '2023-11-04T11:44:23.366Z'
success: true
'400':
description: Bad Request
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
error:
type: string
errorType:
type: string
details:
type: object
properties:
method:
type: string
examples:
Missing Name Param:
value:
success: false
error: 'The field Name is required [error-the-field-is-required]'
errorType: error-the-field-is-required
details:
method: insertOrUpdateUserStatus
field: Name
Status name already in use:
value:
success: false
error: 'The custom user status name is already in use [Custom_User_Status_Error_Name_Already_In_Use]'
errorType: Custom_User_Status_Error_Name_Already_In_Use
details:
method: insertOrUpdateUserStatus
Invalid Status Type:
value:
success: false
error: 'Offline is not a valid status type [error-input-is-not-a-valid-field]'
errorType: error-input-is-not-a-valid-field
details:
method: insertOrUpdateUserStatus
input: Offline
field: StatusType
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/custom-user-status.update:
post:
tags:
- Custom User Status
summary: Update Custom Status
description: |-
Update a custom status.
### Changelog
| Version | Description |
| ---------------- | ------------|
|2.4.0 | Added |
operationId: post-api-v1-custom-user-status.update
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
application/json:
schema:
type: object
properties:
_id:
type: string
description: The `_id` of the custom status.
name:
type: string
description: The updated name of the custom status.
statusType:
type: string
description: The updated `statusType` of the custom status
required:
- _id
- name
- statusType
examples:
Example:
value:
_id: 65462e97a2f73c7460e18f84
name: caught up again
statusType: busy
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
customUserStatus:
type: object
properties:
_id:
type: string
name:
type: string
statusType:
type: string
_updatedAt:
type: string
success:
type: boolean
examples:
Success Example:
value:
customUserStatus:
_id: 65462e97a2f73c7460e18f84
name: caught up again
statusType: busy
_updatedAt: '2023-11-04T11:51:28.353Z'
success: true
'400':
description: Bad Request
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
error:
type: string
examples:
User status not found:
value:
success: false
error: No custom user status found with the id of "SeZHHb77QXWRbnDh".
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/custom-user-status.delete:
post:
tags:
- Custom User Status
summary: Delete Custom User Status
description: |-
Delete a custom user status.
### Changelog
| Version | Description |
| ---------------- | ------------|
|2.4.0 | Added |
operationId: post-api-v1-custom-user-status.delete
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
application/json:
schema:
type: object
properties:
customUserStatusId:
type: string
description: The `_id` of the custom status
required:
- customUserStatusId
examples:
Example:
value:
customUserStatusId: 65462e97a2f73c7460e18f84
responses:
'200':
$ref: '#/components/responses/trueSuccess'
'400':
description: Bad Request
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
error:
type: string
examples:
User status Id is required::
value:
success: false
error: The "customUserStatusId" params is required!
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/assets.setAsset:
post:
tags:
- Assets
summary: Set Asset
description: |-
Set an <a href="https://docs.rocket.chat/docs/assets" target="_blank"> asset</a> by name. Permissions required: `manage-assets`.
### Changelog
| Version | Description |
| ---------------- | ------------|
|0.69.0 | Added |
operationId: post-api-v1-assets.setAsset
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
description: ''
content:
application/json:
schema:
type: object
properties:
asset:
type: string
description: Asset File to upload.
assetName:
type: string
description: "Type of asset to upload. `assetName` can be one of these:`logo`, `background`, `favicon_ico`, `favicon`, `favicon_16`, `favicon_32`, `favicon_192`, `favicon_512`, `touchicon_180`, `touchicon_180_pre`, `tile_70`, `tile_144`, `tile_150`, `tile_310_square`, `tile_310_wide`, `safari_pinned`.\r\n"
refreshAllClients:
type: boolean
description: If needs refresh all clients to apply changes immediately.
required:
- asset
- assetName
multipart/form-data:
schema:
type: object
properties:
asset:
type: string
description: Asset File to upload.
assetName:
type: string
description: "Type of asset to upload. `assetName` can be one of these:`logo`, `background`, `favicon_ico`, `favicon`, `favicon_16`, `favicon_32`, `favicon_192`, `favicon_512`, `touchicon_180`, `touchicon_180_pre`, `tile_70`, `tile_144`, `tile_150`, `tile_310_square`, `tile_310_wide`, `safari_pinned ]`\r\n"
refreshAllClients:
type: string
required:
- asset
- assetName
responses:
'200':
$ref: '#/components/responses/trueSuccess'
'401':
$ref: '#/components/responses/authorizationError'
/api/v1/assets.unsetAsset:
post:
tags:
- Assets
summary: Unset Asset
description: |-
Unset an asset by name. Permissions required: `manage-assets` .
### Changelog
| Version | Description |
| ---------------- | ------------|
|0.69.0 | Added |
operationId: post-api-v1-assets.unsetAsset
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
application/json:
schema:
type: object
properties:
assetName:
type: string
description: "Asset name to unset. `assetName` can be one of these:`logo`, `background`, `favicon_ico`, `favicon`, `favicon_16`, `favicon_32`, `favicon_192`, `favicon_512`, `touchicon_180`, `touchicon_180_pre`, `tile_70`, `tile_144`, `tile_150`, `tile_310_square`, `tile_310_wide`, `safari_pinned`.\r\n"
refreshAllClients:
type: boolean
description: If needs refresh all clients to apply changes immediately.
required:
- assetName
examples:
Example:
value:
assetName: logo
refreshAllClients: true
responses:
'200':
$ref: '#/components/responses/trueSuccess'
'401':
$ref: '#/components/responses/authorizationError'
tags:
- name: Assets
- name: Custom Emoji
- name: Custom Sounds
- name: Custom User Status
components:
parameters:
offset:
name: offset
in: query
description: 'Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items.'
required: false
schema:
type: integer
example: 50
count:
name: count
in: query
description: The number of items to return.
required: false
schema:
type: integer
example: 50
sort:
name: sort
in: query
description: 'List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}'
required: false
schema: {}
query:
name: query
in: query
description: 'This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": query={ "name": { "$regex": "g" } }'
required: false
schema: {}
fields:
name: fields
in: query
description: 'This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: fields={ "username": 1 }'
required: false
schema:
type: string
Auth-Token:
name: X-Auth-Token
in: header
description: The `authToken` of the authenticated user.
required: true
schema:
type: string
example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
UserId:
name: X-User-Id
in: header
description: The `userId` of the authenticated user.
required: true
schema:
type: string
example: rbAXPnMktTFbNpwtJ
responses:
trueSuccess:
description: OK
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
examples:
Success:
value:
success: true
authorizationError:
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
examples:
Authorization Error:
value:
status: error
message: You must be logged in to do this.