-
Notifications
You must be signed in to change notification settings - Fork 4
/
v1.0.0.yaml
5207 lines (5076 loc) · 198 KB
/
v1.0.0.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
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: ImageKit API
version: 1.0.0
description: |-
Checkout [API overview](/docs/api-overview) to learn about ImageKit's APIs, authentication, rate limits, and error codes etc.
contact:
email: [email protected]
name: ImageKit Team
url: https://imagekit.io
termsOfService: 'https://imagekit.io/terms/'
servers:
- url: https://api.imagekit.io
paths:
/api/v1/files/upload:
servers:
- url: https://upload.imagekit.io
post:
tags:
- Upload File
operationId: upload-file
summary: Upload file V1
description: |
ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expiration` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload.
The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT.
**File size limit** \
On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with higher-tier plans.
**Version limit** \
A file can have a maximum of 100 versions.
**Demo applications**
- A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more.
- [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies.
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/request/FileUploadV1'
responses:
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"200":
description: File uploaded successfully.
content:
application/json:
schema:
$ref: "#/components/responses/Upload"
examples:
Simple image file:
value:
$ref: "#/components/examples/UploadResponseImage"
Simple video file:
value:
$ref: "#/components/examples/UploadResonseVideo"
Image with EmbeddedMetadata:
value:
$ref: "#/components/examples/UploadResponseWithEmbeddedMetadata"
"202":
description: File accepted for upload. Pre transformation for video is being processed.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: The pre-transformation has been queued successfully.
"400":
description: Bad request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Your request is missing file parameter.
- Your request contains both signature and basic auth parameter. Use only one method, you might be exposing your private API key.
- Your request contains invalid expire parameter. Expire parameter should be a Unix time in less than 1 hour into the future.
- A file with the same name already exists at the exact location. We could not overwrite it because both overwriteFile and useUniqueFileName are set to false.
- Your request contains invalid file parameter. The file size exceeds limits.
- Upload Limit Exceeded.
- Extensions quota exceeded.
- The file could not be uploaded because the transformation field is invalid.
- The file could not be uploaded because transformations are supported only for image and video files.
- The file could not be uploaded because the detected file type & post-transformation are incompatible.
- You have sent too many requests to update the file recently. Please try again later.
- Your request contains invalid syntax for the checks parameter.
- Your request failed 'checks' validation.
help:
type: string
example: For support kindly contact us at [email protected].
/api/v2/files/upload:
servers:
- url: https://upload.imagekit.io
post:
tags:
- Upload File
operationId: upload-file-v2
summary: Upload file V2
description: |
The V2 API enhances security by verifying the entire payload using JWT. This API is in beta.
ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload.
**File size limit** \
On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files, and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files, and 2GB for videos. These limits can be further increased with higher-tier plans.
**Version limit** \
A file can have a maximum of 100 versions.
**Demo applications**
- A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more.
- [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies.
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/request/FileUploadV2'
responses:
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"200":
description: File uploaded successfully.
content:
application/json:
schema:
$ref: "#/components/responses/Upload"
examples:
Simple image file:
value:
$ref: "#/components/examples/UploadResponseImage"
Simple video file:
value:
$ref: "#/components/examples/UploadResonseVideo"
Image with EmbeddedMetadata:
value:
$ref: "#/components/examples/UploadResponseWithEmbeddedMetadata"
"202":
description: File accepted for upload. Pre transformation for video is being processed.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: The pre-transformation has been queued successfully.
"400":
description: Bad request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Your request is missing file parameter.
- Your request contains both token and basic auth parameter. Use only one method, you might be exposing your private API key.
- Your request contains invalid payload. It does not match with the payload used to generate token.
- Your request is missing token parameter.
- Your request contains expired token.
- Your request has invalid token.
- A file with the same name already exists at the exact location. We could not overwrite it because both overwriteFile and useUniqueFileName are set to false.
- Your request contains invalid file parameter. The file size exceeds limits.
- Upload Limit Exceeded.
- Extensions quota exceeded.
- The file could not be uploaded because the transformation field is invalid.
- The file could not be uploaded because transformations are supported only for image and video files.
- The file could not be uploaded because the detected file type & post-transformation are incompatible.
- You have sent too many requests to update the file recently. Please try again later.
- Your request contains invalid syntax for the checks parameter.
- Your request failed 'checks' validation.
help:
type: string
example: For support kindly contact us at [email protected].
/v1/customMetadataFields:
post:
summary: Create new field
operationId: create-new-field
description: |
This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API.
requestBody:
content:
application/json:
schema:
type: object
required:
- name
- label
- schema
properties:
name:
type: string
description: API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields.
label:
type: string
description: Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI.
schema:
type: object
required:
- type
properties:
type:
description: Type of the custom metadata field.
type: string
enum:
- Text
- TextArea
- Number
- Date
- Boolean
- SingleSelect
- MultiSelect
selectOptions:
type: array
items: {}
description: |
An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`.
example:
- small
- medium
- large
- 30
- 40
- true
defaultValue:
description: |
The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field.
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
description: |
Default value should be of type array when custom metadata field type is set to `MultiSelect`.
example:
- true
- 10
- Hello
isValueRequired:
type: boolean
description: |
Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body.
minValue:
description: |
Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.
oneOf:
- type: string
- type: number
maxValue:
description: |
Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.
oneOf:
- type: string
- type: number
minLength:
description: |
Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`.
type: number
maxLength:
description: |
Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`.
type: number
example:
name: price
label: price
schema:
type: Number
minValue: 1000
maxValue: 3000
responses:
"429":
$ref: '#/components/responses/RateLimitExceeded'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"201":
description: Custom metadata field created successfully.
content:
application/json:
schema:
$ref: "#/components/responses/CustomMetadataField"
example:
id: 598821f949c0a938d57563dd
name: price
label: price
schema:
type: Number
minValue: 1000
maxValue: 3000
"400":
description: Bad Request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: A custom metadata field with this name already exists.
help:
type: string
example: For support kindly contact us at [email protected].
tags:
- Digital Asset Management (DAM)
- Custom metadata fields
get:
tags:
- Digital Asset Management (DAM)
- Custom metadata fields
operationId: list-all-fields
summary: List all fields
description: This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response.
parameters:
- description: |
Set it to `true` to include deleted field objects in the API response. Default value is `false`.
in: query
name: includeDeleted
required: false
schema:
type: boolean
default: false
responses:
"429":
$ref: '#/components/responses/RateLimitExceeded'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"200":
description: Array of custom metadata field objects.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/responses/CustomMetadataField"
example:
- id: 598821f949c0a938d57563dd
name: brand
label: brand
schema:
type: Text
defaultValue: Nike
- id: 865421f949c0a835d57563dd
name: price
label: price
schema:
type: Number
minValue: 1000
maxValue: 3000
/v1/files/{fileId}/details:
get:
tags:
- Digital Asset Management (DAM)
- Managing assets
operationId: get-file-details
summary: Get file details
description: This API returns an object with details or attributes about the current version of the file.
parameters:
- description: |
The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API.
in: path
name: fileId
required: true
schema:
type: string
responses:
"429":
$ref: '#/components/responses/RateLimitExceeded'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"200":
description: File details object.
content:
application/json:
schema:
$ref: "#/components/responses/FileDetails"
example:
fileId: 598821f949c0a938d57563bd
type: file
name: file.jpg
filePath: /images/products/file.jpg
tags:
- t-shirt
- round-neck
- sale2019
AITags:
- name: Shirt
confidence: 90.12
source: google-auto-tagging
- name: T-shirt
confidence: 80.12
source: aws-auto-tagging
versionInfo:
id: 598821f949c0a938d57563bd
name: Version 1
isPrivateFile: false
isPublished: true
customCoordinates: null
url: https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?updatedAt=1566630881313
thumbnail: https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?updatedAt=1566630881313&tr=n-ik_ml_thumbnail
fileType: image
mime: image/jpeg
width: 100
height: 100
size: 100
hasAlpha: false
customMetadata:
brand: Nike
color: red
createdAt: "2019-08-24T06:14:41.313Z"
updatedAt: "2019-08-24T06:14:41.313Z"
"404":
description: File not found.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: The requested file does not exist.
help:
type: string
example: For support kindly contact us at [email protected].
"400":
description: Bad Request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Your request contains invalid fileId parameter.
help:
type: string
example: For support kindly contact us at [email protected].
patch:
tags:
- Digital Asset Management (DAM)
- Managing assets
operationId: update-file-details
summary: Update file details
description: |
This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API.
parameters:
- description: |
The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API.
in: path
name: fileId
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
oneOf:
- title: Update file details
type: object
properties:
removeAITags:
oneOf:
- type: array
items:
type: string
- type: string
enum: ["all"]
description: |
An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`.
If you want to remove all AITags associated with the file, send a string - "all".
Note: The remove operation for `AITags` executes before any of the `extensions` are processed.
webhookUrl:
type: string
description: |
The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure.
extensions:
type: array
items:
anyOf:
- $ref: '#/components/request/RemovedotBGExtension'
- $ref: '#/components/request/AutoTaggingExtension'
description: >
Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type.
tags:
type: array
items:
type: string
description: >
An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file.
nullable: true
example: ["tag1", "tag2"]
x-nullable-description: >
Send `null` to unset all tags associated with the file.
customCoordinates:
type: string
nullable: true
description: |
Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value.
x-nullable-description: >
Send `null` to unset this value.
customMetadata:
type: object
description: |
A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API.
- title: Change publication status
type: object
properties:
publish:
type: object
required: ["isPublished"]
description: |
Configure the publication status of a file and its versions.
properties:
isPublished:
type: boolean
description: |
Set to `true` to publish the file. Set to `false` to unpublish the file.
includeFileVersions:
type: boolean
description: |
Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file.
example:
removeAITags: ["car", "vehicle", "motorsports"]
webhookUrl: https://webhook.site/0d6b6c7a-8e5a-4b3a-8b7c-0d6b6c7a8e5a
extensions:
[
{ "name": "remove-bg", "options": { "add_shadow": true } },
{
"name": "google-auto-tagging",
"minConfidence": 80,
"maxTags": 10,
},
{
"name": "aws-auto-tagging",
"minConfidence": 80,
"maxTags": 10,
},
]
tags: ["tag1", "tag2"]
customCoordinates: "10,10,100,100"
customMetadata: { "brand": "Nike", "color": "red" }
responses:
"429":
$ref: '#/components/responses/RateLimitExceeded'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"200":
description: Updated file details object.
content:
application/json:
schema:
allOf:
- $ref: "#/components/responses/FileDetails"
- type: object
properties:
extensionStatus:
type: object
properties:
google-auto-tagging:
type: string
enum: ["success", "pending", "failed"]
aws-auto-tagging:
type: string
enum: ["success", "pending", "failed"]
remove-bg:
type: string
enum: ["success", "pending", "failed"]
example:
fileId: 598821f949c0a938d57563bd
type: file
name: file1.jpg
filePath: /images/products/file.jpg
isPublished: true
tags:
- t-shirt
- round-neck
- sale2019
AITags:
- name: Shirt
confidence: 90.12
source: google-auto-tagging
- name: T-shirt
confidence: 80.12
source: aws-auto-tagging
versionInfo:
id: 598821f949c0a938d57563bd
name: Version 1
isPrivateFile: false
customCoordinates: null
url: https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?updatedAt=1566630881313
thumbnail: https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?updatedAt=1566630881313&tr=n-ik_ml_thumbnail
fileType: image
mime: image/jpeg
width: 100
height: 100
size: 100
hasAlpha: false
customMetadata:
brand: Nike
color: red
createdAt: "2019-08-24T06:14:41.313Z"
updatedAt: "2019-08-24T06:14:41.313Z"
extensionStatus:
google-auto-tagging: "success"
remove-bg: "pending"
"404":
description: File not found.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: The requested file does not exist.
help:
type: string
example: For support kindly contact us at [email protected].
"400":
description: Bad request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Invalid custom metadata.
- Your request contains invalid fileId parameter.
help:
type: string
example: For support kindly contact us at [email protected].
errors:
type: object
/v1/customMetadataFields/{id}:
patch:
tags:
- Digital Asset Management (DAM)
- Custom metadata fields
operationId: update-existing-field
summary: Update existing field
description: |
This API updates the label or schema of an existing custom metadata field.
parameters:
- description: |
Should be a valid custom metadata field id.
in: path
name: id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
label:
type: string
description: Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided.
schema:
type: object
description: |
An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`.
properties:
selectOptions:
type: array
items: {}
description: |
An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`.
example:
- small
- medium
- large
- 30
- 40
- true
defaultValue:
description: |
The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field.
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
description: |
Default value should be of type array when custom metadata field type is set to `MultiSelect`.
example:
- true
- 10
- Hello
isValueRequired:
type: boolean
description: |
Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body.
minValue:
description: |
Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.
oneOf:
- type: string
- type: number
maxValue:
description: |
Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value.
oneOf:
- type: string
- type: number
minLength:
description: |
Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`.
type: number
maxLength:
description: |
Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`.
type: number
example:
label: price
schema:
type: Number
minValue: 1000
maxValue: 3000
responses:
"429":
$ref: '#/components/responses/RateLimitExceeded'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"400":
description: Bad request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Cannot update a deleted custom metadata fields.
- Either label or schema should be provided.
- A custom metadata field with this label already exists.
- Invalid schema object.
- Name cannot be updated.
- Missing id parameter.
- Your request contains invalid ID parameter.
help:
type: string
example: For support kindly contact us at [email protected].
"404":
description: Custom metadata field doesn't exist.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: No such custom metadata field exists.
help:
type: string
example: For support kindly contact us at [email protected].
"200":
description: Custom metadata field updated successfully.
content:
application/json:
schema:
$ref: "#/components/responses/CustomMetadataField"
example:
id: 598821f949c0a938d57563dd
name: price
label: price
schema:
type: Number
minValue: 1000
maxValue: 3000
delete:
tags:
- Digital Asset Management (DAM)
- Custom metadata fields
operationId: delete-a-field
summary: Delete a field
description: |
This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name.
parameters:
- description: |
Should be a valid custom metadata field id.
in: path
name: id
required: true
schema:
type: string
responses:
"429":
$ref: '#/components/responses/RateLimitExceeded'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"400":
description: Bad request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Missing id parameter.
- Your request contains invalid ID parameter.
help:
type: string
example: For support kindly contact us at [email protected].
"404":
description: Custom metadata field doesn't exist.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: No such custom metadata field exists.
help:
type: string
example: For support kindly contact us at [email protected].
"204":
description: Custom metadata field deleted successfully.
content:
application/json:
schema:
type: object
/v1/files:
get:
tags:
- Digital Asset Management (DAM)
operationId: list-and-search-assets
summary: List and search assets
description: |
This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`.
parameters:
- in: query
name: type
required: false
description: |
Limit search to one of `file`, `file-version`, or `folder`. Pass `all` to include `files` and `folders` in search results (`file-version` will not be included in this case).
Default value - `file`
schema:
type: string
enum:
- file
- file-version
- folder
- all
- in: query
name: sort
required: false
description: |
You can sort based on the following fields:
1. name - `ASC_NAME` or `DESC_NAME`
2. createdAt - `ASC_CREATED` or `DESC_CREATED`
3. updatedAt - `ASC_UPDATED` or `DESC_UPDATED`
4. height - `ASC_HEIGHT` or `DESC_HEIGHT`
5. width - `ASC_WIDTH` or `DESC_WIDTH`
6. size - `ASC_SIZE` or `DESC_SIZE`
Default value - `ASC_CREATED`
schema:
type: string
- in: query
name: path
required: false
description: |
Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner.
schema:
type: string
- in: query
name: searchQuery
required: false
description: |
Query string in a Lucene-like query language e.g. `createdAt > "7d"`.
Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result:
1. `tags`
2. `type`
3. `name`
[Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples.
schema:
type: string
- in: query
name: fileType
required: false
description: |
Type of files to include in the result set. Accepts three values:
`all` - include all types of files in the result set.
`image` - only search in image type files.
`non-image` - only search in files that are not images, e.g., JS or CSS or video files.
Default value - `all`
schema:
type: string
- in: query
name: limit
required: false
description: |
The maximum number of results to return in response:
Minimum value - 1
Maximum value - 1000
Default value - 1000
schema:
type: string
- in: query
name: skip
required: false
description: |
The number of results to skip before returning results:
Minimum value - 0
Default value - 0
schema:
type: string
responses:
"429":
$ref: '#/components/responses/RateLimitExceeded'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"200":
description: List of assets.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/responses/FileDetails"
example:
- fileId: 598821f949c0a938d57563bd
type: file
name: file.jpg
filePath: /images/products/file.jpg
tags:
- t-shirt
- round-neck
- sale2019
AITags:
- name: Shirt
confidence: 90.12
source: google-auto-tagging
- name: T-shirt
confidence: 80.12
source: aws-auto-tagging
versionInfo:
id: 598821f949c0a938d57563bd
name: Version 2
isPrivateFile: false
customCoordinates: null
url: https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?updatedAt=1566630881313
thumbnail: https://ik.imagekit.io/your_imagekit_id/images/products/file.jpg?updatedAt=1566630881313&tr=n-ik_ml_thumbnail
fileType: image
mime: image/jpeg
width: 100
height: 100
size: 100
hasAlpha: false