# Save a data chunk to the destination environment

For each chunk of content in a set within a transfer operation, use this endpoint to copy the chunk to the *destination* environment after using the corresponding [Retrieve a specific chunk of transfer data](#operation/ContentTransfer_GetChunkAsync) endpoint, where you obtained a binary stream representing the chunk data.
Make this request in your *destination* environment.
Set the request header `Content-Type: application/octet-stream`.
The request body for this endpoint must be the raw binary stream obtained from the response of the paired endpoint.
Do not alter, wrap, re-encode or chunk the stream; forward it exactly as received:
- For media chunks, the client must send the compressed bytes as-is, with no decompression.
- For content (non-media) chunks, the client must send the encrypted bytes as-is, with no decryption.

After retrieving and transferring all the chunks in a particular set, use the [Complete a chunk set](#operation/ContentTransfer_CompleteChunkSetAsync) endpoint to generate a `.raif` file containing that chunk set's data on the *destination* environment.

Endpoint: PUT /sitecore/api/content/transfer/v1/transfers/{transferId}/chunksets/{chunksetId}/chunks/{chunkId}
Version: v1.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer JWT

## Path parameters:

  - `transferId` (string, required)
    The unique identifier of the transfer operation. This is the UUID you provided when you [created a content transfer operation](#operation/ContentTransfer_CreateContentTransfer).

  - `chunksetId` (string, required)
    The unique identifier of the chunk set that contains the chunk to be transferred. If you don't know this value, first retrieve details of a content transfer operation.

  - `chunkId` (integer, required)
    The identifier of the chunk to be transferred.

## Query parameters:

  - `isMedia` (boolean, required)
    Whether the chunk contains media content, affecting whether the data is compressed (media) or encrypted (non-media). For a given chunk, obtain this value from the `IsMedia` parameter in the `Content-Disposition` response header of the [Retrieve a specific chunk of transfer data](#operation/ContentTransfer_GetChunkAsync) endpoint.

## Request body:

  - `application/octet-stream` (unknown)
    The raw binary stream of chunk data obtained from the paired endpoint (Retrieve a specific chunk of transfer data). Must be forwarded exactly as received, without modification.

## Response 201:

  - `201` (unknown)
    Chunk was saved successfully.

## Response 400:

  - `400` (unknown)
    Invalid request data or chunk information.

## Response 400 fields (application/json):

  - `Error` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized.

## Response 401 fields (application/json):

  - `Error` (string)

## Response 403:

  - `403` (unknown)
    Forbidden.

## Response 403 fields (application/json):

  - `Error` (string)

## Response 500:

  - `500` (unknown)
    Internal server error during chunk processing.

## Response 500 fields (application/json):

  - `Error` (string)

