For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
GuidesIntegrationsAPI ReferencesRelease notes
GuidesIntegrationsAPI ReferencesRelease notes
    • APIs overview
  • Upload API
    • Errors
  • REST API
    • Authentication
      • GETList of files
      • PUTStore file
      • DELDelete file
      • GETFile info
      • PUTBatch file storing
      • DELBatch file delete
      • POSTCopy file to local storage
      • POSTCopy file to remote storage
    • File Metadata
    • Add Ons
    • Changelog
    • Versioning
  • URL API
    • File Information
    • File Names
    • File groups
    • Image processing limitations
    • Image compression
    • Image resize and crop
    • Image rotation
    • Image overlays
    • Image colors
    • Image definition
    • Image recognition
    • Other image operations
    • Proxy
    • Signed URLs
    • CDN settings
    • Integrations
Dashboard
LogoLogo
REST APIFile

Copy file to local storage

POST
https://api.uploadcare.com/files/local_copy/
POST
/files/local_copy/
$curl -X POST https://api.uploadcare.com/files/local_copy/ \
> -H "Accept: application/vnd.uploadcare-v0.7+json" \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "source": "03ccf9ab-f266-43fb-973d-a6529c55c2ae",
> "store": "true",
> "metadata": {
> "subsystem": "uploader",
> "pet": "cat"
> }
>}'
1{
2 "type": "file",
3 "result": {
4 "datetime_removed": "2024-01-15T09:30:00Z",
5 "datetime_stored": "2024-01-15T09:30:00Z",
6 "datetime_uploaded": "2024-01-15T09:30:00Z",
7 "is_image": true,
8 "is_ready": true,
9 "mime_type": "application/octet-stream",
10 "original_file_url": "https://ucarecdn.com/03ccf9ab-f266-43fb-973d-a6529c55c2ae/",
11 "original_filename": "EU_4.jpg",
12 "size": 0,
13 "url": "https://api.uploadcare.com/files/575ed4e8-f4e8-4c14-a58b-1527b6d9ee46/",
14 "uuid": "575ed4e8-f4e8-4c14-a58b-1527b6d9ee46",
15 "variations": null,
16 "content_info": null,
17 "metadata": {}
18 }
19}
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.
Was this page helpful?
Previous

Copy file to remote storage

Next
Built with

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 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