Copy file to local storage

POST requests are used to copy original files or their modified versions to a default storage. Source files MAY either be stored or just uploaded and MUST NOT be deleted. Copying of large files is not supported at the moment. If the file CDN URL includes transformation operators, its size MUST NOT exceed 100 MB. If not, the size MUST NOT exceed 5 GB. Note: In the immediate 201 response, the `result.size` can be `0` and the `result.mime_type` can be `application/octet-stream`. This indicates the copy has been initiated but is not yet completed. Once the copy finishes, fetching the file info (e.g., `GET /files/{uuid}/`) will return the actual size and MIME type.

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.
storeenumOptionalDefaults to false
The parameter only applies to the Uploadcare storage and MUST be either true or false.
Allowed values:
metadataobjectOptional
Arbitrary additional metadata.

Response

The file was copied successfully. HTTP response contains result field with information about the copy.

typestringDefaults to file
resultobject

Errors

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