Copy file to remote storage

POST requests are used to copy original files or their modified versions to the S3 bucket. Source files MAY either be stored or just uploaded and MUST NOT be deleted. Copying of large files is not supported at the moment. File size MUST NOT exceed 5 GB.

Authentication

Authorizationstring
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`.

Headers

AcceptstringRequired
Version header.

Request

This endpoint expects an object.
sourcestringRequiredformat: "uri"
A CDN URL or just UUID of a file subjected to copy.
targetstringRequired
Identifies a custom storage name related to your project. It implies that you are copying a file to a specified custom storage. Keep in mind that you can have multiple storages associated with a single S3 bucket.
make_publicbooleanOptionalDefaults to true

MUST be either true or false. The true value makes copied files available via public links, false does the opposite.

patternenumOptionalDefaults to ${default}
The parameter is used to specify file names Uploadcare passes to the S3 bucket. If the parameter is omitted, your S3 bucket pattern is used. Use any combination of allowed values. Parameter values: - `${default}` = `${uuid}/${auto_filename}` - `${auto_filename}` = `${filename}${effects}${ext}` - `${effects}` = processing operations put into a CDN URL - `${filename}` = original filename without extension - `${uuid}` = file UUID - `${ext}` = file extension, including period, e.g. .jpg

Response

Destination file with that name already exists. Check the pattern parameter.

typestringDefaults to url
resultstringformat: "url"
URL with an s3 scheme. Your bucket name is put as a host, and an s3 object path follows.

Errors

400
Bad Request Error
401
Unauthorized Error
406
Not Acceptable Error
429
Too Many Requests Error