---
title: Create a file container
slug: '43'
canonical_url: https://docs.coveo.com/en/43/
collection: index-content
source_format: adoc
---
# Create a file container

:figure-caption!:

You'll typically use a file container when you want to push:

* [Large item data](https://docs.coveo.com/en/69.md)

* [Batches of items](https://docs.coveo.com/en/90.md)

* [Batches of security identities](https://docs.coveo.com/en/55.md)

This article provides an overview of the `Create a file container` request.

**Sequence diagram highlighting the `Create a file container` request in the context of a batch update sequence and illustrating how the [Coveo indexing pipeline](https://docs.coveo.com/en/1893.md) handles the batch update.**
![Sequence diagram for POST files request | Coveo](https://docs.coveo.com/en/assets/images/index-content/post-files-sequence-diagram.svg)

## Request template

> **Note**
>
> The Push API still uses region-specific endpoints.
> Use the endpoint that matches the primary deployment region of your Coveo organization.
**US East region**
<details><summary>Details</summary>

```http
POST https://api.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/files?useVirtualHostedStyleUrl=<true|false> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**Canada region**
<details><summary>Details</summary>

```http
POST https://api-ca.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/files?useVirtualHostedStyleUrl=<true|false> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**Ireland region**
<details><summary>Details</summary>

```http
POST https://api-eu.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/files?useVirtualHostedStyleUrl=<true|false> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**Australia region**
<details><summary>Details</summary>

```http
POST https://api-au.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/files?useVirtualHostedStyleUrl=<true|false> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
**HIPAA region**
<details><summary>Details</summary>

```http
POST https://apihipaa.cloud.coveo.com/push/v1/organizations/<MyOrganizationId>/files?useVirtualHostedStyleUrl=<true|false> HTTP/1.1

Accept: application/json
Authorization: Bearer <MyAccessToken>
```

</details>
Request parameters:

**Parameters**
<details><summary>Details</summary>

In the request path:

* Replace `<MyOrganizationId>` with your [organization ID](https://docs.coveo.com/en/148.md).

In the query string:

* Optionally, set `useVirtualHostedStyleUrl` to `true` if you want the service to return a virtual-hosted-style URL, such as `coveo-nprod-customerdata.s3.amazonaws.com/...`.
The default value is currently `false`, which means that the service returns path-style URLs, such as `s3.amazonaws.com/coveo-nprod-customerdata/...`.

> **Important**
>
> The `useVirtualHostedStyleUrl` query string parameter will soon be deprecated as part of the [path-style URL deprecation](https://docs.coveo.com/en/43.md#path-style-url-deprecation).
> From this point onwards, the service will only return virtual hosted-style URLs.
In the `Authorization` HTTP header:

* Replace `<MyAccessToken>` with a Push source API key that grants the [set of privileges required to push items](https://docs.coveo.com/en/1546.md#api-key) to your source.

</details>
Request body: None

Successful response: `201 Created`

The body of a successful response contains important information about the temporary, private, and encrypted Amazon S3 file container that you just created:

```json
{
    "uploadUri": "<UPLOAD_URI>", <1>
    "fileId": "<FILE_ID>", <2>
    "requiredHeaders": { <3>
        "x-amz-server-side-encryption": "AES256",
        "Content-Type": "application/octet-stream"
    }
}
```

<1> The `uploadUri` property contains a pre-signed URI to
make a PUT request to when pushing [item](https://docs.coveo.com/en/210.md) or [security identity](https://docs.coveo.com/en/240.md) data.

> **Notes**
>
> * The Amazon S3 file container applies [AES-256](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) server-side encryption to your data.
> 
> * The file container is automatically deleted as soon as its content has been successfully forwarded to the service.
> 
> * The `uploadUri` automatically expires after 60 minutes.
> 
> Therefore, it's safe to upload sensitive information to the Amazon S3 file container.
<2> The `fileId` property contains the unique identifier of your file container.
<3> The `requiredHeaders` property contains the required HTTP headers for sending
a PUT request to the `uploadUri`.

## Path-style URL deprecation

[Amazon is deprecating path-style URLs](https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html), such as `s3.amazonaws.com/coveo-nprod-customerdata/...`, in favour of virtual hosted-style URLs, such as `coveo-nprod-customerdata.s3.amazonaws.com/...`.
Accordingly, the Push API will also deprecate path-style URLs.

You can already test and use the new hosted-style URL format by setting the [`useVirtualHostedStyleUrl`](#useVirtualHostedStyleUrl) query parameter to `true`.
If you're using the [Crawling Module](https://docs.coveo.com/en/3260.md) or [Coveo for Sitecore](https://docs.coveo.com/en/3408.md#release-notes), you can update to the latest version to test the new behavior.

Virtual hosted-style URLs let you be more precise regarding the list of outbound URL addresses to allow.
For example, if your [primary deployment region](https://docs.coveo.com/en/2976.md) is US East, you can allowlist `coveo-nprod-customerdata.s3.amazonaws.com` rather than `s3.amazonaws.com`.
The following table lists the virtual hosted-style domain for each primary region:

| Main region | Virtual hosted-style domain |
|---|---|
| US East | `coveo-nprod-customerdata.s3.amazonaws.com` |
| Canada | `coveo-cprd-customerdata.s3.ca-central-1.amazonaws.com` |
| Ireland | `coveo-iprd-customerdata.s3.eu-west-1.amazonaws.com` |
| Australia | `coveo-aprd-customerdata.s3.ap-southeast-2.amazonaws.com` |

For HIPAA organizations, the virtual hosted-style domain name is `coveo-nhipaa-customerdata.s3.amazonaws.com`.

## Sample request

The following example shows how to create a file container for a [Coveo organization in the US East region](https://docs.coveo.com/en/2976.md#data-residency).

```http
POST https://api.cloud.coveo.com/push/v1/organizations/mycoveocloudv2organizationg8tp8wu3/files?useVirtualHostedStyleUrl=true HTTP/1.1
​
Accept: application/json
Authorization: Bearer **********-****-****-****-************
```

Request body: None

Response:

```json
{
  "uploadUri": "link:https://coveo-nprod-customerdata.s3.amazonaws.com/proda/blobstore/mycoveocloudv2organizationg8tp8wu3/b5e8767e-8f0d-4a89-9095-1127915c89c7[...]",
  "fileId": "b5e8767e-8f0d-4a89-9095-1127915c89c7",
  "requiredHeaders": {
    "x-amz-server-side-encryption": "AES256",
    "Content-Type": "application/octet-stream"
  }
}
```