---
title: "Processes a file and saves the result."
method: POST
path: "/{accountId}/save/{transformation}{filePath}"
tags: ["File"]
---

# Processes a file and saves the result.

`POST /{accountId}/save/{transformation}{filePath}`

Processes a file and saves the result.

## Path parameters

- `accountId` string, required — Your account ID. This is visible on the settings page: https://www.bytescale.com/dashboard/settings
- `filePath` string, required — Absolute path to a file. Begins with a `/`.
- `transformation` string, required — The name of the File Processing API (e.g. `image`, `video`, `audio`) or transformation preset (created in the Bytescale Dashboard) to use when processing the file.

## Query parameters

- `<transformation-params>` union — Transformation parameters provided to a Bytescale File Processing API. *Array support:* Arrays are specified by repeating the same parameter name multiple times on the querystring. For example, the following querystring declares a `file` parameter as an array containing two values (`/file1.txt` and `/file2.txt`): ```?file=/file1.txt&file=/file2.txt``` The Bytescale SDKs and the ProcessFileAndSave request body (the `extendedParams` field) also support arrays of transformation parameters. These are specified by providing an array of objects as the field value instead of an object, for example: ```transformationParams: [{ file: "/file1.txt" }, { file: "/file2.txt" }]``` This structure allows parameter groups to be retained, which is important for certain transformations. For example, the Video Processing API allows developers to specify multiple clusters of `w`, `h` and `q` parameters when specifying the Adaptive Bitrate (ABR) variants in an HTTP Live Streaming (HLS) output video. *Parameters are order sensitive:* The order of the parameters may be important. Please refer to the documentation of each File Processing API for more information. *Maximum URL length:* Bytescale URLs have a maximum total length of 1000 bytes (excluding the hostname and protocol). To provide a longer parameter list to a Bytescale File Processing API, you must use ProcessFileAndSave (POST) instead of ProcessFile (GET). This allows you to specify parameters via the ProcessFileAndSave HTTP request body (via the `extendedParams` field). The `extendedParams` field supports up to 400KB of transformation parameter data.
  - TransformationParamsGroup — A single group of transformation parameters provided to a Bytescale File Processing API. See TransformationParams for more information.
  - TransformationParamsGroup[]

## Request body

- ProcessFileAndSaveRequest — Request body for ProcessFileAndSave.
  - `destination` union — The path to upload the file to.
    - string — Absolute or relative path to a location in your Bytescale account's storage. Relative paths are relative to the API key's default folder (configured per API key in the Bytescale Dashboard). Does not support path traversals (e.g. `..`). Does not support path variables.
    - DynamicFilePath — An object containing a `fileName` and/or `folderPath` field. The `folderPath` may be relative or absolute; paths are relative to the API key's default folder (configured per API key in the Bytescale Dashboard). If a field is omitted, the API key's default values will be used for that field. These are configured per API key via the Bytescale Dashboard. Supports path variables.
      - `fileName` string — The file name to upload the file with. Must not contain `/`. Supports path variables.
      - `fileNameFallback` string — The file name to upload the file with. Must not contain `/`. Supports path variables.
      - `fileNameVariablesEnabled` boolean — If `true` then path variables like `{UTC_DATE}` in the `fileName` will be replaced. You can escape `{` characters with a `\`. If `false` then path variables like `{UTC_DATE}` in the `fileName` will be taken literally. Default: true
      - `folderPath` string — Absolute or relative path to a folder in your Bytescale account's storage. Relative paths are relative to the API key's default folder (configured per API key in the Bytescale Dashboard). Should not end with `/`. Does not support path traversals (e.g. `..`). Supports path variables.
      - `folderPathVariablesEnabled` boolean — If `true` then path variables like `{UTC_DATE}` in the `folderPath` will be replaced. You can escape `{` characters with a `\`. If `false` then path variables like `{UTC_DATE}` in the `folderPath` will be taken literally. Default: true
  - `extendedParams` union — Transformation parameters provided to a Bytescale File Processing API. *Array support:* Arrays are specified by repeating the same parameter name multiple times on the querystring. For example, the following querystring declares a `file` parameter as an array containing two values (`/file1.txt` and `/file2.txt`): ```?file=/file1.txt&file=/file2.txt``` The Bytescale SDKs and the ProcessFileAndSave request body (the `extendedParams` field) also support arrays of transformation parameters. These are specified by providing an array of objects as the field value instead of an object, for example: ```transformationParams: [{ file: "/file1.txt" }, { file: "/file2.txt" }]``` This structure allows parameter groups to be retained, which is important for certain transformations. For example, the Video Processing API allows developers to specify multiple clusters of `w`, `h` and `q` parameters when specifying the Adaptive Bitrate (ABR) variants in an HTTP Live Streaming (HLS) output video. *Parameters are order sensitive:* The order of the parameters may be important. Please refer to the documentation of each File Processing API for more information. *Maximum URL length:* Bytescale URLs have a maximum total length of 1000 bytes (excluding the hostname and protocol). To provide a longer parameter list to a Bytescale File Processing API, you must use ProcessFileAndSave (POST) instead of ProcessFile (GET). This allows you to specify parameters via the ProcessFileAndSave HTTP request body (via the `extendedParams` field). The `extendedParams` field supports up to 400KB of transformation parameter data.
    - TransformationParamsGroup — A single group of transformation parameters provided to a Bytescale File Processing API. See TransformationParams for more information.
    - TransformationParamsGroup[]
  - `metadata` ProcessedFileMetadata
    - `merge` boolean — If `true` then merges `value` with the original data, giving precedence to `value`. If `false` then uses `value` as-is, ignoring the original data. Default: false
    - `value` FileMetadata — The file metadata specified in the original upload request as a JSON object.
    - `setForAllArtifacts` boolean — If `true` then sets the `value` for all files generated by the transformation, else only sets the `value` for the root output file. Default: true
  - `tags` ProcessedFileTags
    - `merge` boolean — If `true` then merges `value` with the original data, giving precedence to `value`. If `false` then uses `value` as-is, ignoring the original data. Default: false
    - `value` FileTagName[] — The value to set into the field. Default: empty object / empty array
    - `setForAllArtifacts` boolean — If `true` then sets the `value` for all files generated by the transformation, else only sets the `value` for the root output file. Default: true

## Response `200`

Success.

- union — Response body for ProcessFileAndSave.
  - ProcessFileAndSaveResponseAsync — Response body for ProcessFileAndSave operations where the File Processing API operation is asynchronous (e.g. a video transcoding job).
    - `jobDocs` 'https://www.bytescale.com/docs/job-api/GetJob', required — Link to the documentation that describes how to get a job's status from its job ID.
    - `jobId` string, required — Job ID.
    - `jobType` 'ProcessImageJob' | 'ProcessVideoJob' | 'ProcessAudioJob' | 'AntivirusJob' | 'ResetCacheJob' | 'DeleteFolderBatchJob' | 'DeleteFileBatchJob' | 'CopyFolderBatchJob' | 'CopyFileBatchJob', required — Job type.
    - `jobUrl` string, required — URL for the job's status. You can `GET` this URL to retrieve the job's status. You must authorize your `GET` request with a ```secret_*``` API key when accessing the URL.
    - `accountId` string, required — Your account ID. This is visible on the settings page: https://www.bytescale.com/dashboard/settings
    - `created` EpochMillis, required — unresolved $ref
    - `error` object, nullable, required
      - `timestamp` string, required — Time the error occurred (UTC ISO 8601).
      - `message` string, required — Human-readable error message.
      - `details` unknown
      - `code` string, required — Machine-readable error code.
    - `lastUpdated` EpochMillis, required — unresolved $ref
    - `status` 'Created' | 'Pending' | 'Running' | 'Rollback' | 'Failed' | 'Succeeded' | 'Cancelling' | 'Cancelled', required
    - `summary` JsonObject, required — An arbitrary JSON object.
    - `async` true, required — True for asynchronous file processing operations (e.g. video transcoding). For asynchronous operations, the response body will contain information about the background job that's processing the file, which can then be polled via the GetJob operation.
  - ProcessFileAndSaveResponseSync — Response body for ProcessFileAndSave operations where the File Processing API operation is synchronous (e.g. an image processing job).
    - `accountId` string, required — Your account ID. This is visible on the settings page: https://www.bytescale.com/dashboard/settings
    - `async` false, required — False for synchronous file processing operations (e.g. image processing). For synchronous operations, the response body will contain links to the transformed file.
    - `filePath` string, required — Absolute path to a file. Begins with a `/`.
    - `fileUrl` string, required — URL for an http(s) resource.
    - `summary` TransformationSummary — JSON response returned by certain File Processing APIs. Structure varies between File Processing APIs (please see the documentation of each individual File Processing API).

---

[API](https://skmtc.dev/bytescale/apis/bytescale-api.md) · [All operations](https://skmtc.dev/bytescale/apis/bytescale-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bytescale/bytescale-api/revisions/d63ecdd9ae9c/schema)
