> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://uploadcare.com/docs/llms.txt.

# Batch file storing

PUT https://api.uploadcare.com/files/storage/
Content-Type: application/json

Used to store multiple files in one go. Up to 100 files are supported per request. A JSON object holding your File list SHOULD be put into a request body.

Reference: https://uploadcare.com/docs/api/rest/file/files-storing

## Authentication

- `Authorization` header (required) — Every request made to `https://api.uploadcare.com/` MUST be signed. HTTPS SHOULD be used with any authorization scheme. Requests MUST contain the `Authorization` header defining `auth-scheme` and `auth-param`: `Authorization: auth-scheme auth-param`. Every request MUST contain the `Accept` header identifying the REST API version: `Accept: application/vnd.uploadcare-v0.7+json`. There are two available authorization schemes: * For production: `Uploadcare`, a scheme where a `signature`, not your Secret API Key MUST be specified. Signatures SHOULD be generated on backend. * For quick tests: `Uploadcare.Simple`, a simple scheme where your [Secret API Key](https://app.uploadcare.com/projects/-/api-keys/) MUST be specified in every request's `auth-param`.

## Request

### Headers

- `Accept` (string, required) — Version header.

### Body (application/json)

This endpoint expects a list of string.

- `list of string`

## Response

### 200

OK. See `problems` and `result` fields in the response. In case a file list provided in a request holds invalid UUIDs, they'll be included in the `problems` structure. Invalid UUIDs can be incomplete, associated with files that no longer exist, etc.

- `status` (string, optional)
- `problems` (FilesStoragePutResponsesContentApplicationJsonSchemaProblems, optional) — Dictionary of passed files UUIDs and problems associated with these UUIDs.
- `result` (list of file, optional) — List of file objects that have been stored/deleted.

## Errors

### 400 Bad Request Error

File UUIDs list validation errors.

- `FilesStoringRequestBadRequestError`
  - simpleAuthHTTPForbidden: simpleAuthHTTPForbidden
  - FilesStoringRequestBadRequestError1

### 401 Unauthorized Error

Authorization errors.

- `detail` (enum, optional)
  - Allowed values: `Incorrect authentication credentials.`, `Public key {public_key} not found.`, `Secret key not found.`, `Invalid signature. Please check your Secret key.`

### 406 Not Acceptable Error

Invalid version header `Accept` for this endpoint.

- `detail` (string, optional, default: Incorrect Accept header provided. Make sure to specify API version. Refer to REST API docs for details.)

### 429 Too Many Requests Error

Request was throttled.

- `detail` (string, optional)

## Types

### FilesStoragePutResponsesContentApplicationJsonSchemaProblems

Dictionary of passed files UUIDs and problems associated with these UUIDs.

### file

- `datetime_removed` (datetime, required, nullable) — Date and time when a file was removed, if any.
- `datetime_stored` (datetime, required, nullable) — Date and time of the last store request, if any.
- `datetime_uploaded` (datetime, required) — Date and time when a file was uploaded.
- `is_image` (boolean, required) — Is file is image.
- `is_ready` (boolean, required) — Is file is ready to be used after upload.
- `mime_type` (string, required) — File MIME-type.
- `original_file_url` (string, required, nullable) — Publicly available file CDN URL. Available if a file is not deleted.
- `original_filename` (string, required) — Original file name taken from uploaded file.
- `size` (integer, required) — File size in bytes.
- `url` (string, required) — API resource URL for a particular file.
- `uuid` (string, required) — File UUID.
- `variations` (map from string to string, required, nullable) — Dictionary of other files that were created using this file as a source. It's used for video processing and document conversion jobs. E.g., `<conversion_path>: <uuid>`.
- `content_info` (contentInfo, required) — Information about file content.
- `metadata` (metadata, required) — Arbitrary metadata associated with a file.
- `appdata` (applicationDataObject, optional) — Dictionary of application names and data associated with these applications.
- `tags` (list of string, optional) — Ordered list of string tags associated with the file. Empty array if no tags are set.

### simpleAuthHTTPForbidden

- `detail` (string, optional, default: Simple authentication over HTTP is forbidden. Please, use HTTPS or signed requests instead.)

### FilesStoringRequestBadRequestError1

File UUIDs list validation errors.

- `detail` (enum, optional)
  - Allowed values: `Expected list of UUIDs`, `List of UUIDs can not be empty`, `Maximum UUIDs per request is exceeded. The limit is 100`

### contentInfo

Information about file content.

- `mime` (ContentInfoMime, optional) — MIME type.
- `image` (imageInfo, optional) — Image metadata.
- `video` (videoInfo, optional) — Video metadata.

### metadata

Arbitrary metadata associated with a file.

### applicationDataObject

Dictionary of application names and data associated with these applications.

- `aws_rekognition_detect_labels` (awsRekognitionDetectLabels_v2016_06_27, optional)
- `aws_rekognition_detect_moderation_labels` (awsRekognitionDetectModerationLabels_v2016_06_27, optional)
- `remove_bg` (removeBg_v1_0, optional)
- `uc_clamav_virus_scan` (ucClamavVirusScan, optional)

### ContentInfoMime

MIME type.

- `mime` (string, required) — Full MIME type.
- `type` (string, required) — Type of MIME type.
- `subtype` (string, required) — Subtype of MIME type.

### imageInfo

Image metadata.

- `color_mode` (enum, required) — Image color mode.
  - Allowed values: `RGB`, `RGBA`, `RGBa`, `RGBX`, `L`, `LA`, `La`, `P`, `PA`, `CMYK`, `YCbCr`, `HSV`, `LAB`
- `orientation` (integer, required, nullable) — Image orientation from EXIF.
- `format` (string, required) — Image format.
- `sequence` (boolean, required) — Set to true if a file contains a sequence of images (GIF for example).
- `height` (integer, required) — Image height in pixels.
- `width` (integer, required) — Image width in pixels.
- `geo_location` (ImageInfoGeoLocation, required, nullable) — Geo-location of image from EXIF.
- `datetime_original` (datetime, required, nullable) — 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.
- `dpi` (list of double, required, nullable) — Image DPI for two dimensions.

### videoInfo

Video metadata.

- `duration` (integer, required, nullable) — Video file's duration in milliseconds.
- `format` (string, required) — Video file's format.
- `bitrate` (integer, required, nullable) — Video file's bitrate.
- `audio` (list of VideoInfoAudioItems, required)
- `video` (list of VideoInfoVideoItems, required)

### awsRekognitionDetectLabels_v2016_06_27

- `version` (enum, required) — An application version.
  - Allowed values: `2016-06-27`
- `datetime_created` (datetime, required) — Date and time when an application data was created.
- `datetime_updated` (datetime, required) — Date and time when an application data was updated.
- `data` (AwsRekognitionDetectLabelsV20160627Data, required) — Dictionary with a result of an aws rekognition detect labels execution result.

### awsRekognitionDetectModerationLabels_v2016_06_27

- `version` (enum, required) — An application version.
  - Allowed values: `2016-06-27`
- `datetime_created` (datetime, required) — Date and time when an application data was created.
- `datetime_updated` (datetime, required) — Date and time when an application data was updated.
- `data` (AwsRekognitionDetectModerationLabelsV20160627Data, required) — Dictionary with a result of an aws rekognition detect moderation labels execution result.

### removeBg_v1_0

- `version` (enum, required) — An application version.
  - Allowed values: `1.0`
- `datetime_created` (datetime, required) — Date and time when an application data was created.
- `datetime_updated` (datetime, required) — Date and time when an application data was updated.
- `data` (RemoveBgV10Data, required) — Dictionary with a result of an remove.bg information about an image.

### ucClamavVirusScan

- `version` (enum, required) — An application version.
  - Allowed values: `0.104.2`, `0.104.3`, `0.105.0`, `0.105.1`
- `datetime_created` (datetime, required) — Date and time when an application data was created.
- `datetime_updated` (datetime, required) — Date and time when an application data was updated.
- `data` (UcClamavVirusScanData, required) — Dictionary with a result of ClamAV execution result.

### ImageInfoGeoLocation

Geo-location of image from EXIF.

- `latitude` (double, required) — Location latitude.
- `longitude` (double, required) — Location longitude.

### VideoInfoAudioItems

Audio stream's metadata.

- `bitrate` (integer, required, nullable) — Audio stream's bitrate.
- `codec` (string, required, nullable) — Audio stream's codec.
- `sample_rate` (integer, required, nullable) — Audio stream's sample rate.
- `channels` (integer, required, nullable) — Audio stream's number of channels.

### VideoInfoVideoItems

Video stream's metadata.

- `height` (integer, required) — Video stream's image height.
- `width` (integer, required) — Video stream's image width.
- `frame_rate` (double, required) — Video stream's frame rate.
- `bitrate` (integer, required, nullable) — Video stream's bitrate.
- `codec` (string, required, nullable) — Video stream's codec.

### AwsRekognitionDetectLabelsV20160627Data

Dictionary with a result of an aws rekognition detect labels execution result.

- `LabelModelVersion` (string, required)
- `Labels` (list of AwsRekognitionDetectLabelsV20160627DataLabelsItems, required)

### AwsRekognitionDetectModerationLabelsV20160627Data

Dictionary with a result of an aws rekognition detect moderation labels execution result.

- `ModerationModelVersion` (string, required)
- `ModerationLabels` (list of AwsRekognitionDetectModerationLabelsV20160627DataModerationLabelsItems, required)

### RemoveBgV10Data

Dictionary with a result of an remove.bg information about an image.

- `foreground_type` (string, optional) — foreground classification type (present if type_level was set)

### UcClamavVirusScanData

Dictionary with a result of ClamAV execution result.

- `infected` (boolean, required)
- `infected_with` (string, optional)

### AwsRekognitionDetectLabelsV20160627DataLabelsItems

- `Confidence` (double, required)
- `Instances` (list of AwsRekognitionDetectLabelsV20160627DataLabelsItemsInstancesItems, required)
- `Name` (string, required)
- `Parents` (list of AwsRekognitionDetectLabelsV20160627DataLabelsItemsParentsItems, required)

### AwsRekognitionDetectModerationLabelsV20160627DataModerationLabelsItems

- `Confidence` (double, required)
- `Name` (string, required)
- `ParentName` (string, required)

### AwsRekognitionDetectLabelsV20160627DataLabelsItemsInstancesItems

- `BoundingBox` (AwsRekognitionDetectLabelsV20160627DataLabelsItemsInstancesItemsBoundingBox, optional)
- `Confidence` (double, optional)

### AwsRekognitionDetectLabelsV20160627DataLabelsItemsParentsItems

- `Name` (string, optional)

### AwsRekognitionDetectLabelsV20160627DataLabelsItemsInstancesItemsBoundingBox

- `Height` (double, optional)
- `Left` (double, optional)
- `Top` (double, optional)
- `Width` (double, optional)

## Examples

**Request**

```json
[
  "21975c81-7f57-4c7a-aef9-acfe28779f78",
  "cbaf2d73-5169-4b2b-a543-496cf2813dff"
]
```

**Response**

```json
{
  "status": "ok",
  "problems": {
    "21975c81-7f57-4c7a-aef9-acfe28779f78": "Missing in the project",
    "4j334o01-8bs3": "Invalid"
  },
  "result": [
    {
      "datetime_removed": "2024-01-15T09:30:00Z",
      "datetime_stored": "2024-01-15T09:30:00Z",
      "datetime_uploaded": "2024-01-15T09:30:00Z",
      "is_image": true,
      "is_ready": true,
      "mime_type": "image/jpeg",
      "original_file_url": "https://ucarecdn.com/e575ed4e8-f4e8-4c14-a58b-1527b6d9ee46/EU_4.jpg",
      "original_filename": "EU_4.jpg",
      "size": 145212,
      "url": "https://api.uploadcare.com/files/e10ce759-42c3-4185-bae5-e22a9143d68f/",
      "uuid": "575ed4e8-f4e8-4c14-a58b-1527b6d9ee46",
      "variations": {},
      "content_info": {
        "mime": {
          "mime": "image/jpeg",
          "type": "image",
          "subtype": "jpeg"
        },
        "image": {
          "color_mode": "RGBA",
          "orientation": 6,
          "format": "JPEG",
          "sequence": false,
          "height": 2352,
          "width": 2935,
          "geo_location": {
            "latitude": -1.1884555555555556,
            "longitude": 52.66996666666667
          },
          "datetime_original": {},
          "dpi": [
            72,
            72
          ]
        },
        "video": {
          "duration": 261827,
          "format": "mp4",
          "bitrate": 393,
          "audio": [
            {
              "bitrate": 78,
              "codec": "aac",
              "sample_rate": 44100,
              "channels": 2
            }
          ],
          "video": [
            {
              "height": 360,
              "width": 640,
              "frame_rate": 30,
              "bitrate": 315,
              "codec": "h264"
            }
          ]
        }
      },
      "metadata": {},
      "appdata": {
        "aws_rekognition_detect_labels": {
          "version": "2016-06-27",
          "datetime_created": "2024-01-15T09:30:00Z",
          "datetime_updated": "2024-01-15T09:30:00Z",
          "data": {
            "LabelModelVersion": "string",
            "Labels": [
              {
                "Confidence": 1.1,
                "Instances": [
                  {
                    "BoundingBox": {
                      "Height": 1.1,
                      "Left": 1.1,
                      "Top": 1.1,
                      "Width": 1.1
                    },
                    "Confidence": 1.1
                  }
                ],
                "Name": "string",
                "Parents": [
                  {
                    "Name": "string"
                  }
                ]
              }
            ],
            "value": {
              "aws_rekognition_detect_labels": {
                "data": {
                  "LabelModelVersion": "2.0",
                  "Labels": [
                    {
                      "Confidence": 93.41645812988281,
                      "Instances": [],
                      "Name": "Home Decor",
                      "Parents": []
                    },
                    {
                      "Confidence": 70.75951385498047,
                      "Instances": [],
                      "Name": "Linen",
                      "Parents": [
                        {
                          "Name": "Home Decor"
                        }
                      ]
                    },
                    {
                      "Confidence": 64.7123794555664,
                      "Instances": [],
                      "Name": "Sunlight",
                      "Parents": []
                    },
                    {
                      "Confidence": 56.264793395996094,
                      "Instances": [],
                      "Name": "Flare",
                      "Parents": [
                        {
                          "Name": "Light"
                        }
                      ]
                    },
                    {
                      "Confidence": 50.47153854370117,
                      "Instances": [],
                      "Name": "Tree",
                      "Parents": [
                        {
                          "Name": "Plant"
                        }
                      ]
                    }
                  ]
                },
                "datetime_created": "2021-09-21T11:25:31.259763Z",
                "datetime_updated": "2021-09-21T11:27:33.359763Z",
                "version": "2016-06-27"
              }
            }
          }
        },
        "aws_rekognition_detect_moderation_labels": {
          "version": "2016-06-27",
          "datetime_created": "2024-01-15T09:30:00Z",
          "datetime_updated": "2024-01-15T09:30:00Z",
          "data": {
            "ModerationModelVersion": "string",
            "ModerationLabels": [
              {
                "Confidence": 1.1,
                "Name": "string",
                "ParentName": "string"
              }
            ],
            "value": {
              "aws_rekognition_detect_moderation_labels": {
                "data": {
                  "ModerationLabels": [
                    {
                      "Confidence": 93.41645812988281,
                      "Name": "Weapons",
                      "ParentName": "Violence"
                    }
                  ],
                  "ModerationModelVersion": "6.0"
                },
                "datetime_created": "2023-02-21T11:25:31.259763Z",
                "datetime_updated": "2023-02-21T11:27:33.359763Z",
                "version": "2016-06-27"
              }
            }
          }
        },
        "remove_bg": {
          "version": "1.0",
          "datetime_created": "2024-01-15T09:30:00Z",
          "datetime_updated": "2024-01-15T09:30:00Z",
          "data": {
            "foreground_type": "string"
          }
        },
        "uc_clamav_virus_scan": {
          "version": "0.104.2",
          "datetime_created": "2024-01-15T09:30:00Z",
          "datetime_updated": "2024-01-15T09:30:00Z",
          "data": {
            "infected": true,
            "infected_with": "string"
          }
        }
      },
      "tags": [
        "cat",
        "animal"
      ]
    }
  ]
}
```

**SDK Code**

```javascript JS
import {
  storeFiles,
  UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';

const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
  publicKey: 'YOUR_PUBLIC_KEY',
  secretKey: 'YOUR_SECRET_KEY',
});

const result = await storeFiles(
  {
      uuids: [
          'b7a301d1-1bd0-473d-8d32-708dd55addc0',
          '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
        ]
  },
  { authSchema: uploadcareSimpleAuthSchema }
)

```

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

use Uploadcare\Interfaces\File\FileInfoInterface;
$api = (new Uploadcare\Api($configuration))->file();
$result = $api->batchStoreFile(['b7a301d1-1bd0-473d-8d32-708dd55addc0', '1bac376c-aa7e-4356-861b-dd2657b5bfd2']);
foreach ($result->getResult() as $result) {
    if (!$result instanceof FileInfoInterface) {
        continue;
    }
    \sprintf('Result %s is stored at %s', $result->getUuid(), $result->getDatetimeStored()->format(\DateTimeInterface::ATOM));
}

```

```python Python
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')

files = [
    'b7a301d1-1bd0-473d-8d32-708dd55addc0',
    '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
]
uploadcare.store_files(files)

```

```ruby Ruby
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

uuids = %w[
  b7a301d1-1bd0-473d-8d32-708dd55addc0
  1bac376c-aa7e-4356-861b-dd2657b5bfd2
]
Uploadcare::FileList.batch_store(uuids)

```

```swift Swift
import Uploadcare

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

let uuids = [
  "b7a301d1-1bd0-473d-8d32-708dd55addc0",
  "1bac376c-aa7e-4356-861b-dd2657b5bfd2"
]
let response = try await uploadcare.storeFiles(withUUIDs: uuids)
print(response)

```

```kotlin Kotlin
import com.uploadcare.android.library.api.UploadcareClient

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

val uuids = listOf(
    "b7a301d1-1bd0-473d-8d32-708dd55addc0",
    "1bac376c-aa7e-4356-861b-dd2657b5bfd2"
)
uploadcare.saveFiles(uuids)

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.uploadcare.com/files/storage/"

	payload := strings.NewReader("[\n  \"21975c81-7f57-4c7a-aef9-acfe28779f78\",\n  \"cbaf2d73-5169-4b2b-a543-496cf2813dff\"\n]")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Accept", "application/vnd.uploadcare-v0.7+json")
	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.uploadcare.com/files/storage/")
  .header("Accept", "application/vnd.uploadcare-v0.7+json")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("[\n  \"21975c81-7f57-4c7a-aef9-acfe28779f78\",\n  \"cbaf2d73-5169-4b2b-a543-496cf2813dff\"\n]")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.uploadcare.com/files/storage/");
var request = new RestRequest(Method.PUT);
request.AddHeader("Accept", "application/vnd.uploadcare-v0.7+json");
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  \"21975c81-7f57-4c7a-aef9-acfe28779f78\",\n  \"cbaf2d73-5169-4b2b-a543-496cf2813dff\"\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```