forked from Roblox/creator-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
v1.json
684 lines (683 loc) · 25.4 KB
/
v1.json
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
{
"openapi": "3.0.1",
"info": {
"title": "Assets API",
"description": "You can send and receive the following request and response payloads to create assets on Roblox. For information on the usage of the API, see the [Usage Guide](../../../cloud/open-cloud/usage-assets.md).",
"version": "0.0.1"
},
"servers": [
{
"url": "https://apis.roblox.com/assets"
}
],
"paths": {
"/v1/assets": {
"get": {
"tags": ["Assets"],
"x-roblox-cloud-api-operation": true,
"x-roblox-cloud-api-operation-name": "Get Asset",
"summary": "Retrieve specific asset content. Include the `readMask` parameter for additional asset metadata.",
"description": "Retrieve specific asset content and metadata.",
"operationId": "Assets_CreateAsset",
"parameters": [
{
"name": "assetId",
"in": "path",
"description": "The unique identifier of the asset.",
"required": true,
"schema": {
"$ref": "#/components/schemas/Asset"
}
},
{
"name": "readMask",
"in": "query",
"description": "Asset metadata fields to retrieve, including the description, display name, icon, and previews. Example: `description%2CdisplayName`, `previews`.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Asset resource retrieved successfully."
},
"400": {
"description": "Malformed request, likely due to an invalid read mask."
},
"401": {
"description": "The API key is not valid for this operation / You don't have the authorization."
},
"403": {
"description": "Doesn't have the required permission."
},
"404": {
"description": "Asset doesn't exist."
},
"500": {
"description": "Server internal error / Unknown error."
}
},
"security": [
{
"roblox-api-key": ["Label.Read"]
},
{
"roblox-oauth2": ["asset:read"]
}
],
"x-roblox-cloud-api-operation-code-samples": [
{
"language": "Get Asset without readMask",
"script": "curl --location --request GET 'https://apis.roblox.com/assets/v1/assets/{assetId}' \\\n--header 'x-api-key: {apiKey}'"
},
{
"language": "Get Asset with readMask",
"script": "curl --location --request GET 'https://apis.roblox.com/assets/v1/assets/{assetId}?readMask={read_mask}' \\\n--header 'x-api-key: {apiKey}'"
}
],
"x-roblox-throttling-limit": {
"perApiKey": {
"periodInSeconds": "60",
"maxInPeriod": 60
}
}
} ,
"post": {
"tags": ["Assets"],
"x-roblox-cloud-api-operation": true,
"x-roblox-cloud-api-operation-name": "Create Asset",
"summary": "Creates an asset with provided content and metadata.",
"description": "Creates an asset with provided content and metadata.",
"operationId": "Assets_CreateAsset",
"parameters": [
{
"name": "request",
"in": "formData",
"description": "Asset attributes to create or update. Send as form data like the following example request shows.",
"required": true,
"schema": {
"$ref": "#/components/schemas/Asset"
}
},
{
"name": "fileContent",
"in": "formData",
"description": "The binary asset file path and the content type. Format: `fileContent=@\"/filepath/{File}\";type={ContentType}`. Example: `fileContent=@\"/filepath/model.fbx\";type=model/fbx`. See [Content Types](../../../cloud/open-cloud/usage-assets.md#supported-asset-types-and-limits).",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Returns the Operation ID for checking the creation status.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Operation"
}
}
}
},
"400": {
"description": "Invalid argument. Failed to parse the request or the file.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
},
"401": {
"description": "The API key is not valid for this operation / You don't have the authorization."
},
"500": {
"description": "Server internal error / Unknown error."
}
},
"security": [
{
"roblox-api-key": ["Label.Read", "Label.Write"]
},
{
"roblox-oauth2": ["asset:read", "asset:write"]
}
],
"x-roblox-cloud-api-operation-code-samples": [
{
"language": "Create Asset",
"script": "curl --location --request POST 'https://apis.roblox.com/assets/v1/assets' \\\n--header 'x-api-key: {apiKey}' \\\n--form 'request=\"{ \n \\\"assetType\\\": \\\"Model\\\", \n \\\"displayName\\\": \\\"Name\\\", \n \\\"description\\\": \\\"This is a description\\\", \n \\\"creationContext\\\": { \n \\\"creator\\\": { \n \\\"userId\\\": \\\"${userId}\\\" \n } \n } \n}\"' \\\n--form 'fileContent=@\"/filepath/model.fbx\";type=model/fbx' \n"
}
],
"x-roblox-throttling-limit": {
"perApiKey": {
"periodInSeconds": "60",
"maxInPeriod": 60
}
}
}
},
"/v1/assets/{assetId}": {
"patch": {
"tags": ["Assets"],
"x-roblox-cloud-api-operation": true,
"x-roblox-cloud-api-operation-name": "Update Asset",
"summary": "Updates an asset with provided content and metadata.",
"description": "Updates an asset with provided content and metadata, including the description, display name, icon, and previews. Currently can only update the content body for **Models**. Icons must be **Image** assets with square dimensions. Previews must be either **Image** or **YoutubeVideo** assets.",
"operationId": "Assets_UpdateAsset",
"parameters": [
{
"name": "request",
"in": "formData",
"description": "Send as form data like the following example requests.",
"required": true,
"schema": {
"$ref": "#/components/schemas/Asset"
}
},
{
"name": "fileContent",
"in": "formData",
"description": "The binary asset file path and the content type. Format: `fileContent=@\"/filepath/{File}\";type={ContentType}`. Example: `fileContent=@\"/filepath/model.fbx\";type=model/fbx`. See [Content Types](../../../cloud/open-cloud/usage-assets.md#supported-asset-types-and-limits).",
"schema": {
"type": "string"
}
},
{
"name": "updateMask",
"in": "query",
"required": false,
"description": "Asset metadata fields to update, including the description, display name, icon, and previews. Example: `description%2CdisplayName`, `previews`.",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Asset"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Returns the Operation ID for checking the update status / Returns the updated metadata fields.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Operation",
"example": "{\\\"previews\\\": [\\n {\\\"asset\\\": \\\"assets/123\\\", \\\"altText\\\": \\\"preview 1\\\"},\\n {\\\"asset\\\": \\\"assets/456\\\", \\\"altText\\\": \\\"preview 2\\\"}\\n]}"
}
}
}
},
"400": {
"description": "Invalid argument. Failed to parse the request or the file.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
},
"401": {
"description": "The API key is not valid for this operation / You don't have the authorization."
},
"500": {
"description": "Server internal error / Unknown error."
}
},
"security": [
{
"roblox-api-key": ["Label.Read", "Label.Write"]
},
{
"roblox-oauth2": ["asset:read", "asset:write"]
}
],
"x-roblox-cloud-api-operation-code-samples": [
{
"language": "Update Content Only and Create a New Version",
"script": "curl --location --request PATCH 'https://apis.roblox.com/assets/v1/assets/{assetId}' \\\n--header 'x-api-key: {apiKey}' \\\n--form 'request=\"{\\\"assetId\\\": {assetId} }\"' \\\n--form 'fileContent=\"@\\\"{file-path}\\\"\"'"
},
{
"language": "Update Content and Metadata",
"script": "curl --location --request PATCH 'https://apis.roblox.com/assets/v1/assets/{assetId}?updateMask=description%2CdisplayName' \\\n--header 'x-api-key: {apiKey}' \\\n--form 'request=\"{\n \\\"assetType\\\": \\\"{assetType}\\\",\n \\\"assetId\\\": {assetId},\n \\\"displayName\\\": \\\"{new display name}\\\",\n \\\"description\\\": \\\"{new description}\\\", \n \\\"creationContext\\\": { \n \\\"creator\\\": {\n \\\"userId\\\": {userId}\n },\n \\\"expectedPrice\\\":{expectedPrice}\n },\n}\"' \\\n--form 'fileContent=@\\\"{file-path}\\\"'"
},
{
"language": "Update a List of Previews",
"script": "curl --location --request PATCH 'https://apis.roblox.com/assets/v1/assets/{assetId}?updateMask=previews' \\\n--header 'x-api-key: {apiKey}' \\\n--form 'request=\"{\\\"assetId\\\": {assetId}, \\\"previews\\\": [{\\\"asset\\\": \\\"assets/123\\\", \\\"altText\\\": \\\"Your alt text.\\\"}]}\"'"
}
],
"x-roblox-throttling-limit": {
"perApiKey": {
"periodInSeconds": "60",
"maxInPeriod": 60
}
}
}
},
"/v1/assets/{assetId}/versions/{versionNumber}": {
"get": {
"tags": ["Assets"],
"x-roblox-cloud-api-operation": true,
"x-roblox-cloud-api-operation-name": "Get Asset Version",
"summary": "Get Asset Version",
"description": "Retrieve a specific asset version by the asset ID and the version number.",
"operationId": "Assets_GetAssetVersion",
"parameters": [
{
"name": "assetId",
"in": "path",
"description": "The unique identifier of the asset.",
"required": true,
"schema": {"type": "string"}
},
{
"name": "versionNumber",
"in": "path",
"description": "The version number.",
"required": true,
"schema": {"type": "string"}
}
],
"responses": {
"200": {"description": "Asset version retrieved successfully."},
"403": {"description": "Forbidden - API key without Read scope or user doesn't have access."},
"404": {"description": "Asset or Asset Version not found."}
},
"security": [
{
"roblox-api-key": ["Label.Read"]
},
{
"roblox-oauth2": ["asset:read"]
}
],
"x-roblox-cloud-api-operation-code-samples": [
{
"language": "Get Asset Version",
"script": "curl --location 'https://apis.roblox.com/assets/v1/assets/{assetId}/versions/{versionNumber}' \\\n--header 'x-api-key: {apiKey}'"
}
],
"x-roblox-throttling-limit": {
"perApiKey": {
"periodInSeconds": "60",
"maxInPeriod": 60
}
}
}
},
"/assets/v1/assets/{assetId}/versions": {
"get": {
"tags": ["Assets"],
"x-roblox-cloud-api-operation": true,
"x-roblox-cloud-api-operation-name": "List Asset Versions",
"summary": "List Asset Versions of an Asset",
"description": "List all versions of a specific asset, with optional pagination.",
"operationId": "listAssetVersions",
"parameters": [
{
"name": "assetId",
"in": "path",
"description": "The unique identifier of the asset.",
"required": true,
"schema": {"type": "string"}
},
{
"name": "maxPageSize",
"in": "query",
"description": "Specifies the number of asset versions to include in the response. Valid values range from 1 to 50 (inclusive). Defaults to 8 when not provided.",
"schema": {"type": "integer"}
},
{
"name": "pageToken",
"in": "query",
"description": "A token for pagination. The value is obtained from a previous request and allows for retrieving the next page of asset versions.",
"schema": {"type": "string"}
}
],
"responses": {
"200": {"description": "Asset versions listed successfully."},
"400": {"description": "Bad request - invalid parameters."},
"403": {"description": "Forbidden - API key without Read scope or user doesn't have access."},
"404": {"description": "Asset not found."}
},
"security": [
{
"roblox-api-key": ["Label.Read", "Label.Write"]
},
{
"roblox-oauth2": ["asset:read", "asset:write"]
}
],
"x-roblox-cloud-api-operation-code-samples": [
{
"language": "List Asset Versions",
"script": "curl --location 'https://apis.roblox.com/assets/v1/assets/{assetid}/versions?pageToken=&maxPageSize=' \\\n--header 'x-api-key: {apiKey}'"
}
],
"x-roblox-throttling-limit": {
"perApiKey": {
"periodInSeconds": "60",
"maxInPeriod": 60
}
}
}
},
"/assets/v1/assets/{assetId}/versions:rollback": {
"post": {
"tags": ["Assets"],
"x-roblox-cloud-api-operation": true,
"x-roblox-cloud-api-operation-name": "Rollback Asset Version",
"summary": "Rollback an asset to a previous version.",
"description": "Rollback an asset to a specific previous version.",
"operationId": "Assets_RollbackAssetVersion",
"parameters": [
{
"name": "assetId",
"in": "path",
"description": "The unique identifier of the asset.",
"required": true,
"schema": {"type": "string"}
},
{
"name": "assetVersion",
"in": "formData",
"description": "The asset version path in the format of `assets/{assetId}/versions/{versionNumber}`.",
"required": true,
"schema": {"type": "string"}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"assetVersion": {"type": "string"}
}
}
}
}
},
"responses": {
"200": {"description": "Asset rolled back successfully."},
"400": {"description": "Bad request - invalid request body."},
"403": {"description": "Forbidden - API key without Write scope or user doesn't have access."},
"404": {"description": "Asset or Asset Version not found."}
},
"security": [
{
"roblox-api-key": ["Label.Read", "Label.Write"]
},
{
"roblox-oauth2": ["asset:read", "asset:write"]
}
],
"x-roblox-cloud-api-operation-code-samples": [
{
"language": "Rollback Asset Versions",
"script": "curl --location 'https://apis.roblox.com/assets/v1/assets/{assetid}/versions:rollback' \\\n--header 'x-api-key: {apiKey}' \\\n--header 'Content-Type: application/json' \\\n--data '{\\\"assetVersion\\\":\\\"assets/{assetId}/versions/{versionNumber}\\\"}'"
}
],
"x-roblox-throttling-limit": {
"perApiKey": {
"periodInSeconds": "60",
"maxInPeriod": 60
}
}
}
},
"/v1/operations/{operationId}": {
"get": {
"tags": ["Assets"],
"x-roblox-cloud-api-operation": true,
"x-roblox-cloud-api-operation-name": "Get Operation",
"summary": "Get the result of an asset creation or update.",
"description": "Get the result of an asset creation or update using the returned Operation ID. Requires **Read** for the API key permission and **asset:read** for OAuth 2.0 apps.",
"operationId": "Assets_GetOperation",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Operation"
}
}
}
},
"400": {
"description": "Invalid argument. Failed to parse the request or the file.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
},
"401": {
"description": "The API key is not valid for this operation / You don't have the authorization."
},
"500": {
"description": "Server internal error / Unknown error."
}
},
"security": [
{
"roblox-api-key": ["Label.Read"]
},
{
"roblox-oauth2": ["asset:read"]
}
],
"x-roblox-cloud-api-operation-code-samples": [
{
"language": "Get Operation",
"script": "curl --location 'https://apis.roblox.com/assets/v1/operations/{operationId}' \\\n--header 'x-api-key: {apiKey}'\n"
}
],
"x-roblox-throttling-limit": {
"perApiKey": {
"periodInSeconds": "60",
"maxInPeriod": 60
}
}
}
}
},
"components": {
"schemas": {
"Any": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"description": "The type of the serialized message."
}
},
"description": "Contains an arbitrary serialized message along with a `@type` that describes the type of the serialized message."
},
"Asset": {
"type": "object",
"properties": {
"assetType": {
"type": "string",
"description": "The asset type. Can only be `Audio`, `Decal`, or `Model`. Required for [Create Asset](#POST-v1-assets).",
"format": "enum"
},
"assetId": {
"type": "integer",
"description": "The unique identifier of the asset. Required for [Update Asset](#PATCH-v1-assets-_asset_).",
"format": "int64",
"readOnly": true
},
"creationContext": {
"$ref": "#/components/schemas/CreationContext"
},
"description": {
"type": "string",
"description": "The description of the asset. Limit to 1000 characters. Required for [Create Asset](#POST-v1-assets)."
},
"displayName": {
"type": "string",
"description": "Display name of the asset. Required for [Create Asset](#POST-v1-assets)."
},
"path": {
"type": "string",
"description": "The returned resource path of the asset. Format: `assets/{assetId}`. Example: `assets/2205400862`."
},
"revisionId": {
"type": "string",
"description": "Revision ID of the asset. Equivalent to `versionNumber`. Every change of the asset automatically commits a new version. The format is an integer string. Example: `1`.",
"readOnly": true
},
"revisionCreateTime": {
"type": "string",
"description": "The creation timestamp of the current revision.",
"format": "date-time",
"readOnly": true
},
"moderationResult": {
"$ref": "#/components/schemas/ModerationResult"
},
"icon": {
"type": "string",
"description": "The resource path for the icon."
},
"previews": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Preview"
},
"description": "A list of previews, each with an asset path and alt text. Previews must be either **Image** or **YoutubeVideo** assets."
}
},
"description": "Represents an asset."
},
"CreationContext": {
"type": "object",
"properties": {
"creator": {
"$ref": "#/components/schemas/Creator",
"required": true
},
"expectedPrice": {
"type": "integer",
"description": "Expected asset upload fee in Robux. When the actual price is more than expected, the operation fails with a 400 error.",
"format": "int64",
"writeOnly": true
}
},
"description": "The context of creation that is not part of the asset content, such as metadata and creator information. Required for [Create Asset](#POST-v1-assets)."
},
"Creator": {
"type": "object",
"properties": {
"userId": {
"type": "integer",
"description": "The User ID the creator. Required if the asset is individual-user-owned.",
"format": "int64"
},
"groupId": {
"type": "integer",
"description": "The Group ID. Required if the asset is group-owned.",
"format": "int64"
}
},
"description": "Represents a creator."
},
"ModerationResult": {
"type": "object",
"properties": {
"moderationState": {
"type": "string",
"description": "The moderation state of the asset. Can be `MODERATION_STATE_REVIEWING`, `MODERATION_STATE_REJECTED`, or `MODERATION_STATE_APPROVED`."
}
},
"description": "The moderation result of the asset. "
},
"Operation": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The server-assigned resource path. The default format is `operations/{operation_id}`."
},
"metadata": {
"$ref": "#/components/schemas/Any"
},
"done": {
"type": "boolean",
"description": "If `false`, the operation is still in progress. If `true`, the operation is completed."
},
"error": {
"$ref": "#/components/schemas/Status"
},
"response": {
"$ref": "#/components/schemas/Any"
}
},
"description": "This resource represents a long-running operation that is the result of a network API call."
},
"Preview": {
"type": "object",
"properties": {
"asset": {
"type": "string",
"description": "The preview asset path."
},
"altText": {
"type": "string",
"description": "Alt text for the preview asset."
}
},
"description": "An asset preview."
},
"Status": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"description": "The HTTP status code.",
"format": "int32"
},
"message": {
"type": "string",
"description": "The error message."
},
"details": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Any"
},
"description": "A list of messages carrying error details."
}
},
"description": "The logical error model explaining the error status."
}
},
"securitySchemes": {
"roblox-api-key": {
"type": "apiKey",
"name": "roblox-api-key",
"in": "header"
}
}
},
"tags": [
{
"name": "Assets"
}
]
}