Create object copy
Creates a copy of the object at the specified path and path to the original
- Parameters
- Advanced call ?
Function CreateObjectCopy(Val Token, Val Original, Val Path, Val Overwrite = False) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Token |
| Original | --from | String | ✔ | Path to the original file or directory |
| Path | --to | String | ✔ | Destination path for the copy |
| Overwrite | --rewrite | Boolean | ✖ | Overwrite if a file with the same name already exists |
Returns
Map Of KeyAndValue - serialized JSON response from Yandex
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
Token = "y0__xCOranuBRj1uTsgs8z_iRV...";
Original = "/5bb78325-64e6-4133-a369-c3a275f745cb.png";
Path = "/" + String(New UUID) + ".png";
Result = OPI_YandexDisk.CreateObjectCopy(Token, Original, Path, True);
- Bash
- CMD/Bat
oint yadisk CreateObjectCopy \
--token "***" \
--from "/e8f29642-2df4-4d1b-9bf6-e71c1bf93168.png" \
--to "/5dfc19fd-b338-4c20-931c-12aeeb327a0c.png" \
--rewrite true
oint yadisk CreateObjectCopy ^
--token "***" ^
--from "/e8f29642-2df4-4d1b-9bf6-e71c1bf93168.png" ^
--to "/5dfc19fd-b338-4c20-931c-12aeeb327a0c.png" ^
--rewrite true
Result
{
"path": "disk:/5dfc19fd-b338-4c20-931c-12aeeb327a0c.png",
"type": "file",
"name": "5dfc19fd-b338-4c20-931c-12aeeb327a0c.png",
"created": "2026-05-26T13:59:59+00:00",
"modified": "2026-05-26T13:59:59+00:00",
"size": 2114023,
"mime_type": "multipart",
"md5": "9e0176f87f6565a22f78e0f9b39a4d78",
"sha256": "89f8eb42a35208a17c85036e17237b0aa0657e1841efa6171dc5acbc0dea9e18",
"media_type": "image",
"resource_id": "1573541518:b2bab64120ede06db3bc90ef5a07c424a384696eecf669d11583f03e8bfd8c35",
"revision": 1779803999723141,
"comment_ids": {
"public_resource": "1573541518:b2bab64120ede06db3bc90ef5a07c424a384696eecf669d11583f03e8bfd8c35",
"private_resource": "1573541518:b2bab64120ede06db3bc90ef5a07c424a384696eecf669d11583f03e8bfd8c35"
},
"exif": {},
"antivirus_status": "clean",
"file": "https://downloader.disk.yandex.ru/disk/40e1cf568aa70aa0c6e23b938ef7d19c8d8bdf3138700b0c80a43e073664c..."
}