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 "/177c40c8-a45e-431b-9d2b-1385fda9983d.png" \
--to "/a4d8a24b-f431-40b3-bd33-5ae1d2df5b14.png" \
--rewrite true
oint yadisk CreateObjectCopy ^
--token "***" ^
--from "/177c40c8-a45e-431b-9d2b-1385fda9983d.png" ^
--to "/a4d8a24b-f431-40b3-bd33-5ae1d2df5b14.png" ^
--rewrite true
Result
{
"path": "disk:/f2a406e4-5e96-4357-a11a-86652b596223.png",
"type": "file",
"name": "f2a406e4-5e96-4357-a11a-86652b596223.png",
"created": "2026-07-19T17:09:14+00:00",
"modified": "2026-07-19T17:09:14+00:00",
"size": 2114023,
"mime_type": "multipart",
"md5": "9e0176f87f6565a22f78e0f9b39a4d78",
"sha256": "89f8eb42a35208a17c85036e17237b0aa0657e1841efa6171dc5acbc0dea9e18",
"media_type": "image",
"resource_id": "1573541518:bb15f83d8d57a0b0a50fad9f5813394df861d427b42c6efaf53a4175ff4841b9",
"revision": 1784480954833809,
"comment_ids": {
"public_resource": "1573541518:bb15f83d8d57a0b0a50fad9f5813394df861d427b42c6efaf53a4175ff4841b9",
"private_resource": "1573541518:bb15f83d8d57a0b0a50fad9f5813394df861d427b42c6efaf53a4175ff4841b9"
},
"exif": {},
"antivirus_status": "clean",
"file": "https://downloader.disk.yandex.ru/disk/fc0e0d9a9af971ebdd2f498ef27b9e26e1b914c0f13534b10c6624b4f8804766/6a5d3cfb/Kdpe3dFisZLPovVA4r-aBmpkby3AOQiLsayEHYapOMw2ylFGSbZZrsWtGPTvHxG_-QDrqSGFBOOsS3b3gKT1zA%3D%3D?uid=1573541518&filename=f2a406e4-5e96-4357-a11a-86652b596223.png&disposition=attachment&hash=&limit=0&content_type=multipart&owner_uid=1573541518&fsize=2114023&hid=03d7263840468e281bd0b238a26e7d0d&media_type=image&tknv=v3&is_direct_zip_experiment=1&etag=9e0176f87f6565a22f78e0f9b39a4d78"
}