---
title: "Upload from a URL with a single HTTP request:"
method: POST
path: "/v2/accounts/{accountId}/uploads/url"
tags: ["Upload"]
---

# Upload from a URL with a single HTTP request:

`POST /v2/accounts/{accountId}/uploads/url`

## Request

- Base URL: `https://api.bytescale.com`
- URL: `https://api.bytescale.com/v2/accounts/{accountId}/uploads/url`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/bytescale/apis/bytescale-api/docs/v2/accounts/:accountId/uploads/url/post.ts> (a function with typed inputs; its response is checked against the schema)

Upload from a URL with a single HTTP request:

## Path parameters

- `accountId` string, required: Your account ID. This is visible on the settings page: https://www.bytescale.com/dashboard/settings

## Request body

- UploadFromUrlRequest: Request body for UploadFromUrl.
  - `metadata` FileMetadata: The file metadata specified in the original upload request as a JSON object.
  - `mime` string: File MIME type.
  - `originalFileName` string: The file's original name on the user's device.
  - `path` 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
  - `tags` FileTagName[]: The file tags to store against the file. When you associate file tags with a file, Bytescale checks which rules match the tags (if any) and applies those rules to the upload request: Rules can include max file size checks, traffic limit checks, rate limit checks, and so forth. These are configured in the Bytescale Dashboard.
  - `timeout` integer: The maximum time (in milliseconds) the entire operation is allowed to run before being aborted. The default value is `30000` (30 seconds).
  - `url` string, required: Source URL to upload.

## Response `200`

Success.

- BasicUploadResponse: Response body for BasicUpload.
  - `accountId` string, required: Your account ID. This is visible on the settings page: https://www.bytescale.com/dashboard/settings
  - `etag` string, required: The file's ETag, short for "entity tag", reflects the file's version and changes whenever the file is modified.
  - `filePath` string, required: Absolute path to a file. Begins with a `/`.
  - `fileUrl` string, required: URL for a raw file hosted on the Bytescale CDN.

## Other responses

- `401`: Unauthenticated.

## Changes

- **2026-09-01** `d63ecdd9ae9c`: 1 warning, 3 info
  - changed the pattern of the request property `mime` from `^[a-z0-9]+/[a-z0-9+\-._]+(?:;[^=]+=[^;]+)*$` to `^[a-zA-Z0-9]+/[a-zA-Z0-9+\-._]+(?:;[^=]+=[^;]+)*$`
  - added the new optional request property `timeout`
  - the `url` request property's maxLength was increased from `1024` to `8192`
  - added the required property `etag` to the response with the `200` status

[Operation history](https://skmtc.dev/bytescale/apis/bytescale-api/changes/v2/accounts/:accountId/uploads/url/post.md)

---

[API](https://skmtc.dev/bytescale/apis/bytescale-api.md) - [All operations](https://skmtc.dev/bytescale/apis/bytescale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bytescale/apis/bytescale-api/revisions/d63ecdd9ae9c?raw)
