openapi: 3.0.0
info:
  title: Upload API Reference
  version: '2024-02-12'
  description: |
    ### Summary
    Upload API provides several ways of uploading files to Uploadcare servers in a
    secure and reliable way.

    ### API endpoints
    Upload API's root is located at `https://upload.uploadcare.com/`.
    **Note**: All API endpoints end with a forward slash `/`. Please do not forget to include it.

    ### API clients
    Please check out [API clients](https://uploadcare.com/docs/integrations/) page for a
    list of official and third party Upload API clients.

    ### File storage
    Every uploaded file is **temporary** by nature and subject to be deleted within a
    24-hour period. **Mark the file as stored** to make it permanent:
    * On upload via the [`UPLOADCARE_STORE` flag](/docs/api/upload/upload/base-upload)
    * [Store](/docs/api/rest/file/store-file) or
      [copy](/docs/api/rest/file/create-local-copy) an already uploaded
      file via [REST API](/docs/api/rest/).

    **Note**: `UPLOADCARE_STORE=auto` parameter delegates the choice of the
    file storing behavior to a project
    [auto-store](https://app.uploadcare.com/projects/-/settings/#storage)
    setting (which is enabled by default).

    ### File delivery
    Once uploaded, your files become available via our [CDN](https://uploadcare.com/docs/delivery/).
    The CDN includes on the fly image processing features and can work as a proxy.
    Please check the referenced page to learn more.
  contact:
    name: API support
    email: help@uploadcare.com
  x-logo:
    url: https://ucarecdn.com/a539fa00-92d4-475d-a475-f14782e87422/logouploadapi.svg
    backgroundColor: '#fafafa'
    altText: Uploadcare Upload API Reference
  x-meta:
    title: Upload API Reference — Uploadcare
    description: Complete reference documentation for the Uploadcare's Upload API. Covers endpoints, requests, their parameters, and response examples.
servers:
  - url: https://upload.uploadcare.com
    description: Production server
tags:
  - name: Integrations
    description: |
      You don't have to code most of the low-level API interactions.
      We have high-level [libraries](https://uploadcare.com/docs/integrations/) for all popular platforms:
      * [JavaScript](https://uploadcare.com/docs/integrations/javascript/)
      * [PHP](https://uploadcare.com/docs/integrations/php/)
      * [Python](https://uploadcare.com/docs/integrations/python/) (including Django)
      * [Ruby](https://uploadcare.com/docs/integrations/ruby/) and [Rails](https://uploadcare.com/docs/integrations/rails/)
      * [Swift](https://uploadcare.com/docs/integrations/swift/) (iOS, iPadOS, macOS, tvOS, Linux)
      * [Kotlin](https://uploadcare.com/docs/integrations/android/) (Android)
      * [Java](https://uploadcare.com/docs/integrations/java/)
      * [Golang](https://uploadcare.com/docs/integrations/golang/)
      * [Rust](https://uploadcare.com/docs/integrations/rust/)

      In this API reference, you will see request examples in different languages.
      Keep in mind that running sample queries requires our libraries to be installed and initialized.
  - name: Upload
  - name: Groups
  - name: Errors
    description: |
      If the request fails, Upload API returns an error response.
      Error responses are returned in the form of a JSON object with an error code, an HTTP status code and an error message.
      The following errors are possible.
      <table>
        <tr>
          <th>Error code</th>
          <th>HTTP status code</th>
          <th>Error message</th>
        </tr>

        <tr>
          <td colspan="3" style="font-weight: bold;">Base upload errors:</td>
        </tr>
        <tr>
          <td>AccountBlockedError</td>
          <td>403</td>
          <td>Account has been blocked.</td>
        </tr>
        <tr>
          <td>AccountLimitsExceededError</td>
          <td>403</td>
          <td>Account has reached its limits.</td>
        </tr>
        <tr>
          <td>AccountUnpaidError</td>
          <td>403</td>
          <td>Account has been blocked for non payment.</td>
        </tr>
        <tr>
          <td>AutostoreDisabledError</td>
          <td>403</td>
          <td>Autostore is disabled.</td>
        </tr>
        <tr>
          <td>BaseViewsError</td>
          <td>400</td>
          <td>Request processing failed.</td>
        </tr>
        <tr>
          <td>FileMetadataKeyDuplicatedError</td>
          <td>400</td>
          <td>File's metadata key `%s` has a duplicate.</td>
        </tr>
        <tr>
          <td>FileMetadataKeyEmptyError</td>
          <td>400</td>
          <td>File's metadata key can not be empty.</td>
        </tr>
        <tr>
          <td>FileMetadataKeyForbiddenError</td>
          <td>400</td>
          <td>File's metadata key `%s` contains symbols not allowed by the metadata key format.</td>
        </tr>
        <tr>
          <td>FileMetadataKeyLengthTooBigError</td>
          <td>400</td>
          <td>Length of file metadata key `%s` can not be more than %d symbols.</td>
        </tr>
        <tr>
          <td>FileMetadataKeysNumberTooBigError</td>
          <td>400</td>
          <td>A file can not have more than %d metadata keys.</td>
        </tr>
        <tr>
          <td>FileMetadataValueEmptyError</td>
          <td>400</td>
          <td>Value of the file metadata key `%s` can not be empty.</td>
        </tr>
        <tr>
          <td>FileMetadataValueForbiddenError</td>
          <td>400</td>
          <td>Value of file metadata key `%s` contains symbols not allowed by the metadata value format.</td>
        </tr>
        <tr>
          <td>FileMetadataValueLengthTooBigError</td>
          <td>400</td>
          <td>Value of file metadata's key `%s` can not be more than %d symbols in length.</td>
        </tr>
        <tr>
          <td>FileSizeLimitExceededError</td>
          <td>400</td>
          <td>File is too large.</td>
        </tr>
        <tr>
          <td>MethodNotAllowedError</td>
          <td>405</td>
          <td>HTTP method %s is not allowed for %s</td>
        </tr>
        <tr>
          <td>NullCharactersForbiddenError</td>
          <td>400</td>
          <td>Null characters are not allowed.</td>
        </tr>
        <tr>
          <td>PostRequestParserFailedError</td>
          <td>400</td>
          <td>HTTP POST request parsing failed.</td>
        </tr>
        <tr>
          <td>ProjectPublicKeyInvalidError</td>
          <td>403</td>
          <td>%s is invalid.</td>
        </tr>
        <tr>
          <td>ProjectPublicKeyRemovedError</td>
          <td>403</td>
          <td>Project %s is marked as removed.</td>
        </tr>
        <tr>
          <td>ProjectPublicKeyRequiredError</td>
          <td>403</td>
          <td>%s is required.</td>
        </tr>
        <tr>
          <td>RequestFileNumberLimitExceededError</td>
          <td>400</td>
          <td>The request contains too many files.</td>
        </tr>
        <tr>
          <td>RequestFiledsNumberLimitExceededError</td>
          <td>400</td>
          <td>The request contains too many HTTP POST fields.</td>
        </tr>
        <tr>
          <td>RequestSizeLimitExceededError</td>
          <td>413</td>
          <td>The size of the request is too large.</td>
        </tr>
        <tr>
          <td>RequestThrottledError</td>
          <td>429</td>
          <td>Request was throttled.</td>
        </tr>
        <tr>
          <td>SignatureExpirationError</td>
          <td>403</td>
          <td>Expired signature.</td>
        </tr>
        <tr>
          <td>SignatureExpirationInvalidError</td>
          <td>400</td>
          <td>`expire` must be a UNIX timestamp.</td>
        </tr>
        <tr>
          <td>SignatureExpirationRequiredError</td>
          <td>400</td>
          <td>`expire` is required.</td>
        </tr>
        <tr>
          <td>SignatureInvalidError</td>
          <td>403</td>
          <td>Invalid signature.</td>
        </tr>
        <tr>
          <td>SignatureRequiredError</td>
          <td>400</td>
          <td>`signature` is required.</td>
        </tr>
        <tr>
          <td>UploadAPIError</td>
          <td>500</td>
          <td>Internal error.</td>
        </tr>
        <tr>
          <td>UploadFailedError</td>
          <td>403</td>
          <td>Upload failed.</td>
        </tr>

        <tr>
          <td colspan="3" style="font-weight: bold;">FromURL upload errors:</td>
        </tr>
        <tr>
          <td>DownloadFileError</td>
          <td>500</td>
          <td>Failed to download the file.</td>
        </tr>
        <tr>
          <td>DownloadFileHTTPClientError</td>
          <td>500</td>
          <td>HTTP client error: %s.</td>
        </tr>
        <tr>
          <td>DownloadFileHTTPNetworkError</td>
          <td>500</td>
          <td>HTTP network error: %s.</td>
        </tr>
        <tr>
          <td>DownloadFileHTTPServerError</td>
          <td>500</td>
          <td>HTTP server error: %s.</td>
        </tr>
        <tr>
          <td>DownloadFileHTTPURLValidationError</td>
          <td>500</td>
          <td>HTTP URL validation error: %s.</td>
        </tr>
        <tr>
          <td>DownloadFileInternalServerError</td>
          <td>500</td>
          <td>Internal server error.</td>
        </tr>
        <tr>
          <td>DownloadFileNotFoundError</td>
          <td>500</td>
          <td>downloaded file not found.</td>
        </tr>
        <tr>
          <td>DownloadFileSizeLimitExceededError</td>
          <td>500</td>
          <td>Downloaded file is too big: %s > %s.</td>
        </tr>
        <tr>
          <td>DownloadFileTaskFailedError</td>
          <td>500</td>
          <td>download task failed.</td>
        </tr>
        <tr>
          <td>DownloadFileTimeLimitExceededError</td>
          <td>500</td>
          <td>Failed to download the file within the allotted time limit of %s seconds.</td>
        </tr>
        <tr>
          <td>DownloadFileValidationFailedError</td>
          <td>500</td>
          <td>File validation error: %s</td>
        </tr>

        <tr>
          <td colspan="3" style="font-weight: bold;">File upload errors:</td>
        </tr>
        <tr>
          <td>FileIdInvalidError</td>
          <td>400</td>
          <td>file_id is invalid.</td>
        </tr>
        <tr>
          <td>FileIdNotUniqueError</td>
          <td>400</td>
          <td>File id must be unique.</td>
        </tr>
        <tr>
          <td>FileIdRequiredError</td>
          <td>400</td>
          <td>file_id is required.</td>
        </tr>
        <tr>
          <td>FileNotFoundError</td>
          <td>404</td>
          <td>File is not found.</td>
        </tr>
        <tr>
          <td>FileRequiredError</td>
          <td>400</td>
          <td>There should be a file.</td>
        </tr>
        <tr>
          <td>FilesNumberLimitExceededError</td>
          <td>400</td>
          <td>There are too many files.</td>
        </tr>
        <tr>
          <td>FilesRequiredError</td>
          <td>400</td>
          <td>Request does not contain files.</td>
        </tr>
        <tr>
          <td>InternalRequestForbiddenError</td>
          <td>403</td>
          <td>Forbidden request.</td>
        </tr>
        <tr>
          <td>InternalRequestInvalidError</td>
          <td>400</td>
          <td>Incorrect request.</td>
        </tr>
        <tr>
          <td>MultipartFileAlreadyUploadedError</td>
          <td>400</td>
          <td>File is already uploaded.</td>
        </tr>
        <tr>
          <td>MultipartFileCompletionFailedError</td>
          <td>400</td>
          <td>Can not complete upload. Wrong parts size?</td>
        </tr>
        <tr>
          <td>MultipartFileIdRequiredError</td>
          <td>400</td>
          <td>uuid is required.</td>
        </tr>
        <tr>
          <td>MultipartFileNotFoundError</td>
          <td>404</td>
          <td>File is not found.</td>
        </tr>
        <tr>
          <td>MultipartFileSizeLimitExceededError</td>
          <td>400</td>
          <td>File size exceeds project limit.</td>
        </tr>
        <tr>
          <td>MultipartFileSizeTooSmallError</td>
          <td>400</td>
          <td>File size can not be less than %d bytes. Please use direct upload instead of multipart.</td>
        </tr>
        <tr>
          <td>MultipartPartSizeInvalidError</td>
          <td>400</td>
          <td>Multipart Upload Part Size should be an integer.</td>
        </tr>
        <tr>
          <td>MultipartPartSizeTooBigError</td>
          <td>400</td>
          <td>Multipart Upload Part Size can not be more than %d bytes.</td>
        </tr>
        <tr>
          <td>MultipartPartSizeTooSmallError</td>
          <td>400</td>
          <td>Multipart Upload Part Size can not be less than %d bytes.</td>
        </tr>
        <tr>
          <td>MultipartSizeInvalidError</td>
          <td>400</td>
          <td>size should be integer.</td>
        </tr>
        <tr>
          <td>MultipartUploadSizeTooLargeError</td>
          <td>400</td>
          <td>Uploaded size is more than expected.</td>
        </tr>
        <tr>
          <td>MultipartUploadSizeTooSmallError</td>
          <td>400</td>
          <td>File size mismatch. Not all parts uploaded?</td>
        </tr>
        <tr>
          <td>RequestParamRequiredError</td>
          <td>400</td>
          <td>%s is required.</td>
        </tr>
        <tr>
          <td>SourceURLRequiredError</td>
          <td>400</td>
          <td>source_url is required.</td>
        </tr>
        <tr>
          <td>TokenRequiredError</td>
          <td>400</td>
          <td>token is required.</td>
        </tr>
        <tr>
          <td>UUIDInvalidError</td>
          <td>400</td>
          <td>uuid is invalid.</td>
        </tr>
        <tr>
          <td>UploadViewsError</td>
          <td>400</td>
          <td>Upload request processing failed.</td>
        </tr>
        <tr>
          <td>UploadcareFileIdDuplicatedError</td>
          <td>400</td>
          <td>UPLOADCARE_FILE_ID is duplicated. You are probably a lottery winner.</td>
        </tr>
        <tr>
          <td>UploadcareFileIdInvalidError</td>
          <td>400</td>
          <td>UPLOADCARE_FILE_ID should be a valid UUID.</td>
        </tr>
        <tr>
          <td>UploadcareFileIdRequiredError</td>
          <td>400</td>
          <td>UPLOADCARE_FILE_ID is required.</td>
        </tr>

        <tr>
          <td colspan="3" style="font-weight: bold;">File group errors:</td>
        </tr>
        <tr>
          <td>GroupFileURLParsingFailedError</td>
          <td>400</td>
          <td>This is not valid file url: %s.</td>
        </tr>
        <tr>
          <td>GroupFilesInvalidError</td>
          <td>400</td>
          <td>No files[N] parameters found.</td>
        </tr>
        <tr>
          <td>GroupFilesNotFoundError</td>
          <td>400</td>
          <td>Some files not found.</td>
        </tr>
        <tr>
          <td>GroupIdRequiredError</td>
          <td>400</td>
          <td>group_id is required.</td>
        </tr>
        <tr>
          <td>GroupNotFoundError</td>
          <td>404</td>
          <td>group_id is invalid.</td>
        </tr>
        <tr>
          <td>GroupViewsError</td>
          <td>400</td>
          <td>Request to group processing failed.</td>
        </tr>

        <tr>
          <td colspan="3" style="font-weight: bold;">File content validation errors:</td>
        </tr>
        <tr>
          <td>SVGValidationFailedError</td>
          <td>400</td>
          <td>SVG validation failed: %s.</td>
        </tr>
        <tr>
          <td>SVGMaliciousContentError</td>
          <td>400</td>
          <td>SVG contains malicious content: %s.</td>
        </tr>
        <tr>
          <td>FileInfectedError</td>
          <td>400</td>
          <td>The file is infected by %s virus.</td>
        </tr>
        <tr>
          <td>FileTypeForbiddenError</td>
          <td>400</td>
          <td>Uploading of these file types is not allowed.</td>
        </tr>

        <tr>
          <td colspan="3" style="font-weight: bold;">URL validation errors:</td>
        </tr>
        <tr>
          <td>HostnameNotFoundError</td>
          <td>400</td>
          <td>Host does not exist.</td>
        </tr>
        <tr>
          <td>URLBlacklistedError</td>
          <td>400</td>
          <td>Source is blacklisted.</td>
        </tr>
        <tr>
          <td>URLHostMalformedError</td>
          <td>400</td>
          <td>URL host is malformed.</td>
        </tr>
        <tr>
          <td>URLHostPrivateIPForbiddenError</td>
          <td>400</td>
          <td>Only public IPs are allowed.</td>
        </tr>
        <tr>
          <td>URLHostRequiredError</td>
          <td>400</td>
          <td>No URL host supplied.</td>
        </tr>
        <tr>
          <td>URLParsingFailedError</td>
          <td>400</td>
          <td>Failed to parse URL.</td>
        </tr>
        <tr>
          <td>URLRedirectsLimitExceededError</td>
          <td>400</td>
          <td>Too many redirects.</td>
        </tr>
        <tr>
          <td>URLSchemeInvalidError</td>
          <td>400</td>
          <td>Invalid URL scheme.</td>
        </tr>
        <tr>
          <td>URLSchemeRequiredError</td>
          <td>400</td>
          <td>No URL scheme supplied.</td>
        </tr>
        <tr>
          <td>URLValidationError</td>
          <td>400</td>
          <td>Failed to validate URL.</td>
        </tr>

      </table>
  - name: Other APIs
    description: |
      You can find the complete reference documentation for the REST API [here](/docs/api/rest/) and URL API [here](/docs/api/url/).
paths:
  /base/:
    post:
      tags:
        - Upload
      operationId: baseUpload
      summary: Direct uploads
      description: |
        Direct file uploads comply with the [RFC 7578](https://www.rfc-editor.org/rfc/rfc7578) standard.
        In other words, you can perform a direct upload by making an HTTP POST request with the Content-Type
        header set to `multipart/form-data`.

        **Note**: Direct file uploads support files smaller than 100 megabytes only.
        If you would like to upload larger files, please use [Multipart Uploads](/docs/api/upload/upload/multipart-file-upload-start) instead.

        File upload example with curl:

        ```
        curl -X POST https://upload.uploadcare.com/base/ \
             -F UPLOADCARE_PUB_KEY="demopublickey" \
             -F UPLOADCARE_STORE="auto" \
             -F "metadata[subsystem]"="uploader" \
             -F "metadata[pet]"="cat" \
             -F file=@"my file.jpeg"
        ```
      requestBody:
        $ref: '#/components/requestBodies/baseUploadRequestBody'
      responses:
        '200':
          $ref: '#/components/responses/baseUploadSuccessful'
        '400':
          $ref: '#/components/responses/baseUploadInputValidationErrors'
        '403':
          $ref: '#/components/responses/commonUploadAccessForbiddenErrors'
        '413':
          $ref: '#/components/responses/requestSizeLimitExceededError'
        '429':
          $ref: '#/components/responses/requestWasThrottledError'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { base } from '@uploadcare/upload-client'

            // fileData must be `Blob` or `File` or `Buffer`
            const result = await base(
              fileData,
              {
                publicKey: 'YOUR_PUBLIC_KEY',
                store: 'auto',
                metadata: {
                  subsystem: 'uploader',
                  pet: 'cat'
                }
              }
            )
        - lang: PHP
          label: PHP
          source: |
            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $fileInfo = $uploader->fromPath(__DIR__ . '/squirrel.jpg', null, null, 'auto', [
                'system' => 'php-uploader',
                'pet' => 'cat',
            ]);
            echo \sprintf("URL: %s, ID: %s, Mime type: %s\n", $fileInfo->getUrl(), $fileInfo->getUuid(), $fileInfo->getMimeType());
            foreach ($fileInfo->getMetadata() as $key => $value) {
                echo \sprintf("%s: %s\n", $key, $value);
            }
        - lang: Python
          label: Python
          source: |
            from pyuploadcare import Uploadcare, File

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            with open('test1.txt', 'rb') as file_object:
                ucare_file = uploadcare.upload(file_object)
        - lang: Ruby
          label: Ruby
          source: |
            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            source_file = File.open('image.png')
            Uploadcare::Uploader.upload(source_file, store: 'auto')
        - lang: Swift
          label: Swift
          source: |
            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            guard let url = Bundle.main.url(forResource: "squirrel", withExtension: "jpg"),
                  let data = try? Data(contentsOf: url) else { return }
            let metadata = ["subsystem": "uploader", "pet": "cat"]

            let file = try await uploadcare.uploadFile(data, withName: "random_file_name.jpg", store: .auto) { progress in
              print("progress: \(progress)")
            }
            prkint(file)
        - lang: Kotlin
          label: Kotlin
          source: |
            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
            val file = FileUploader(uploadcare, uri = uri, context = context).upload()
            Log.d("TAG", file.toString())
  /multipart/start/:
    post:
      tags:
        - Upload
      operationId: multipartFileUploadStart
      summary: Start multipart upload
      description: |
        Multipart uploads should be used if you need to upload files larger than 100 megabytes or if you want to
        explicitly trigger [AWS S3 Transfer Acceleration](https://aws.amazon.com/s3/transfer-acceleration/).
        When you use Multipart Uploads your files go straight to AWS S3 bypassing our upload instances.

        To upload large files, 3 requests are sent in sequence:
        1. `/multipart/start/`
        2. `<presigned-url-x>`
        3. `/multipart/complete/`.

        **Note**: Multipart uploads support files larger than 10 megabytes only.
      requestBody:
        $ref: '#/components/requestBodies/multipartUploadStartParameters'
      responses:
        '200':
          $ref: '#/components/responses/multipartUploadStartResponse'
        '400':
          $ref: '#/components/responses/multipartUploadStartInputValidationErrors'
        '403':
          $ref: '#/components/responses/commonUploadAccessForbiddenErrors'
        '429':
          $ref: '#/components/responses/requestWasThrottledError'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { multipartStart } from '@uploadcare/upload-client'

            const result = await multipartStart(
              27796904,
              {
                publicKey: 'YOUR_PUBLIC_KEY',
                store: 'auto',
                fileName: 'myfile.mp4',
                contentType: 'video/mp4',
                metadata: {
                  subsystem: 'uploader',
                  pet: 'cat'
                }
              }
            )
        - lang: PHP
          label: PHP
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $path = '/path-to-large-file.zip';
            $handle = \fopen($path, 'rb');
            $response = $uploader->fromResource($handle, null, null, 'auto', [
                'size' => \filesize($path), // The "size" is the metadata key
            ]);
            echo \sprintf('File uploaded. ID is \'%s\'', $response->getUuid());
        - lang: Python
          label: Python
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            from pyuploadcare import Uploadcare, File

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            with open('test1.txt', 'rb') as file_object:
                ucare_file = uploadcare.multipart_upload(file_object)
        - lang: Ruby
          label: Ruby
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            source_file = File.open('image.png')
            Uploadcare::Uploader.upload(source_file, store: 'auto')
        - lang: Swift
          label: Swift
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            guard let url = Bundle.main.url(forResource: "Mona_Lisa_23mb", withExtension: "jpg"),
                  let data = try? Data(contentsOf: url) else { return }

            let metadata = ["subsystem": "uploader", "pet": "cat"]
            let onProgress: (Double)->Void = { (progress) in
              print("progress: \(progress)")
            }

            let file = try await uploadcare.uploadAPI.multipartUpload(data, withName: "Mona_Lisa_big.jpg", store: .auto, metadata: metadata, onProgress)
            print(file)
        - lang: Kotlin
          label: Kotlin
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
            val file = FileUploader(uploadcare, uri = uri, context = context).upload()
            Log.d("TAG", file.toString())
  /<presigned-url-x>:
    put:
      tags:
        - Upload
      operationId: multipartFileUploadPart
      summary: Upload individual file parts
      description: |
        The second phase is about uploading the file parts to the presigned upload URLs returned from the
        `/multipart/start/` endpoint.

        Each uploaded part should be at least 5 MiB (5242880 bytes) in size except for the last one, which can be smaller.
        You can upload the file parts in parallel provided that the byte order stays unchanged.

        **Note**: You MUST define `Content-Type` header for your data.
      requestBody:
        $ref: '#/components/requestBodies/multipartUploadPartParameters'
      responses:
        2XX:
          description: A file part has been uploaded successfully
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { multipartUpload } from '@uploadcare/upload-client'

            // partData is a chunk of the uploaded file's content
            // must be `Blob` or `File` or `Buffer`
            const result = await multipartUpload(
              partData,
              '<presigned-url-x>'
            )
        - lang: PHP
          label: PHP
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $path = '/path-to-large-file.zip';
            $handle = \fopen($path, 'rb');
            $response = $uploader->fromResource($handle, null, null, 'auto', [
                'size' => \filesize($path), // The "size" is the metadata key
            ]);
            echo \sprintf('File uploaded. ID is \'%s\'', $response->getUuid());
        - lang: Python
          label: Python
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            from pyuploadcare import Uploadcare, File

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            with open('test1.txt', 'rb') as file_object:
                ucare_file = uploadcare.multipart_upload(file_object)
        - lang: Ruby
          label: Ruby
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            source_file = File.open('image.png')
            Uploadcare::Uploader.upload(source_file, store: 'auto')
        - lang: Swift
          label: Swift
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            guard let url = Bundle.main.url(forResource: "Mona_Lisa_23mb", withExtension: "jpg"),
                  let data = try? Data(contentsOf: url) else { return }

            let metadata = ["subsystem": "uploader", "pet": "cat"]
            let onProgress: (Double)->Void = { (progress) in
              print("progress: \(progress)")
            }

            let file = try await uploadcare.uploadAPI.multipartUpload(data, withName: "Mona_Lisa_big.jpg", store: .auto, metadata: metadata, onProgress)
            print(file)
        - lang: Kotlin
          label: Kotlin
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
            val file = FileUploader(uploadcare, uri = uri, context = context).upload()
            Log.d("TAG", file.toString())
  /multipart/complete/:
    post:
      tags:
        - Upload
      operationId: multipartFileUploadComplete
      summary: Complete multipart upload
      description: |
        Once all the file parts have been uploaded successfully, complete the
        upload session to assemble all the file parts into a single resulting file.
      requestBody:
        $ref: '#/components/requestBodies/multipartUploadCompleteParameters'
      responses:
        '200':
          description: The file was uploaded successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/fileUploadInfo'
        '400':
          $ref: '#/components/responses/multipartUploadCompleteInputValidationErrors'
        '403':
          $ref: '#/components/responses/multipartUploadCompleteAccessForbiddenErrors'
        '404':
          $ref: '#/components/responses/multipartUploadCompleteFileNotFoundError'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { multipartComplete } from '@uploadcare/upload-client'

            const result = await multipartComplete(
              '67947755-1584-4e3f-902b-d4e2bf76a841',
              {
                publicKey: 'YOUR_PUBLIC_KEY'
              }
            )
        - lang: PHP
          label: PHP
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $path = '/path-to-large-file.zip';
            $handle = \fopen($path, 'rb');
            $response = $uploader->fromResource($handle, null, null, 'auto', [
                'size' => \filesize($path), // The "size" is the metadata key
            ]);
            echo \sprintf('File uploaded. ID is \'%s\'', $response->getUuid());
        - lang: Python
          label: Python
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            from pyuploadcare import Uploadcare, File

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            with open('test1.txt', 'rb') as file_object:
                ucare_file = uploadcare.multipart_upload(file_object)
        - lang: Ruby
          label: Ruby
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            source_file = File.open('image.png')
            Uploadcare::Uploader.upload(source_file, store: 'auto')
        - lang: Swift
          label: Swift
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            guard let url = Bundle.main.url(forResource: "Mona_Lisa_23mb", withExtension: "jpg"),
                  let data = try? Data(contentsOf: url) else { return }

            let metadata = ["subsystem": "uploader", "pet": "cat"]
            let onProgress: (Double)->Void = { (progress) in
              print("progress: \(progress)")
            }

            let file = try await uploadcare.uploadAPI.multipartUpload(data, withName: "Mona_Lisa_big.jpg", store: .auto, metadata: metadata, onProgress)
            print(file)
        - lang: Kotlin
          label: Kotlin
          source: |
            // Uploadcare lib provides high level API for multipart uploads that does everything for you

            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val uri = "content://com.android.providers.media.documents/document/image%3A1000001178".toUri()
            val file = FileUploader(uploadcare, uri = uri, context = context).upload()
            Log.d("TAG", file.toString())
  /from_url/:
    post:
      tags:
        - Upload
      operationId: fromURLUpload
      summary: Upload files from URLs
      description: |
        Uploadcare can fetch a file from a publicly available URL and then automatically upload the
        fetched file to your project.

        #### Upload tokens
        Requests to the endpoint return a JSON dictionary with a `token` that can be further used
        to [check the status](/docs/api/upload/upload/from-url-upload-status) of the upload
        request.

        **Note:** The token is not a file ID and can't be used to address the file directly.
        The actual file ID should be retrieved by calling the `/from_url/status/` endpoint.

        #### Duplicates prevention
        By default, every call to the `/from_url/` endpoint with the same `source_url` results in
        a new upload leading to file duplication.

        If you would like Uploadcare to keep track of the requested URLs and avoid the duplicate
        uploads, pass the `save_URL_duplicates` and `check_URL_duplicates` parameters described below.
      requestBody:
        $ref: '#/components/requestBodies/fromURLUploadRequestBody'
      responses:
        '200':
          $ref: '#/components/responses/fromURLUploadResponseSuccessful'
        '400':
          $ref: '#/components/responses/fromURLUploadInputValidationErrors'
        '403':
          $ref: '#/components/responses/fromURLUploadAccessForbiddenErrors'
        '429':
          $ref: '#/components/responses/requestWasThrottledError'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { fromUrl } from '@uploadcare/upload-client'

            const result = await fromUrl(
              'https://source.unsplash.com/featured',
              {
                publicKey: 'YOUR_PUBLIC_KEY',
                metadata: {
                  subsystem: 'uploader',
                  pet: 'cat'
                }
              }
            )
        - lang: PHP
          label: PHP
          source: |
            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $url = 'https://source.unsplash.com/featured';
            $token = $uploader->fromUrl($url, null, null, 'auto', [
                'action' => 'upload from URL', // The "Action" is the metadata key
                'checkDuplicates' => true,
                'storeDuplicates' => false,
            ]);
            echo \sprintf('Upload from URL \'%s\' has been started. Token is %s', $url, $token);
        - lang: Python
          label: Python
          source: |
            from pyuploadcare import Uploadcare

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            ucare_file = uploadcare.upload_from_url_sync(
                "https://source.unsplash.com/featured",
                check_duplicates=True,
                save_duplicates=False
            )
        - lang: Ruby
          label: Ruby
          source: |
            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            source_url = 'https://source.unsplash.com/featured'
            Uploadcare::Uploader.upload(source_url, store: 'auto')
        - lang: Swift
          label: Swift
          source: |
            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            let url = URL(string: "https://source.unsplash.com/featured")!
            let task = UploadFromURLTask(sourceUrl: url)
              .store(.auto)
              .setMetadata("uploader", forKey: "subsystem")
              .setMetadata("cat", forKey: "pet")

            let file = try await uploadcare.uploadAPI.uploadAndWaitForCompletion(task: task)
            print(file)
        - lang: Kotlin
          label: Kotlin
          source: |
            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val uploader = UrlUploader(
                client = uploadcare,
                sourceUrl = "https://source.unsplash.com/featured"
            )
            val file = uploader.upload()
            Log.d("TAG", file.toString())
  /from_url/status/:
    get:
      tags:
        - Upload
      operationId: fromURLUploadStatus
      summary: Check the status of a task to fetch/upload a file from a URL
      description: |
        The endpoint notifies about the progress of the task by changing the value of the `status` field:
          * the field is set to `waiting` initially
          * once the system starts processing the request, the field is set to `progress`
          * if the file is fetched and uploaded successfully, the `status` field is set to `success`
            and the endpoint returns a JSON object holding information about the uploaded file
          * if the system fails to fetch/upload the file, the `status` field is set to `error` and
            the `error` field is set to the cause of the error.
      parameters:
        - in: query
          name: token
          required: true
          description: Token returned by the `/from_url/` endpoint that identifies a request to fetch/upload a file from a URL.
          schema:
            type: string
            format: uuid
          example: 945ebb27-1fd6-46c6-a859-b9893712d650
      responses:
        '200':
          $ref: '#/components/responses/fromURLUploadStatusSuccessful'
        '400':
          $ref: '#/components/responses/fromURLUploadStatusInputValidationErrors'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { fromUrlStatus } from '@uploadcare/upload-client'

            const result = await fromUrlStatus(
              '945ebb27-1fd6-46c6-a859-b9893712d650',
              {
                publicKey: 'YOUR_PUBLIC_KEY'
              }
            )
        - lang: PHP
          label: PHP
          source: |
            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $status = $uploader->checkStatus('945ebb27-1fd6-46c6-a859-b9893712d650');
            echo \sprintf('Upload status is %s', $status);
        - lang: Python
          label: Python
          source: |
            from pyuploadcare import Uploadcare, File

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            file = uploadcare.file_from_url('945ebb27-1fd6-46c6-a859-b9893712d650')
            print(file.info)
        - lang: Ruby
          label: Ruby
          source: |
            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            token = '945ebb27-1fd6-46c6-a859-b9893712d650'
            puts Uploadcare::Uploader.get_upload_from_url_status(token)
        - lang: Swift
          label: Swift
          source: |
            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            let status = try await uploadcare.uploadAPI.uploadStatus(forToken: "945ebb27-1fd6-46c6-a859-b9893712d650")
            print(status)
        - lang: Kotlin
          label: Kotlin
          source: |
            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val status = uploadcare.getFromUrlStatus(token = "945ebb27-1fd6-46c6-a859-b9893712d650")
            Log.d("TAG", status.toString())
  /info/:
    get:
      tags:
        - Upload
      operationId: fileUploadInfo
      summary: Get information about an uploaded file
      description: |
        Returns a JSON object with information about an uploaded file (file size, MIME type, metadata, etc).
      parameters:
        - in: query
          name: pub_key
          required: true
          schema:
            $ref: '#/components/schemas/projectPublicKeyType'
          example: YOUR_PUBLIC_KEY
        - in: query
          name: file_id
          required: true
          description: File's unique ID.
          schema:
            type: string
            format: uuid
          example: 67947755-1584-4e3f-902b-d4e2bf76a841
      responses:
        '200':
          $ref: '#/components/responses/fileUploadInfoSuccessful'
        '400':
          $ref: '#/components/responses/fileUploadInfoInputValidationErrors'
        '403':
          $ref: '#/components/responses/fileUploadInfoAccessForbiddenErrors'
        '404':
          $ref: '#/components/responses/fileUploadInfoNotFoundErrors'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { info } from '@uploadcare/upload-client'

            const result = await info(
              'be3b4d5e-179d-460e-8a5d-69112ac86cbb',
              {
                publicKey: 'YOUR_PUBLIC_KEY'
              }
            )
        - lang: PHP
          label: PHP
          source: |
            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $fileInfo = (new Uploadcare\Api($configuration))->file()->fileInfo(string $uuid);
            echo \sprintf('URL: %s, ID: %s, Mime type: %s', $fileInfo->getUrl(), $fileInfo->getUuid(), $fileInfo->getMimeType());
        - lang: Python
          label: Python
          source: |
            from pyuploadcare import Uploadcare, File

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            file = uploadcare.file('740e1b8c-1ad8-4324-b7ec-112c79d8eac2')
            print(file.info)
        - lang: Ruby
          label: Ruby
          source: |
            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            uuid = '740e1b8c-1ad8-4324-b7ec-112c79d8eac2'
            info = Uploadcare::File.info(uuid)
            puts info.inspect
        - lang: Swift
          label: Swift
          source: |
            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            let file = try await uploadcare.uploadAPI.fileInfo(withFileId: "740e1b8c-1ad8-4324-b7ec-112c79d8eac2")
            print(file)
        - lang: Kotlin
          label: Kotlin
          source: |
            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val file = uploadcare.getUploadedFile(fileId = "740e1b8c-1ad8-4324-b7ec-112c79d8eac2")
            Log.d("TAG", file.toString())
  /group/:
    post:
      tags:
        - Groups
      operationId: createFilesGroup
      summary: Create a file group
      description: |
        Create a file group from a set of already uploaded files.

        The most common use case for creating a file group is when a user uploads
        multiple files at once and then wants to display them together.

        **Note:** A group itself and files within it MUST belong to the same project.

        **Note:** Groups are immutable and the only way to add/remove a file to a group
        is to create a new one.
      requestBody:
        $ref: '#/components/requestBodies/createFilesGroupRequestBody'
      responses:
        '200':
          $ref: '#/components/responses/createFilesGroupSuccessful'
        '400':
          $ref: '#/components/responses/createFilesGroupInputValidationErrors'
        '403':
          $ref: '#/components/responses/createFilesGroupAccessForbiddenErrors'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { group } from '@uploadcare/upload-client'

            const result = await group(
              [
                'd6d34fa9-addd-472c-868d-2e5c105f9fcd',
                'b1026315-8116-4632-8364-607e64fca723/-/resize/x800/'
              ],
              {
                publicKey: 'YOUR_PUBLIC_KEY'
              }
            )
        - lang: PHP
          label: PHP
          source: |
            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $result = $uploader->groupFiles(['d6d34fa9-addd-472c-868d-2e5c105f9fcd', 'b1026315-8116-4632-8364-607e64fca723/-/resize/x800/']);
            echo \sprintf('Response status is %s', $result->getStatusCode());
        - lang: Python
          label: Python
          source: |
            from pyuploadcare import Uploadcare, File, FileGroup

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            file_1 = uploadcare.file('d6d34fa9-addd-472c-868d-2e5c105f9fcd')
            file_2 = uploadcare.file('b1026315-8116-4632-8364-607e64fca723/-/resize/x800/')
            file_group = uploadcare.create_file_group([file_1, file_2])
        - lang: Ruby
          label: Ruby
          source: |
            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            uuids = [
              'd6d34fa9-addd-472c-868d-2e5c105f9fcd',
              'b1026315-8116-4632-8364-607e64fca723/-/resize/x800/'
            ]
            Uploadcare::Group.create(uuids)
        - lang: Swift
          label: Swift
          source: |
            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            let filesIds = ["d6d34fa9-addd-472c-868d-2e5c105f9fcd", "b1026315-8116-4632-8364-607e64fca723/-/resize/x800/"]
            let group = try await uploadAPI.createFilesGroup(fileIds: filesIds)
            print(group)
        - lang: Kotlin
          label: Kotlin
          source: |
            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val uuids = listOf(
                "d6d34fa9-addd-472c-868d-2e5c105f9fcd",
                "b1026315-8116-4632-8364-607e64fca723/-/resize/x800/"
            )
            val group = uploadcare.createGroup(fileIds = uuids)
            Log.d("TAG", group.toString())
  /group/info/:
    get:
      tags:
        - Groups
      operationId: filesGroupInfo
      summary: Get information about a file group
      description: |
        Returns a JSON object with information about a file group (when the group was created,
        number of the files in the group, etc).
      parameters:
        - in: query
          name: pub_key
          required: true
          schema:
            $ref: '#/components/schemas/projectPublicKeyType'
          example: YOUR_PUBLIC_KEY
        - in: query
          name: group_id
          description: |
            Group's unique ID. Group IDs look like `UUID~N`, where the `~N` part reflects the number of the files in the group.
          required: true
          schema:
            type: string
          example: d52d7136-a2e5-4338-9f45-affbf83b857d~2
      responses:
        '200':
          $ref: '#/components/responses/filesGroupInfoSuccessful'
        '400':
          $ref: '#/components/responses/filesGroupInfoInputValidationErrors'
        '403':
          $ref: '#/components/responses/filesGroupInfoAccessForbiddenErrors'
        '404':
          $ref: '#/components/responses/filesGroupInfoNotFoundErrors'
      x-codeSamples:
        - lang: JavaScript
          label: JS
          source: |
            import { groupInfo } from '@uploadcare/upload-client'

            const result = await groupInfo(
              '0d712319-b970-4602-850c-bae1ced521a6~1',
              {
                publicKey: 'YOUR_PUBLIC_KEY'
              }
            )
        - lang: PHP
          label: PHP
          source: |
            <?php
            $configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

            $uploader = new Uploadcare\Uploader\Uploader($configuration);
            $groupInfo = $uploader->groupInfo('0d712319-b970-4602-850c-bae1ced521a6~1');
            echo $groupInfo->getBody()->getContents();
        - lang: Python
          label: Python
          source: |
            from pyuploadcare import Uploadcare, FileGroup

            uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
            file_group = uploadcare.file_group('0d712319-b970-4602-850c-bae1ced521a6~1')
            print(file_group.info)
        - lang: Ruby
          label: Ruby
          source: |
            require 'uploadcare'
            Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
            Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

            uuid = '0d712319-b970-4602-850c-bae1ced521a6~1'
            info = Uploadcare::Group.info(uuid)
            puts info.inspect
        - lang: Swift
          label: Swift
          source: |
            import Uploadcare

            let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

            let group = try await uploadcare.uploadAPI.filesGroupInfo(groupId: "0d712319-b970-4602-850c-bae1ced521a6~1")
            print(group)
        - lang: Kotlin
          label: Kotlin
          source: |
            import com.uploadcare.android.library.api.UploadcareClient

            val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

            val group = uploadcare.getUploadedGroup(groupId = "0d712319-b970-4602-850c-bae1ced521a6~1")
            Log.d("TAG", group.toString())
components:
  requestBodies:
    baseUploadRequestBody:
      required: true
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              UPLOADCARE_PUB_KEY:
                $ref: '#/components/schemas/projectPublicKeyType'
              UPLOADCARE_STORE:
                $ref: '#/components/schemas/storeType'
              '{filename}':
                description: File's content
                type: array
                items:
                  type: string
                  format: binary
              metadata[{key}]:
                $ref: '#/components/schemas/metadataValue'
              signature:
                $ref: '#/components/schemas/signatureType'
              expire:
                $ref: '#/components/schemas/expireType'
            required:
              - '{filename}'
              - UPLOADCARE_PUB_KEY
          examples:
            One File:
              value:
                UPLOADCARE_PUB_KEY: YOUR_PUBLIC_KEY
                UPLOADCARE_STORE: auto
                my_file.jpg: '@my_file.jpg'
                metadata[subsystem]: uploader
                metadata[pet]: cat
            Two Files:
              value:
                UPLOADCARE_PUB_KEY: YOUR_PUBLIC_KEY
                UPLOADCARE_STORE: auto
                my_file.jpg: '@my_file.jpg'
                another_file.jpg: '@another_file.jpg'
                metadata[subsystem]: uploader
    multipartUploadStartParameters:
      content:
        multipart/form-data:
          schema:
            type: object
            description: Multipart upload parameters to start multipart uploading.
            properties:
              UPLOADCARE_PUB_KEY:
                $ref: '#/components/schemas/projectPublicKeyType'
              UPLOADCARE_STORE:
                $ref: '#/components/schemas/storeType'
              filename:
                type: string
                description: Original file name of the uploaded file
                example: myfile.mp4
              size:
                type: integer
                description: |
                  Precise file size of the uploaded file (in bytes).
                  **Note**: The size should not exceed max file size cap for your project.
                example: 27796904
              part_size:
                type: integer
                description: |
                  Multipart Uploads expect that you will split the uploaded file into equally sized
                  parts (except for the last part) and then will upload them to AWS S3 (possibly in parallel).
                  By default, we assume that you will upload the files in 5 megabyte chunks,
                  so we return a list of presigned AWS S3 URLs accordingly.
                  If you intend to upload large files (for example, larger than a gigabyte),
                  we recommend to bump the part size and to pass the expected chunk size
                  to us as a value of the `part_size` parameter (in bytes).
                minimum: 5242880
                maximum: 5368709120
                default: 5242880
                example: 10485760
              content_type:
                type: string
                description: File's MIME-type.
                example: video/mp4
              metadata[{key}]:
                $ref: '#/components/schemas/metadataValue'
              signature:
                $ref: '#/components/schemas/signatureType'
              expire:
                $ref: '#/components/schemas/expireType'
            required:
              - filename
              - content_type
              - size
              - UPLOADCARE_PUB_KEY
          example:
            UPLOADCARE_PUB_KEY: YOUR_PUBLIC_KEY
            UPLOADCARE_STORE: auto
            filename: myfile.mp4
            size: 27796904
            content_type: video/mp4
            metadata[subsystem]: uploader
            metadata[pet]: cat
    multipartUploadPartParameters:
      content:
        application/octet-stream:
          schema:
            type: object
            description: |
              Part of the uploaded file.

              Don't include `https://upload.uploadcare.com/` in this request:

              ```
              curl -X PUT "<presigned-url-x>" -H "Content-Type: application/octet-stream" --data <data-part>
              ```
    multipartUploadCompleteParameters:
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              UPLOADCARE_PUB_KEY:
                $ref: '#/components/schemas/projectPublicKeyType'
              uuid:
                type: string
                description: File's UUID from the `/multipart/start/` endpoint.
                format: uuid
                example: 67947755-1584-4e3f-902b-d4e2bf76a841
            required:
              - UPLOADCARE_PUB_KEY
              - uuid
          example:
            UPLOADCARE_PUB_KEY: YOUR_PUBLIC_KEY
            uuid: 67947755-1584-4e3f-902b-d4e2bf76a841
    fromURLUploadRequestBody:
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              pub_key:
                $ref: '#/components/schemas/projectPublicKeyType'
              source_url:
                type: string
                format: uri
                description: |
                  Source URL of the file to fetch and upload.

                  **Note**: The URL should point to a resource publicly available via HTTP/HTTPS.
                example: https://source.unsplash.com/featured
              store:
                $ref: '#/components/schemas/storeType'
              filename:
                type: string
                description: |
                  Sets the file name of the resource fetched from the source URL.
                  If not defined, the file name is obtained from either HTTP
                  response headers or the `source_url`'s path.

                  **Note:** The filename will be sanitized to only contain the following symbols:
                  `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._`.
                example: googlelogo_color_272x92dp.png
              check_URL_duplicates:
                type: string
                enum:
                  - '0'
                  - '1'
                default: '0'
                description: |
                  If set to "1", enables the `source_url` duplicates prevention.
                  Specifically, if the `source_url` had already been fetched and uploaded previously,
                  this request will return information about the already uploaded file.
                example: '1'
              save_URL_duplicates:
                type: string
                enum:
                  - '0'
                  - '1'
                description: |
                  Determines if the requested `source_url` should be kept in the history of
                  fetched/uploaded URLs. If the value is not defined explicitly, it is set
                  to the value of the `check_URL_duplicates` parameter.
                example: '1'
              metadata[{key}]:
                $ref: '#/components/schemas/metadataValue'
              signature:
                $ref: '#/components/schemas/signatureType'
              expire:
                $ref: '#/components/schemas/expireType'
            required:
              - pub_key
              - source_url
          example:
            pub_key: YOUR_PUBLIC_KEY
            source_url: https://source.unsplash.com/featured
            metadata[subsystem]: uploader
            metadata[pet]: cat
    createFilesGroupRequestBody:
      required: true
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              pub_key:
                $ref: '#/components/schemas/projectPublicKeyType'
              files[]:
                type: array
                description: |
                  Set of files you want to add to the group.
                  Each element can be a file UUID with or without the applied image
                  processing operations.
                items:
                  type: string
              signature:
                $ref: '#/components/schemas/signatureType'
              expire:
                $ref: '#/components/schemas/expireType'
            required:
              - files[]
              - pub_key
          example:
            pub_key: YOUR_PUBLIC_KEY
            files[]:
              - d6d34fa9-addd-472c-868d-2e5c105f9fcd
              - b1026315-8116-4632-8364-607e64fca723/-/resize/x800/
  responses:
    commonUploadAccessForbiddenErrors:
      description: Request was not allowed.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/uploadcarePublicKeyRequiredError'
              - $ref: '#/components/schemas/uploadcarePublicKeyInvalidError'
              - $ref: '#/components/schemas/autoStoreDisabledError'
              - $ref: '#/components/schemas/projectPublicKeyRemovedError'
              - $ref: '#/components/schemas/accountBlockedError'
              - $ref: '#/components/schemas/accountUnpaidError'
              - $ref: '#/components/schemas/uploadFailedError'
              - $ref: '#/components/schemas/accountLimitsExceededError'
              - $ref: '#/components/schemas/signatureExpirationError'
              - $ref: '#/components/schemas/signatureInvalidError'
          examples:
            public-key-is-required:
              $ref: '#/components/examples/uploadcarePublicKeyRequiredError'
            public-key-is-invalid:
              $ref: '#/components/examples/uploadcarePublicKeyInvalidError'
            auto-store-is-disabled:
              $ref: '#/components/examples/autoStoreDisabledError'
            project-public-key-removed:
              $ref: '#/components/examples/projectPublicKeyRemovedError'
            account-blocked:
              $ref: '#/components/examples/accountBlockedError'
            account-unpaid:
              $ref: '#/components/examples/accountUnpaidError'
            upload-failed:
              $ref: '#/components/examples/uploadFailedError'
            account-limits-exceeded:
              $ref: '#/components/examples/accountLimitsExceededError'
            signature-expiration:
              $ref: '#/components/examples/signatureExpirationError'
            signature-invalid:
              $ref: '#/components/examples/signatureInvalidError'
    baseUploadSuccessful:
      description: The file was uploaded successfully.
      content:
        application/json:
          schema:
            type: object
            description: |
              JSON object where the key is the file name of the uploaded file and
              the value is the unique ID of the file on our systems.
            properties:
              filename:
                type: string
                format: uuid
            example:
              my_file.jpg: 17be4678-dab7-4bc7-8753-28914a22960a
    baseUploadInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/requestFiledsNumberLimitExceededError'
              - $ref: '#/components/schemas/postRequestParserFailedError'
              - $ref: '#/components/schemas/nullCharactersForbiddenError'
              - $ref: '#/components/schemas/fileMetadataKeyDuplicatedError'
              - $ref: '#/components/schemas/fileMetadataKeyEmptyError'
              - $ref: '#/components/schemas/fileMetadataKeyForbiddenError'
              - $ref: '#/components/schemas/fileMetadataKeyLengthTooBigError'
              - $ref: '#/components/schemas/fileMetadataValueEmptyError'
              - $ref: '#/components/schemas/fileMetadataValueForbiddenError'
              - $ref: '#/components/schemas/fileMetadataValueLengthTooBigError'
              - $ref: '#/components/schemas/fileMetadataKeysNumberTooBigError'
              - $ref: '#/components/schemas/signatureRequiredError'
              - $ref: '#/components/schemas/signatureExpirationRequiredError'
              - $ref: '#/components/schemas/signatureExpirationInvalidError'
              - $ref: '#/components/schemas/filesRequiredError'
              - $ref: '#/components/schemas/fileSizeLimitExceededError'
              - $ref: '#/components/schemas/fileTypeForbiddenError'
              - $ref: '#/components/schemas/fileInfectedError'
              - $ref: '#/components/schemas/SVGValidationFailedError'
              - $ref: '#/components/schemas/SVGMaliciousContentError'
          examples:
            request-fields-number-limit-exceeded:
              $ref: '#/components/examples/requestFiledsNumberLimitExceededError'
            post-request-parser-failed:
              $ref: '#/components/examples/postRequestParserFailedError'
            null-characters-forbidden:
              $ref: '#/components/examples/nullCharactersForbiddenError'
            file-metadata-key-duplicate:
              $ref: '#/components/examples/fileMetadataKeyDuplicatedError'
            file-metadata-key-empty:
              $ref: '#/components/examples/fileMetadataKeyEmptyError'
            file-metadata-key-forbidden:
              $ref: '#/components/examples/fileMetadataKeyForbiddenError'
            file-metadata-key-length-too-big:
              $ref: '#/components/examples/fileMetadataKeyLengthTooBigError'
            file-metadata-value-empty:
              $ref: '#/components/examples/fileMetadataValueEmptyError'
            file-metadata-value-forbidden:
              $ref: '#/components/examples/fileMetadataValueForbiddenError'
            file-metadata-value-length-too-big:
              $ref: '#/components/examples/fileMetadataValueLengthTooBigError'
            file-metadata-keys-number-too-big:
              $ref: '#/components/examples/fileMetadataKeysNumberTooBigError'
            signature-required:
              $ref: '#/components/examples/signatureRequiredError'
            signature-expiration-required:
              $ref: '#/components/examples/signatureExpirationRequiredError'
            signature-expiration-invalid:
              $ref: '#/components/examples/signatureExpirationInvalidError'
            files-required:
              $ref: '#/components/examples/filesRequiredError'
            file-size-limit-exceeded:
              $ref: '#/components/examples/fileSizeLimitExceededError'
            file-type-forbidden:
              $ref: '#/components/examples/fileTypeForbiddenError'
            file-infected:
              $ref: '#/components/examples/fileInfectedError'
            invalid-svg:
              $ref: '#/components/examples/SVGValidationFailedError'
            malicious-svg:
              $ref: '#/components/examples/SVGMaliciousContentError'
    multipartUploadStartResponse:
      description: Multipart upload started successfully.
      content:
        application/json:
          schema:
            type: object
            properties:
              uuid:
                type: string
                description: File's UUID.
                format: uuid
              parts:
                type: array
                items:
                  type: string
                  description: Upload file parts here.
                  format: uri
            required:
              - uuid
              - parts
            example:
              uuid: 67947755-1584-4e3f-902b-d4e2bf76a841
              parts:
                - <presigned-url-1>
                - <presigned-url-2>
                - <presigned-url-3>
                - <presigned-url-4>
                - <presigned-url-5>
    multipartUploadStartInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/requestFiledsNumberLimitExceededError'
              - $ref: '#/components/schemas/postRequestParserFailedError'
              - $ref: '#/components/schemas/nullCharactersForbiddenError'
              - $ref: '#/components/schemas/fileMetadataKeyDuplicatedError'
              - $ref: '#/components/schemas/fileMetadataKeyEmptyError'
              - $ref: '#/components/schemas/fileMetadataKeyForbiddenError'
              - $ref: '#/components/schemas/fileMetadataKeyLengthTooBigError'
              - $ref: '#/components/schemas/fileMetadataValueEmptyError'
              - $ref: '#/components/schemas/fileMetadataValueForbiddenError'
              - $ref: '#/components/schemas/fileMetadataValueLengthTooBigError'
              - $ref: '#/components/schemas/fileMetadataKeysNumberTooBigError'
              - $ref: '#/components/schemas/signatureRequiredError'
              - $ref: '#/components/schemas/signatureExpirationRequiredError'
              - $ref: '#/components/schemas/signatureExpirationInvalidError'
              - $ref: '#/components/schemas/requestParamRequiredError'
              - $ref: '#/components/schemas/multipartSizeInvalidError'
              - $ref: '#/components/schemas/multipartFileSizeLimitExceededError'
              - $ref: '#/components/schemas/multipartFileSizeTooSmallError'
              - $ref: '#/components/schemas/multipartPartSizeInvalidError'
              - $ref: '#/components/schemas/multipartPartSizeTooSmallError'
              - $ref: '#/components/schemas/multipartPartSizeTooBigError'
          examples:
            request-fields-number-limit-exceeded:
              $ref: '#/components/examples/requestFiledsNumberLimitExceededError'
            post-request-parser-failed:
              $ref: '#/components/examples/postRequestParserFailedError'
            null-characters-forbidden:
              $ref: '#/components/examples/nullCharactersForbiddenError'
            file-metadata-key-duplicate:
              $ref: '#/components/examples/fileMetadataKeyDuplicatedError'
            file-metadata-key-empty:
              $ref: '#/components/examples/fileMetadataKeyEmptyError'
            file-metadata-key-forbidden:
              $ref: '#/components/examples/fileMetadataKeyForbiddenError'
            file-metadata-key-length-too-big:
              $ref: '#/components/examples/fileMetadataKeyLengthTooBigError'
            file-metadata-value-empty:
              $ref: '#/components/examples/fileMetadataValueEmptyError'
            file-metadata-value-forbidden:
              $ref: '#/components/examples/fileMetadataValueForbiddenError'
            file-metadata-value-length-too-big:
              $ref: '#/components/examples/fileMetadataValueLengthTooBigError'
            file-metadata-keys-number-too-big:
              $ref: '#/components/examples/fileMetadataKeysNumberTooBigError'
            signature-required:
              $ref: '#/components/examples/signatureRequiredError'
            signature-expiration-required:
              $ref: '#/components/examples/signatureExpirationRequiredError'
            signature-expiration-invalid:
              $ref: '#/components/examples/signatureExpirationInvalidError'
            request-param-required:
              $ref: '#/components/examples/requestParamRequiredError'
            multipart-size-invalid:
              $ref: '#/components/examples/multipartSizeInvalidError'
            multipart-file-size-limit-exceeded:
              $ref: '#/components/examples/multipartFileSizeLimitExceededError'
            multipart-file-size-too-small:
              $ref: '#/components/examples/multipartFileSizeTooSmallError'
            multipart-part-size-invalid:
              $ref: '#/components/examples/multipartPartSizeInvalidError'
            multipart-part-size-too-small:
              $ref: '#/components/examples/multipartPartSizeTooSmallError'
            multipart-part-size-too-big:
              $ref: '#/components/examples/multipartPartSizeTooBigError'
    multipartUploadCompleteInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/requestFiledsNumberLimitExceededError'
              - $ref: '#/components/schemas/postRequestParserFailedError'
              - $ref: '#/components/schemas/nullCharactersForbiddenError'
              - $ref: '#/components/schemas/multipartFileIdRequiredError'
              - $ref: '#/components/schemas/uuidInvalidError'
              - $ref: '#/components/schemas/multipartFileAlreadyUploadedError'
              - $ref: '#/components/schemas/multipartUploadSizeTooLargeError'
              - $ref: '#/components/schemas/multipartUploadSizeTooSmallError'
              - $ref: '#/components/schemas/multipartFileCompletionFailedError'
              - $ref: '#/components/schemas/fileTypeForbiddenError'
              - $ref: '#/components/schemas/fileInfectedError'
              - $ref: '#/components/schemas/SVGValidationFailedError'
              - $ref: '#/components/schemas/SVGMaliciousContentError'
          examples:
            request-fields-number-limit-exceeded:
              $ref: '#/components/examples/requestFiledsNumberLimitExceededError'
            post-request-parser-failed:
              $ref: '#/components/examples/postRequestParserFailedError'
            null-characters-forbidden:
              $ref: '#/components/examples/nullCharactersForbiddenError'
            multipart-file-id-required:
              $ref: '#/components/examples/multipartFileIdRequiredError'
            uuid-invalid:
              $ref: '#/components/examples/uuidInvalidError'
            multipart-file-already-uploaded:
              $ref: '#/components/examples/multipartFileAlreadyUploadedError'
            multipart-upload-size-too-large:
              $ref: '#/components/examples/multipartUploadSizeTooLargeError'
            multipart-upload-size-too-small:
              $ref: '#/components/examples/multipartUploadSizeTooSmallError'
            multipart-file-completion-failed:
              $ref: '#/components/examples/multipartFileCompletionFailedError'
            file-type-forbidden:
              $ref: '#/components/examples/fileTypeForbiddenError'
            file-infected:
              $ref: '#/components/examples/fileInfectedError'
            invalid-svg:
              $ref: '#/components/examples/SVGValidationFailedError'
            malicious-svg:
              $ref: '#/components/examples/SVGMaliciousContentError'
    multipartUploadCompleteAccessForbiddenErrors:
      description: Request was not allowed.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/uploadcarePublicKeyRequiredError'
              - $ref: '#/components/schemas/uploadcarePublicKeyInvalidError'
          examples:
            public-key-is-required:
              $ref: '#/components/examples/uploadcarePublicKeyRequiredError'
            public-key-is-invalid:
              $ref: '#/components/examples/uploadcarePublicKeyInvalidError'
    multipartUploadCompleteFileNotFoundError:
      description: File with specified UUID was not found.
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/fileNotFoundError'
          examples:
            file-not-found:
              $ref: '#/components/examples/fileNotFoundError'
    fromURLUploadResponseSuccessful:
      description: Status Token or File Info of an already downloaded file.
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/fromURLUploadResponseSchema'
              - $ref: '#/components/schemas/fileUploadInfoFromURL'
          examples:
            Type Token:
              value:
                type: token
                token: 945ebb27-1fd6-46c6-a859-b9893712d650
            type-file-info:
              $ref: '#/components/examples/fileUploadInfoWithType'
    fromURLUploadInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/requestFiledsNumberLimitExceededError'
              - $ref: '#/components/schemas/postRequestParserFailedError'
              - $ref: '#/components/schemas/nullCharactersForbiddenError'
              - $ref: '#/components/schemas/fileMetadataKeyDuplicatedError'
              - $ref: '#/components/schemas/fileMetadataKeyEmptyError'
              - $ref: '#/components/schemas/fileMetadataKeyForbiddenError'
              - $ref: '#/components/schemas/fileMetadataKeyLengthTooBigError'
              - $ref: '#/components/schemas/fileMetadataValueEmptyError'
              - $ref: '#/components/schemas/fileMetadataValueForbiddenError'
              - $ref: '#/components/schemas/fileMetadataValueLengthTooBigError'
              - $ref: '#/components/schemas/fileMetadataKeysNumberTooBigError'
              - $ref: '#/components/schemas/signatureRequiredError'
              - $ref: '#/components/schemas/signatureExpirationRequiredError'
              - $ref: '#/components/schemas/signatureExpirationInvalidError'
              - $ref: '#/components/schemas/sourceURLRequiredError'
              - $ref: '#/components/schemas/urlParsingFailedError'
              - $ref: '#/components/schemas/urlSchemeRequiredError'
              - $ref: '#/components/schemas/urlSchemeInvalidError'
              - $ref: '#/components/schemas/urlHostRequiredError'
              - $ref: '#/components/schemas/urlBlacklistedError'
              - $ref: '#/components/schemas/hostnameNotFoundError'
              - $ref: '#/components/schemas/urlHostMalformedError'
              - $ref: '#/components/schemas/urlHostPrivateIPForbiddenError'
          examples:
            request-fields-number-limit-exceeded:
              $ref: '#/components/examples/requestFiledsNumberLimitExceededError'
            post-request-parser-failed:
              $ref: '#/components/examples/postRequestParserFailedError'
            null-characters-forbidden:
              $ref: '#/components/examples/nullCharactersForbiddenError'
            file-metadata-key-duplicate:
              $ref: '#/components/examples/fileMetadataKeyDuplicatedError'
            file-metadata-key-empty:
              $ref: '#/components/examples/fileMetadataKeyEmptyError'
            file-metadata-key-forbidden:
              $ref: '#/components/examples/fileMetadataKeyForbiddenError'
            file-metadata-key-length-too-big:
              $ref: '#/components/examples/fileMetadataKeyLengthTooBigError'
            file-metadata-value-empty:
              $ref: '#/components/examples/fileMetadataValueEmptyError'
            file-metadata-value-forbidden:
              $ref: '#/components/examples/fileMetadataValueForbiddenError'
            file-metadata-value-length-too-big:
              $ref: '#/components/examples/fileMetadataValueLengthTooBigError'
            file-metadata-keys-number-too-big:
              $ref: '#/components/examples/fileMetadataKeysNumberTooBigError'
            signature-required:
              $ref: '#/components/examples/signatureRequiredError'
            signature-expiration-required:
              $ref: '#/components/examples/signatureExpirationRequiredError'
            signature-expiration-invalid:
              $ref: '#/components/examples/signatureExpirationInvalidError'
            source-url-required:
              $ref: '#/components/examples/sourceURLRequiredError'
            url-parsing-failed:
              $ref: '#/components/examples/urlParsingFailedError'
            url-scheme-required:
              $ref: '#/components/examples/urlSchemeRequiredError'
            url-scheme-invalid:
              $ref: '#/components/examples/urlSchemeInvalidError'
            url-host-required:
              $ref: '#/components/examples/urlHostRequiredError'
            url-blacklisted:
              $ref: '#/components/examples/urlBlacklistedError'
            hostname-not-found:
              $ref: '#/components/examples/hostnameNotFoundError'
            url-host-malformed:
              $ref: '#/components/examples/urlHostMalformedError'
            url-host-private-ip-forbidden:
              $ref: '#/components/examples/urlHostPrivateIPForbiddenError'
    fromURLUploadAccessForbiddenErrors:
      description: Request was not allowed.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/publicKeyRequiredError'
              - $ref: '#/components/schemas/publicKeyInvalidError'
              - $ref: '#/components/schemas/autoStoreDisabledError'
              - $ref: '#/components/schemas/projectPublicKeyRemovedError'
              - $ref: '#/components/schemas/accountBlockedError'
              - $ref: '#/components/schemas/accountUnpaidError'
              - $ref: '#/components/schemas/uploadFailedError'
              - $ref: '#/components/schemas/accountLimitsExceededError'
              - $ref: '#/components/schemas/signatureExpirationError'
              - $ref: '#/components/schemas/signatureInvalidError'
          examples:
            public-key-is-required:
              $ref: '#/components/examples/publicKeyRequiredError'
            public-key-is-invalid:
              $ref: '#/components/examples/publicKeyInvalidError'
            auto-store-is-disabled:
              $ref: '#/components/examples/autoStoreDisabledError'
            project-public-key-removed:
              $ref: '#/components/examples/projectPublicKeyRemovedError'
            account-blocked:
              $ref: '#/components/examples/accountBlockedError'
            account-unpaid:
              $ref: '#/components/examples/accountUnpaidError'
            upload-failed:
              $ref: '#/components/examples/uploadFailedError'
            account-limits-exceeded:
              $ref: '#/components/examples/accountLimitsExceededError'
            signature-expiration:
              $ref: '#/components/examples/signatureExpirationError'
            signature-invalid:
              $ref: '#/components/examples/signatureInvalidError'
    fromURLUploadStatusSuccessful:
      description: |
        Request was processed successfully.
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/fileUploadInfoSuccessStatus'
              - $ref: '#/components/schemas/fileUploadInfoWaitingStatus'
              - $ref: '#/components/schemas/fileUploadInfoProgressStatus'
              - $ref: '#/components/schemas/fileUploadInfoErrorStatus'
              - $ref: '#/components/schemas/fileUploadInfoUnknownStatus'
          examples:
            Success:
              $ref: '#/components/examples/fileUploadInfoWithStatus'
            Waiting:
              value:
                status: waiting
            Progress:
              value:
                status: progress
                total: 732434
                done: 134427
            Error:
              value:
                status: error
                error: 'HTTP client error: 404.'
                error_code: DownloadFileHTTPClientError
            Unknown:
              value:
                status: unknown
    fromURLUploadStatusInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/tokenRequiredError'
          examples:
            token-required:
              $ref: '#/components/examples/tokenRequiredError'
    fileUploadInfoSuccessful:
      description: File information was retrieved successfully.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/fileUploadInfo'
    fileUploadInfoInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/nullCharactersForbiddenError'
              - $ref: '#/components/schemas/fileIdRequiredError'
              - $ref: '#/components/schemas/fileIdInvalidError'
          examples:
            null-characters-forbidden:
              $ref: '#/components/examples/nullCharactersForbiddenError'
            file-id-required:
              $ref: '#/components/examples/fileIdRequiredError'
            file-id-invalid:
              $ref: '#/components/examples/fileIdInvalidError'
    fileUploadInfoAccessForbiddenErrors:
      description: Request was not allowed.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/publicKeyRequiredError'
              - $ref: '#/components/schemas/publicKeyInvalidError'
          examples:
            public-key-is-required:
              $ref: '#/components/examples/publicKeyRequiredError'
            public-key-is-invalid:
              $ref: '#/components/examples/publicKeyInvalidError'
    fileUploadInfoNotFoundErrors:
      description: File with specified UUID was not found.
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/fileNotFoundError'
          examples:
            file-not-found:
              $ref: '#/components/examples/fileNotFoundError'
    createFilesGroupSuccessful:
      description: The group was created successfully.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/groupInfo'
    createFilesGroupInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/requestFiledsNumberLimitExceededError'
              - $ref: '#/components/schemas/postRequestParserFailedError'
              - $ref: '#/components/schemas/nullCharactersForbiddenError'
              - $ref: '#/components/schemas/signatureRequiredError'
              - $ref: '#/components/schemas/signatureExpirationRequiredError'
              - $ref: '#/components/schemas/signatureExpirationInvalidError'
              - $ref: '#/components/schemas/groupFilesInvalidError'
              - $ref: '#/components/schemas/groupFileURLParsingFailedError'
              - $ref: '#/components/schemas/groupFilesNotFoundError'
          examples:
            request-fields-number-limit-exceeded:
              $ref: '#/components/examples/requestFiledsNumberLimitExceededError'
            post-request-parser-failed:
              $ref: '#/components/examples/postRequestParserFailedError'
            null-characters-forbidden:
              $ref: '#/components/examples/nullCharactersForbiddenError'
            signature-required:
              $ref: '#/components/examples/signatureRequiredError'
            signature-expiration-required:
              $ref: '#/components/examples/signatureExpirationRequiredError'
            signature-expiration-invalid:
              $ref: '#/components/examples/signatureExpirationInvalidError'
            group-files-invalid:
              $ref: '#/components/examples/groupFilesInvalidError'
            group-file-url-parsing-failed:
              $ref: '#/components/examples/groupFileURLParsingFailedError'
            group-files-not-found:
              $ref: '#/components/examples/groupFilesNotFoundError'
    createFilesGroupAccessForbiddenErrors:
      description: Request was not allowed.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/publicKeyRequiredError'
              - $ref: '#/components/schemas/publicKeyInvalidError'
              - $ref: '#/components/schemas/projectPublicKeyRemovedError'
              - $ref: '#/components/schemas/accountBlockedError'
              - $ref: '#/components/schemas/accountUnpaidError'
              - $ref: '#/components/schemas/uploadFailedError'
              - $ref: '#/components/schemas/accountLimitsExceededError'
              - $ref: '#/components/schemas/signatureExpirationError'
              - $ref: '#/components/schemas/signatureInvalidError'
          examples:
            public-key-is-required:
              $ref: '#/components/examples/publicKeyRequiredError'
            public-key-is-invalid:
              $ref: '#/components/examples/publicKeyInvalidError'
            project-public-key-removed:
              $ref: '#/components/examples/projectPublicKeyRemovedError'
            account-blocked:
              $ref: '#/components/examples/accountBlockedError'
            account-unpaid:
              $ref: '#/components/examples/accountUnpaidError'
            upload-failed:
              $ref: '#/components/examples/uploadFailedError'
            account-limits-exceeded:
              $ref: '#/components/examples/accountLimitsExceededError'
            signature-expiration:
              $ref: '#/components/examples/signatureExpirationError'
            signature-invalid:
              $ref: '#/components/examples/signatureInvalidError'
    filesGroupInfoSuccessful:
      description: File group information was retrieved successfully.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/groupInfo'
    filesGroupInfoInputValidationErrors:
      description: Request failed input parameters validation.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/nullCharactersForbiddenError'
              - $ref: '#/components/schemas/groupIdRequiredError'
          examples:
            null-characters-forbidden:
              $ref: '#/components/examples/nullCharactersForbiddenError'
            group-id-required:
              $ref: '#/components/examples/groupIdRequiredError'
    filesGroupInfoAccessForbiddenErrors:
      description: Request was not allowed.
      content:
        text/plain:
          schema:
            anyOf:
              - $ref: '#/components/schemas/publicKeyRequiredError'
              - $ref: '#/components/schemas/publicKeyInvalidError'
          examples:
            public-key-is-required:
              $ref: '#/components/examples/publicKeyRequiredError'
            public-key-is-invalid:
              $ref: '#/components/examples/publicKeyInvalidError'
    filesGroupInfoNotFoundErrors:
      description: Group with specified UUID was not found.
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/groupNotFoundError'
          examples:
            group-not-found:
              $ref: '#/components/examples/groupNotFoundError'
    autoStoreDisabledError:
      description: Autostore is disabled.
      content:
        text/plain:
          schema:
            type: string
            default: Autostore is disabled.
          example: Autostore is disabled.
    uploadcarePublicKeyRequiredError:
      description: UPLOADCARE_PUB_KEY is required.
      content:
        text/plain:
          schema:
            type: string
            default: UPLOADCARE_PUB_KEY is required.
          example: UPLOADCARE_PUB_KEY is required.
    publicKeyRequiredError:
      description: pub_key is required.
      content:
        text/plain:
          schema:
            type: string
            default: pub_key is required.
          example: pub_key is required.
    uploadcarePublicKeyInvalidError:
      description: UPLOADCARE_PUB_KEY is invalid.
      content:
        text/plain:
          schema:
            type: string
            default: UPLOADCARE_PUB_KEY is invalid.
          example: UPLOADCARE_PUB_KEY is invalid.
    publicKeyInvalidError:
      description: pub_key is invalid.
      content:
        text/plain:
          schema:
            type: string
            default: pub_key is invalid.
          example: pub_key is invalid.
    projectPublicKeyRemovedError:
      description: Project <PUB-KEY> is marked as removed.
      content:
        text/plain:
          schema:
            type: string
            default: Project <PUB-KEY> is marked as removed.
          example: Project 39e3eb895fdada95e7a9 is marked as removed.
    accountBlockedError:
      description: Account has been blocked.
      content:
        text/plain:
          schema:
            type: string
            default: Account has been blocked.
          example: Account has been blocked.
    accountUnpaidError:
      description: Account has been blocked for non payment.
      content:
        text/plain:
          schema:
            type: string
            default: Account has been blocked for non payment.
          example: Account has been blocked for non payment.
    uploadFailedError:
      description: Upload failed.
      content:
        text/plain:
          schema:
            type: string
            default: Upload failed.
          example: Upload failed.
    accountLimitsExceededError:
      description: Account has reached its limits.
      content:
        text/plain:
          schema:
            type: string
            default: Account has reached its limits.
          example: Account has reached its limits.
    signatureExpirationError:
      description: Expired signature.
      content:
        text/plain:
          schema:
            type: string
            default: Expired signature.
          example: Expired signature.
    signatureInvalidError:
      description: Invalid signature.
      content:
        text/plain:
          schema:
            type: string
            default: Invalid signature.
          example: Invalid signature.
    requestSizeLimitExceededError:
      description: The size of the request is too large.
      content:
        text/plain:
          schema:
            type: string
            default: The size of the request is too large.
          example: The size of the request is too large.
    requestWasThrottledError:
      description: Request was throttled.
      headers:
        Retry-After:
          description: Number of seconds to wait before the next request.
          schema:
            type: integer
      content:
        text/plain:
          schema:
            type: string
            default: Request was throttled.
          example: Request was throttled.
  schemas:
    signatureType:
      type: string
      description: |
        `signature` must be sent along with your upload request if you would like to use signed uploads.
        The signature should be generated on your backend.
        **Note**: the process requires knowledge of your Uploadcare Project's Secret key.
        See [signed uploads](https://uploadcare.com/docs/security/secure-uploads/) for details.
      example: 04b29480233f4def5c875875b6bdc3b1
    expireType:
      type: integer
      description: |
        `expire` must be sent along with your upload request if you would like to use signed uploads.
        The parameter defines the time during which your signature is valid. It's a UNIX timestamp.
        See [signed uploads](https://uploadcare.com/docs/security/secure-uploads/) for details.
      example: 1454902434
    storeType:
      type: string
      description: |
        Determines if an uploaded file should be marked as temporary or permanent.

        The parameter can have the following values:
        - `0` - do not mark an uploaded file as stored and remove it after 24 hours
        - `1` - mark the uploaded file as stored
        - `auto` - delegate the choice of the file-storing behavior to a project-wide setting called
          [auto-store](https://app.uploadcare.com/projects/-/settings/#storage).

        The default value depends on the user registration date.

        For all users registered after February 12, 2024 (UTC 13:30), the default value is `auto`.
        File-storing behavior depends entirely on what is set in the
        [storage settings](https://app.uploadcare.com/projects/-/settings/#storage) in the Dashboard.

        For users registered before February 12, 2024, the default value is `0`.
        To ensure that file storage in the project matches the settings in the Dashboard,
        change the value to `auto`.
      enum:
        - '0'
        - '1'
        - auto
      default: auto
      example: '1'
    projectPublicKeyType:
      type: string
      description: Public key identifying an Uploadcare project your uploads will go to.
      example: caa9d29da887ee88ffe6
    fileUploadInfo:
      type: object
      description: Information about an uploaded file.
      required:
        - uuid
        - file_id
        - size
        - total
        - done
        - original_filename
        - filename
        - mime_type
        - image_info
        - video_info
        - content_info
        - metadata
        - is_image
        - is_stored
        - is_ready
      properties:
        uuid:
          type: string
          format: uuid
          description: File's unique ID.
          example: 575ed4e8-f4e8-4c14-a58b-1527b6d9ee46
        file_id:
          type: string
          format: uuid
          description: Same as `uuid`
          example: 575ed4e8-f4e8-4c14-a58b-1527b6d9ee46
        size:
          type: integer
          description: File's size in bytes.
          example: 145212
        total:
          type: integer
          description: Same as `size`.
          example: 145212
        done:
          type: integer
          description: Same as `size`.
          example: 145212
        original_filename:
          type: string
          description: Original file of the uploaded file.
          example: test-image_1.jpg
        filename:
          type: string
          description: Sanitized `original_filename`.
          example: testimage_1.jpg
        mime_type:
          type: string
          description: File's MIME-type.
          example: image/jpeg
        image_info:
          $ref: '#/components/schemas/imageInfo'
        video_info:
          $ref: '#/components/schemas/legacyVideoInfo'
        content_info:
          $ref: '#/components/schemas/contentInfo'
        metadata:
          $ref: '#/components/schemas/metadata'
        is_image:
          type: boolean
          description: True if the uploaded file is an image of a supported file format.
          example: true
        is_stored:
          type: boolean
          description: True if the file has been marked as stored.
          example: true
        is_ready:
          type: boolean
          description: True if the file is ready to be fetched from Uploadcare's CDN.
          example: true
        s3_bucket:
          type: string
          nullable: true
          description: Name of an AWS S3 bucket where the file is stored. Only available if you associate a Foreign Storage Bucket with your project.
          example: custom-s3-bucket-name
      example:
        uuid: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        file_id: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        size: 2667636
        total: 2667636
        done: 2667636
        original_filename: IMG-0412_123.JPG
        filename: IMG0412_123.JPG
        mime_type: image/jpeg
        image_info:
          color_mode: RGB
          orientation: 6
          format: JPEG
          height: 4032
          width: 3024
          sequence: false
          geo_location:
            latitude: 55.62013611111111
            longitude: 37.66299166666666
          datetime_original: '2018-08-20T08:59:50'
          dpi:
            - 72
            - 72
        video_info: null
        content_info:
          mime:
            mime: image/jpeg
            type: image
            subtype: jpeg
          image:
            color_mode: RGB
            orientation: 6
            format: JPEG
            height: 4032
            width: 3024
            sequence: false
            geo_location:
              latitude: 55.62013611111111
              longitude: 37.66299166666666
            datetime_original: '2018-08-20T08:59:50'
            dpi:
              - 72
              - 72
        metadata:
          subsystem: uploader
          pet: cat
        is_image: true
        is_stored: true
        is_ready: true
    fileUploadInfoWaitingStatus:
      title: Waiting
      type: object
      properties:
        status:
          type: string
          enum:
            - waiting
          default: waiting
          description: |
            The system is preparing to handle the request.
    fileUploadInfoProgressStatus:
      title: Progress
      type: object
      properties:
        status:
          type: string
          enum:
            - progress
          default: progress
          description: |
            The system is fetching/uploading the file.
        total:
          type: number
          nullable: true
          description: |
            The expected size of the fetched file (in bytes).

            **Note:** the value can be missing if the server we are fetching the file from
            does not provide the information or if the server is returning the file in, for
            example, [compressed form](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding).
          example: 732434
        done:
          type: number
          description: |
            How many bytes of the file have been fetched so far.
          example: 134427
    fileUploadInfoSuccessStatus:
      title: Success
      allOf:
        - type: object
          properties:
            status:
              type: string
              enum:
                - success
              default: success
              description: The file has been fetched/uploaded successfully.
        - $ref: '#/components/schemas/fileUploadInfo'
      example:
        status: success
        uuid: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        file_id: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        size: 2667636
        total: 2667636
        done: 2667636
        original_filename: IMG-0412_123.JPG
        filename: IMG0412_123.JPG
        mime_type: image/jpeg
        image_info:
          color_mode: RGB
          orientation: 6
          format: JPEG
          height: 4032
          width: 3024
          sequence: false
          geo_location:
            latitude: 55.62013611111111
            longitude: 37.66299166666666
          datetime_original: '2018-08-20T08:59:50'
          dpi:
            - 72
            - 72
        video_info: null
        content_info:
          mime:
            mime: image/jpeg
            type: image
            subtype: jpeg
          image:
            color_mode: RGB
            orientation: 6
            format: JPEG
            height: 4032
            width: 3024
            sequence: false
            geo_location:
              latitude: 55.62013611111111
              longitude: 37.66299166666666
            datetime_original: '2018-08-20T08:59:50'
            dpi:
              - 72
              - 72
        metadata:
          subsystem: uploader
          pet: cat
        is_image: true
        is_stored: true
        is_ready: true
    fileUploadInfoErrorStatus:
      title: Error
      type: object
      properties:
        status:
          type: string
          enum:
            - error
          default: error
          description: |
            The system failed to fetch and/or upload the file.
        error:
          type: string
          description: |
            Human readable description of the issue with the fetch/upload task.
          example: 'HTTP client error: 404.'
        error_code:
          type: string
          description: |
            Machine readable error code.

            Note: See the [Errors > FromURL upload errors](#tag/Errors) section of this
            page for a full list of all possible error codes.
          example: DownloadFileHTTPClientError
    fileUploadInfoUnknownStatus:
      title: Unknown
      type: object
      properties:
        status:
          type: string
          enum:
            - unknown
          default: unknown
          description: |
            The system does not have information about the task.

            Note: Uploadcare stores information about the `/from_url/` tasks for a limited
            period of time only. The endpoint can return the status `unknown` for the tasks
            that are tool old (or that have not been created at all).
    fileUploadInfoFromURL:
      allOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - file_info
              example: file_info
        - $ref: '#/components/schemas/fileUploadInfo'
    fromURLUploadResponseSchema:
      type: object
      description: '`/from_url/` upload response.'
      properties:
        type:
          type: string
          enum:
            - token
          example: token
        token:
          type: string
          format: uuid
          description: Token to identify a `/from_url/` request.
          example: 945ebb27-1fd6-46c6-a859-b9893712d650
    groupInfo:
      type: object
      description: File group information object.
      properties:
        id:
          type: string
          description: Group's unique ID.
          example: d52d7136-a2e5-4338-9f45-affbf83b857d~2
        datetime_created:
          type: string
          description: ISO-8601 date and time when the group was created.
          format: date-time
          example: '2015-09-21T12:39:13.743754Z'
        datetime_stored:
          nullable: true
          description: Deprecated. This field will be removed in a future version of the Upload API.
          type: string
          format: date-time
          example: '2015-09-21T12:39:13.953757Z'
          deprecated: true
        files_count:
          type: integer
          description: Number of the files in the group.
          example: 2
        cdn_url:
          type: string
          format: uri
          description: Group's CDN URL.
          example: http://www.ucarecdn.com/d52d7136-a2e5-4338-9f45-affbf83b857d~2/
        url:
          type: string
          description: Group's API resource URL. See the [REST API](/docs/api/rest/) documentation for details.
          format: uri
          example: https://api.uploadcare.com/groups/d52d7136-a2e5-4338-9f45-affbf83b857d~2/
        files:
          type: array
          description: |
            The list of files in the group. An array may contain null values if a file has been removed.
          nullable: true
          allOf:
            - type: object
              properties:
                default_effects:
                  type: string
                  format: uri
                  description: The field contains a set of processing operations applied to the file when the group was created. This set is applied by default when the file is reffered via a group CDN URL and `/nth/N/` operator.
                  example: resize/x800/
            - $ref: '#/components/schemas/fileUploadInfo'
      example:
        id: 0d712319-b970-4602-850c-bae1ced521a6~1
        datetime_created: '2018-09-12T10:03:38.686710Z'
        datetime_stored: null
        files_count: 1
        cdn_url: https://ucarecdn.com/0d712319-b970-4602-850c-bae1ced521a6~1/
        url: https://api.uploadcare.com/groups/0d712319-b970-4602-850c-bae1ced521a6~1/
        files:
          - default_effects: resize/x800/
            uuid: be3b4d5e-179d-460e-8a5d-69112ac86cbb
            file_id: be3b4d5e-179d-460e-8a5d-69112ac86cbb
            size: 2667636
            total: 2667636
            done: 2667636
            original_filename: IMG-0412_123.JPG
            filename: IMG0412_123.JPG
            mime_type: image/jpeg
            image_info:
              color_mode: RGB
              orientation: 6
              format: JPEG
              height: 4032
              width: 3024
              sequence: false
              geo_location:
                latitude: 55.62013611111111
                longitude: 37.66299166666666
              datetime_original: '2018-08-20T08:59:50'
              dpi:
                - 72
                - 72
            video_info: null
            content_info:
              mime:
                mime: image/jpeg
                type: image
                subtype: jpeg
              image:
                color_mode: RGB
                orientation: 6
                format: JPEG
                height: 4032
                width: 3024
                sequence: false
                geo_location:
                  latitude: 55.62013611111111
                  longitude: 37.66299166666666
                datetime_original: '2018-08-20T08:59:50'
                dpi:
                  - 72
                  - 72
            metadata:
              subsystem: uploader
              pet: cat
            is_image: true
            is_stored: true
            is_ready: true
    metadataValue:
      type: string
      description: |
        Arbitrary metadata associated with the file.
        See [docs](https://uploadcare.com/docs/file-metadata/) and [REST API v0.7](/docs/api/rest/file-metadata/) for more information.
      minLength: 1
      maxLength: 512
      example: '#/components/examples/metadataValue/value'
    autoStoreDisabledError:
      type: string
      default: Autostore is disabled.
      example: '#/components/examples/autoStoreDisabledError/value'
    uploadcarePublicKeyRequiredError:
      type: string
      default: UPLOADCARE_PUB_KEY is required.
      example: '#/components/examples/uploadcarePublicKeyRequiredError/value'
    publicKeyRequiredError:
      type: string
      default: pub_key is required.
      example: '#/components/examples/publicKeyRequiredError/value'
    uploadcarePublicKeyInvalidError:
      type: string
      default: UPLOADCARE_PUB_KEY is invalid.
      example: '#/components/examples/uploadcarePublicKeyInvalidError/value'
    publicKeyInvalidError:
      type: string
      default: pub_key is invalid.
      example: '#/components/examples/publicKeyInvalidError/value'
    projectPublicKeyRemovedError:
      type: string
      default: Project <PUB-KEY> is marked as removed.
      example: '#/components/examples/projectPublicKeyRemovedError/value'
    accountBlockedError:
      type: string
      default: Account has been blocked.
      example: '#/components/examples/accountBlockedError/value'
    accountUnpaidError:
      type: string
      default: Account has been blocked for non payment.
      example: '#/components/examples/accountUnpaidError/value'
    uploadFailedError:
      type: string
      default: Upload failed.
      example: '#/components/examples/uploadFailedError/value'
    accountLimitsExceededError:
      type: string
      default: Account has reached its limits.
      example: '#/components/examples/accountLimitsExceededError/value'
    signatureExpirationError:
      type: string
      default: Expired signature.
      example: '#/components/examples/signatureExpirationError/value'
    signatureInvalidError:
      type: string
      default: Invalid signature.
      example: '#/components/examples/signatureInvalidError/value'
    requestFiledsNumberLimitExceededError:
      type: string
      default: The request contains too many HTTP POST fields.
      example: '#/components/examples/requestFiledsNumberLimitExceededError/value'
    postRequestParserFailedError:
      type: string
      default: HTTP POST request parsing failed.
      example: '#/components/examples/postRequestParserFailedError/value'
    nullCharactersForbiddenError:
      type: string
      default: Null characters are not allowed.
      example: '#/components/examples/nullCharactersForbiddenError/value'
    fileMetadataKeyDuplicatedError:
      type: string
      default: File's metadata key `<KEY>` has a duplicate.
      example: '#/components/examples/fileMetadataKeyDuplicatedError/value'
    fileMetadataKeyEmptyError:
      type: string
      default: File's metadata key can not be empty.
      example: '#/components/examples/fileMetadataKeyEmptyError/value'
    fileMetadataKeyForbiddenError:
      type: string
      default: File's metadata key `<KEY>` contains symbols not allowed by the metadata key format.
      example: '#/components/examples/fileMetadataKeyForbiddenError/value'
    fileMetadataKeyLengthTooBigError:
      type: string
      default: Length of file metadata key `<KEY>` can not be more than <LENGTH> symbols.
      example: '#/components/examples/fileMetadataKeyLengthTooBigError/value'
    fileMetadataValueEmptyError:
      type: string
      default: Value of the file metadata key `<KEY>` can not be empty.
      example: '#/components/examples/fileMetadataValueEmptyError/value'
    fileMetadataValueForbiddenError:
      type: string
      default: Value of file metadata key `<KEY>` contains symbols not allowed by the metadata value format.
      example: '#/components/examples/fileMetadataValueForbiddenError/value'
    fileMetadataValueLengthTooBigError:
      type: string
      default: Value of file metadata's key `<KEY>` can not be more than <LENGTH> symbols in length.
      example: '#/components/examples/fileMetadataValueLengthTooBigError/value'
    fileMetadataKeysNumberTooBigError:
      type: string
      default: A file can not have more than <NUMBER> metadata keys.
      example: '#/components/examples/fileMetadataKeysNumberTooBigError/value'
    filesRequiredError:
      type: string
      default: Request does not contain files.
      example: '#/components/examples/filesRequiredError/value'
    fileSizeLimitExceededError:
      type: string
      default: File is too large.
      example: '#/components/examples/fileSizeLimitExceededError/value'
    fileTypeForbiddenError:
      type: string
      default: Uploading of these file types is not allowed.
      example: '#/components/examples/fileTypeForbiddenError/value'
    fileInfectedError:
      type: string
      default: The file is infected by <VIRUS-NAME> virus.
      example: '#/components/examples/fileInfectedError/value'
    SVGValidationFailedError:
      type: string
      default: 'SVG validation failed: <REASON>.'
      example: '#/components/examples/SVGValidationFailedError/value'
    SVGMaliciousContentError:
      type: string
      default: 'SVG contains malicious content: <REASON>.'
      example: '#/components/examples/SVGMaliciousContentError/value'
    requestParamRequiredError:
      type: string
      default: <PARAMETER-NAME> is required.
      example: '#/components/examples/requestParamRequiredError/value'
    multipartSizeInvalidError:
      type: string
      default: size should be integer.
      example: '#/components/examples/multipartSizeInvalidError/value'
    multipartFileSizeLimitExceededError:
      type: string
      default: File size exceeds project limit.
      example: '#/components/examples/multipartFileSizeLimitExceededError/value'
    multipartFileSizeTooSmallError:
      type: string
      default: File size can not be less than <SIZE> bytes. Please use direct upload instead of multipart.
      example: '#/components/examples/multipartFileSizeTooSmallError/value'
    multipartPartSizeInvalidError:
      type: string
      default: Multipart Upload Part Size should be an integer.
      example: '#/components/examples/multipartPartSizeInvalidError/value'
    multipartPartSizeTooSmallError:
      type: string
      default: Multipart Upload Part Size can not be less than <SIZE> bytes.
      example: '#/components/examples/multipartPartSizeTooSmallError/value'
    multipartPartSizeTooBigError:
      type: string
      default: Multipart Upload Part Size can not be more than <SIZE> bytes.
      example: '#/components/examples/multipartPartSizeTooBigError/value'
    multipartFileIdRequiredError:
      type: string
      default: uuid is required.
      example: '#/components/examples/multipartFileIdRequiredError/value'
    multipartFileAlreadyUploadedError:
      type: string
      default: File is already uploaded.
      example: '#/components/examples/multipartFileAlreadyUploadedError/value'
    multipartUploadSizeTooLargeError:
      type: string
      default: Uploaded size is more than expected.
      example: '#/components/examples/multipartUploadSizeTooLargeError/value'
    multipartUploadSizeTooSmallError:
      type: string
      default: File size mismatch. Not all parts uploaded?
      example: '#/components/examples/multipartUploadSizeTooSmallError/value'
    multipartFileCompletionFailedError:
      type: string
      default: Can not complete upload. Wrong parts size?
      example: '#/components/examples/multipartFileCompletionFailedError/value'
    uuidInvalidError:
      type: string
      default: uuid is invalid.
      example: '#/components/examples/uuidInvalidError/value'
    sourceURLRequiredError:
      type: string
      default: source_url is required.
      example: '#/components/examples/sourceURLRequiredError/value'
    urlParsingFailedError:
      type: string
      default: Failed to parse URL.
      example: '#/components/examples/urlParsingFailedError/value'
    urlSchemeRequiredError:
      type: string
      default: No URL scheme supplied.
      example: '#/components/examples/urlSchemeRequiredError/value'
    urlSchemeInvalidError:
      type: string
      default: Invalid URL scheme.
      example: '#/components/examples/urlSchemeInvalidError/value'
    urlHostRequiredError:
      type: string
      default: No URL host supplied.
      example: '#/components/examples/urlHostRequiredError/value'
    urlBlacklistedError:
      type: string
      default: Source is blacklisted.
      example: '#/components/examples/urlBlacklistedError/value'
    hostnameNotFoundError:
      type: string
      default: Host does not exist.
      example: '#/components/examples/hostnameNotFoundError/value'
    urlHostMalformedError:
      type: string
      default: URL host is malformed.
      example: '#/components/examples/urlHostMalformedError/value'
    urlHostPrivateIPForbiddenError:
      type: string
      default: Only public IPs are allowed.
      example: '#/components/examples/urlHostPrivateIPForbiddenError/value'
    tokenRequiredError:
      type: string
      default: token is required.
      example: '#/components/examples/tokenRequiredError/value'
    fileIdRequiredError:
      type: string
      default: file_id is required.
      example: '#/components/examples/fileIdRequiredError/value'
    fileIdInvalidError:
      type: string
      default: file_id is invalid.
      example: '#/components/examples/fileIdInvalidError/value'
    fileNotFoundError:
      type: string
      default: File is not found.
      example: '#/components/examples/fileNotFoundError/value'
    groupFilesInvalidError:
      type: string
      default: 'This is not valid file url: %s.'
      example: '#/components/examples/groupFilesInvalidError/value'
    groupFileURLParsingFailedError:
      type: string
      default: No files[N] parameters found.
      example: '#/components/examples/groupFileURLParsingFailedError/value'
    groupFilesNotFoundError:
      type: string
      default: Some files not found.
      example: '#/components/examples/groupFilesNotFoundError/value'
    groupIdRequiredError:
      type: string
      default: group_id is required.
      example: '#/components/examples/groupIdRequiredError/value'
    groupNotFoundError:
      type: string
      default: group_id is invalid.
      example: '#/components/examples/groupNotFoundError/value'
    signatureRequiredError:
      type: string
      default: '`signature` is required.'
      example: '#/components/examples/signatureRequiredError/value'
    signatureExpirationRequiredError:
      type: string
      default: '`expire` is required.'
      example: '#/components/examples/signatureExpirationRequiredError/value'
    signatureExpirationInvalidError:
      type: string
      default: '`expire` must be a UNIX timestamp.'
      example: '#/components/examples/signatureExpirationInvalidError/value'
    legacyVideoInfo:
      type: object
      nullable: true
      description: Video metadata.
      properties:
        duration:
          type: integer
          description: Video file's duration in milliseconds.
          example: 261827
        format:
          type: string
          description: Video file's format.
          example: mp4
        bitrate:
          type: integer
          description: Video file's bitrate.
          example: 393
        audio:
          type: object
          description: Audio stream's metadata.
          nullable: true
          properties:
            bitrate:
              nullable: true
              type: number
              description: Audio stream's bitrate.
              example: 78
            codec:
              nullable: true
              type: string
              description: Audio stream's codec.
              example: aac
            sample_rate:
              nullable: true
              type: integer
              description: Audio stream's sample rate.
              example: 44100
            channels:
              nullable: true
              type: integer
              description: Audio stream's number of channels.
              example: 2
        video:
          type: object
          description: Video stream's metadata.
          properties:
            height:
              type: integer
              description: Video stream's image height.
              example: 360
            width:
              type: integer
              description: Video stream's image width.
              example: 640
            frame_rate:
              type: number
              description: Video stream's frame rate.
              example: 30
            bitrate:
              type: integer
              description: Video stream's bitrate.
              example: 315
            codec:
              type: string
              description: Video stream codec.
              example: h264
    imageInfo:
      type: object
      description: Image metadata.
      required:
        - color_mode
        - orientation
        - format
        - height
        - width
        - geo_location
        - datetime_original
        - dpi
        - sequence
      properties:
        color_mode:
          type: string
          description: Image color mode.
          enum:
            - RGB
            - RGBA
            - RGBa
            - RGBX
            - L
            - LA
            - La
            - P
            - PA
            - CMYK
            - YCbCr
            - HSV
            - LAB
          example: RGBA
        orientation:
          type: integer
          description: Image orientation from EXIF.
          nullable: true
          minimum: 0
          maximum: 8
          example: 6
        format:
          type: string
          description: Image format.
          example: JPEG
        sequence:
          type: boolean
          description: Set to true if a file contains a sequence of images (GIF for example).
          example: false
        height:
          type: integer
          description: Image height in pixels.
          example: 2352
        width:
          type: integer
          description: Image width in pixels.
          example: 2935
        geo_location:
          description: Geo-location of image from EXIF.
          type: object
          nullable: true
          required:
            - latitude
            - longitude
          properties:
            latitude:
              type: number
              description: Location latitude.
              example: -1.1884555555555556
            longitude:
              type: number
              description: Location longitude.
              example: 52.66996666666667
        datetime_original:
          type: string
          description: Image date and time from EXIF. Please be aware that this data is not always formatted and displayed exactly as it appears in the EXIF.
          nullable: true
          format: date-time
          example: '2018-09-13T16:23:40'
        dpi:
          type: array
          description: Image DPI for two dimensions.
          nullable: true
          items:
            type: number
            example: 72
          minItems: 2
          maxItems: 2
          example:
            - 72
            - 72
    videoInfo:
      type: object
      description: Video metadata.
      required:
        - duration
        - format
        - bitrate
        - audio
        - video
      properties:
        duration:
          type: integer
          description: Video file's duration in milliseconds.
          nullable: true
          example: 261827
        format:
          type: string
          description: Video file's format.
          example: mp4
        bitrate:
          type: integer
          description: Video file's bitrate.
          nullable: true
          example: 393
        audio:
          type: array
          items:
            type: object
            description: Audio stream's metadata.
            required:
              - bitrate
              - codec
              - sample_rate
              - channels
            properties:
              bitrate:
                type: integer
                description: Audio stream's bitrate.
                nullable: true
                example: 78
              codec:
                type: string
                description: Audio stream's codec.
                nullable: true
                example: aac
              sample_rate:
                type: integer
                description: Audio stream's sample rate.
                nullable: true
                example: 44100
              channels:
                type: integer
                description: Audio stream's number of channels.
                nullable: true
                example: 2
        video:
          type: array
          items:
            type: object
            description: Video stream's metadata.
            required:
              - height
              - width
              - frame_rate
              - bitrate
              - codec
            properties:
              height:
                type: integer
                description: Video stream's image height.
                example: 360
              width:
                type: integer
                description: Video stream's image width.
                example: 640
              frame_rate:
                type: number
                description: Video stream's frame rate.
                example: 30
              bitrate:
                type: integer
                description: Video stream's bitrate.
                nullable: true
                example: 315
              codec:
                type: string
                description: Video stream's codec.
                nullable: true
                example: h264
    contentInfo:
      type: object
      nullable: true
      description: Information about file content.
      properties:
        mime:
          type: object
          description: MIME type.
          required:
            - mime
            - type
            - subtype
          properties:
            mime:
              type: string
              description: Full MIME type.
              example: image/jpeg
            type:
              type: string
              description: Type of MIME type.
              example: image
            subtype:
              type: string
              description: Subtype of MIME type.
              example: jpeg
        image:
          $ref: '#/components/schemas/imageInfo'
        video:
          $ref: '#/components/schemas/videoInfo'
    metadata:
      type: object
      nullable: true
      description: Arbitrary metadata associated with a file.
  examples:
    metadataValue:
      value: uploader
    autoStoreDisabledError:
      value: Autostore is disabled.
    uploadcarePublicKeyRequiredError:
      value: UPLOADCARE_PUB_KEY is required.
    publicKeyRequiredError:
      value: pub_key is required.
    uploadcarePublicKeyInvalidError:
      value: UPLOADCARE_PUB_KEY is invalid.
    publicKeyInvalidError:
      value: pub_key is invalid.
    projectPublicKeyRemovedError:
      value: Project 39e3eb895fdada95e7a9 is marked as removed.
    accountBlockedError:
      value: Account has been blocked.
    accountUnpaidError:
      value: Account has been blocked for non payment.
    uploadFailedError:
      value: Upload failed.
    accountLimitsExceededError:
      value: Account has reached its limits.
    signatureExpirationError:
      value: Expired signature.
    signatureInvalidError:
      value: Invalid signature.
    requestFiledsNumberLimitExceededError:
      value: The request contains too many HTTP POST fields.
    postRequestParserFailedError:
      value: HTTP POST request parsing failed.
    nullCharactersForbiddenError:
      value: Null characters are not allowed.
    fileMetadataKeyDuplicatedError:
      value: File's metadata key `subsystem` has a duplicate.
    fileMetadataKeyEmptyError:
      value: File's metadata key can not be empty.
    fileMetadataKeyForbiddenError:
      value: File's metadata key `subsystem` contains symbols not allowed by the metadata key format.
    fileMetadataKeyLengthTooBigError:
      value: Length of file metadata key `aaa...` can not be more than 64 symbols.
    fileMetadataValueEmptyError:
      value: Value of the file metadata key `subsystem` can not be empty.
    fileMetadataValueForbiddenError:
      value: Value of file metadata key `subsystem` contains symbols not allowed by the metadata value format.
    fileMetadataValueLengthTooBigError:
      value: Value of file metadata's key `subsystem` can not be more than 512 symbols in length.
    fileMetadataKeysNumberTooBigError:
      value: A file can not have more than 50 metadata keys.
    filesRequiredError:
      value: Request does not contain files.
    fileSizeLimitExceededError:
      value: File is too large.
    fileTypeForbiddenError:
      value: Uploading of these file types is not allowed.
    fileInfectedError:
      value: The file is infected by Win.Test.EICAR_HDB-1 virus.
    SVGValidationFailedError:
      value: 'SVG validation failed: Failed to parse the document.'
    SVGMaliciousContentError:
      value: 'SVG contains malicious content: <script> tags are not allowed.'
    requestParamRequiredError:
      value: filename is required.
    multipartSizeInvalidError:
      value: size should be integer.
    multipartFileSizeLimitExceededError:
      value: File size exceeds project limit.
    multipartFileSizeTooSmallError:
      value: File size can not be less than 10485760 bytes. Please use direct upload instead of multipart.
    multipartPartSizeInvalidError:
      value: Multipart Upload Part Size should be an integer.
    multipartPartSizeTooSmallError:
      value: Multipart Upload Part Size can not be less than 5242880 bytes.
    multipartPartSizeTooBigError:
      value: Multipart Upload Part Size can not be more than 5368709120 bytes.
    multipartFileIdRequiredError:
      value: uuid is required.
    multipartFileAlreadyUploadedError:
      value: File is already uploaded.
    multipartUploadSizeTooLargeError:
      value: Uploaded size is more than expected.
    multipartUploadSizeTooSmallError:
      value: File size mismatch. Not all parts uploaded?
    multipartFileCompletionFailedError:
      value: Can not complete upload. Wrong parts size?
    uuidInvalidError:
      value: uuid is invalid.
    sourceURLRequiredError:
      value: source_url is required.
    urlParsingFailedError:
      value: Failed to parse URL.
    urlSchemeRequiredError:
      value: No URL scheme supplied.
    urlSchemeInvalidError:
      value: Invalid URL scheme.
    urlHostRequiredError:
      value: No URL host supplied.
    urlBlacklistedError:
      value: Source is blacklisted.
    hostnameNotFoundError:
      value: Host does not exist.
    urlHostMalformedError:
      value: URL host is malformed.
    urlHostPrivateIPForbiddenError:
      value: Only public IPs are allowed.
    tokenRequiredError:
      value: token is required.
    fileIdRequiredError:
      value: file_id is required.
    fileIdInvalidError:
      value: file_id is invalid.
    fileNotFoundError:
      value: File is not found.
    groupFilesInvalidError:
      value: 'This is not valid file url: wrong-uuid.'
    groupFileURLParsingFailedError:
      value: No files[N] parameters found.
    groupFilesNotFoundError:
      value: Some files not found.
    groupIdRequiredError:
      value: group_id is required.
    groupNotFoundError:
      value: group_id is invalid.
    signatureRequiredError:
      value: '`signature` is required.'
    signatureExpirationRequiredError:
      value: '`expire` is required.'
    signatureExpirationInvalidError:
      value: '`expire` must be a UNIX timestamp.'
    fileUploadInfoWithType:
      value:
        type: file_info
        uuid: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        file_id: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        size: 2667636
        total: 2667636
        done: 2667636
        original_filename: IMG-0412_123.JPG
        filename: IMG0412_123.JPG
        mime_type: image/jpeg
        image_info:
          color_mode: RGB
          orientation: 6
          format: JPEG
          height: 4032
          width: 3024
          sequence: false
          geo_location:
            latitude: 55.62013611111111
            longitude: 37.66299166666666
          datetime_original: '2018-08-20T08:59:50'
          dpi:
            - 72
            - 72
        video_info: null
        content_info:
          mime:
            mime: image/jpeg
            type: image
            subtype: jpeg
          image:
            color_mode: RGB
            orientation: 6
            format: JPEG
            height: 4032
            width: 3024
            sequence: false
            geo_location:
              latitude: 55.62013611111111
              longitude: 37.66299166666666
            datetime_original: '2018-08-20T08:59:50'
            dpi:
              - 72
              - 72
        metadata:
          subsystem: uploader
          pet: cat
        is_image: true
        is_stored: true
        is_ready: true
    fileUploadInfoWithStatus:
      value:
        status: success
        uuid: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        file_id: be3b4d5e-179d-460e-8a5d-69112ac86cbb
        size: 2667636
        total: 2667636
        done: 2667636
        original_filename: IMG-0412_123.JPG
        filename: IMG0412_123.JPG
        mime_type: image/jpeg
        image_info:
          color_mode: RGB
          orientation: 6
          format: JPEG
          height: 4032
          width: 3024
          sequence: false
          geo_location:
            latitude: 55.62013611111111
            longitude: 37.66299166666666
          datetime_original: '2018-08-20T08:59:50'
          dpi:
            - 72
            - 72
        video_info: null
        content_info:
          mime:
            mime: image/jpeg
            type: image
            subtype: jpeg
          image:
            color_mode: RGB
            orientation: 6
            format: JPEG
            height: 4032
            width: 3024
            sequence: false
            geo_location:
              latitude: 55.62013611111111
              longitude: 37.66299166666666
            datetime_original: '2018-08-20T08:59:50'
            dpi:
              - 72
              - 72
        metadata:
          subsystem: uploader
          pet: cat
        is_image: true
        is_stored: true
        is_ready: true
