---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.ru/dev/disk-api/doc/en/reference/response-objects.md
  - https://yandex.ru/dev/disk-api/doc/ru/reference/response-objects.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/disk-api/doc/en/llms.txt

# JSON objects in responses

Each response from the Yandex Disk API consists of objects with a specific structure. This section describes all objects that can be found in responses.


## Link {#link}

An object containing the URL for requesting [resource metadata](https://yandex.ru/dev/disk-api/doc/en/reference/meta.md).

Sample object:

```json
{
  "href": "https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2Ffoo%2Fphoto.png",
  "method": "GET",
  "templated": false
}
```

<!-- source: en/_includes/reference/response-objects/id-link/link-table.md -->


#|
|| **Element** | **Description**||
|| `href` | URL. It may be a URL template. See the `templated` key. ||
|| `method` | The HTTP method for requesting the URL from the `href` key. ||
|| `templated` | Indicates a URL template according to [RFC 6570](http://tools.ietf.org/html/rfc6570). Possible values:

- "true" — URL template. To send a request to this address, replace the placeholder values in the curly brackets with the parameter values.
- "false" — The URL can be requested without changes.||
   |#
<!-- endsource: en/_includes/reference/response-objects/id-link/link-table.md -->


## Resource {#resource}

Resource description and meta information of files and folders. Included in the response to the [meta information request](https://yandex.ru/dev/disk-api/doc/en/reference/meta.md).

```json
{
  "public_key": "HQsmHLoeyBlJf8Eu1jlmzuU+ZaLkjPkgcvmoktUCIo8=",
  "_embedded": { /* объект ResourceList */ },
  "name": "photo.png",
  "created": "2014-04-21T14:57:13+04:00",
  "custom_properties": {"foo": "1", "bar": "2"},
  "public_url": "https://yadi.sk/d/AaaBbb1122Ccc",
  "origin_path": "disk:/foo/photo.png",
  "modified": "2014-04-21T14:57:14+04:00",
  "path": "disk:/foo/photo.png",
  "md5": "4334dc6379c8f95ddf11b8508cfea271",
  "type": "file",
  "mime_type": "application/x-www-form-urlencoded",
  "size": 34567
}
```

<!-- source: en/_includes/reference/response-objects/id-link/resource-table.md -->


#|
|| **Element** | **Description** ||
||`public_key` | Key of a published resource.

It's included in the response only if the specified file or folder is published.||
||`public_url` | Link to a published resource.

It's included in the response only if the specified file or folder is published.||
||`_embedded` | The resources in the folder (contains the [ResourceList](https://yandex.ru/dev/disk-api/doc/en/reference/response-objects.md#resourcelist) object).

It's included in the response only when the folder meta information is requested.||
||`preview` | Link to a preview image of the file. It's included in the response only for supported image formats.

The preview can only be requested with the OAuth token of a user who has access to the file.||
||`name` | Resource name.||
||`custom_properties` | The object contains all attributes specified by the [Adding resource meta information](https://yandex.ru/dev/disk-api/doc/en/reference/meta-add.md) request. Contains only keys of the `name:value` type (can't contain objects or arrays).||
||`created` | The date and time when the resource was created, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format.||
||`modified` | The date and time when the resource was modified, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format.||
||`path` | Full path to the resource on Yandex Disk.

The meta information of the published folder indicates paths relative to the folder. For published files, the key value is always "/".

For a resource in Trash, this attribute may have a unique ID added to it (for example, `trash:/foo_1408546879`). This ID differentiates it from other deleted resources with the same name.||
||`origin_path` | Path to the resource before it was moved to Trash.

Only included in the response to a meta information request related to a resource in Trash.||
||`md5` | MD5 hash of the file.||
||`type` | Resource type:

- "dir" — folder.
- "file" — file.||
   ||`mime_type` | The MIME type of the file.||
   ||`size` | File size.||
   |#
<!-- endsource: en/_includes/reference/response-objects/id-link/resource-table.md -->


## ResourceList {#resourcelist}

The list of resources in the folder. Contains [Resource](#resource) objects and list properties.

```json
{
  "sort": "",
  "public_key": "HQsmHLoeyBlJf8Eu1jlmzuU+ZaLkjPkgcvmoktUCIo8=",
  "items": [ /* array of Resource objects */ ],
  "path": "disk:/foo",
  "limit": 20,
  "offset": 0,
  "total": 3
}
```

<!-- source: en/_includes/reference/response-objects/id-link/resourcelist-table.md -->


#|
|| **Element** | **Description** ||
||`sort` | The field by which the list is sorted.||
||`public_key` | The key of the published folder that contains resources from this list.

It's included in the response only if a [public folder's meta information](https://yandex.ru/dev/disk-api/doc/en/reference/public.md#meta) is requested.||
||`items` | Array of resources ([Resource](https://yandex.ru/dev/disk-api/doc/en/reference/response-objects.md#resource)) located in the folder.

Regardless of the requested sort, resources in the array are ordered by type: nested folders go first, followed by folder files.||
||`limit` | The maximum number of items in the `items` array set in the request.||
||`offset` | The offset from the first resource in the folder to the top of the list.||
||`path` | The path to the folder whose contents are described in the `ResourceList` object.

For a [public folder](https://yandex.ru/dev/disk-api/doc/en/reference/public.md#meta), the attribute value is always "/".||
||`total` | The total number of resources in the folder.||
|#
<!-- endsource: en/_includes/reference/response-objects/id-link/resourcelist-table.md -->


## FilesResourceList {#filesresourcelist}

Flat list of all files on Yandex Disk in alphabetical order.

```json
{
  "items": [ /* array of Resource objects */ ],
  "limit": 20,
  "offset": 0
}
```

<!-- source: en/_includes/reference/response-objects/id-link/filesresourcelist-table.md -->


#|
|| **Element** | **Description** ||
||`items` | Array of recently uploaded files ([Resource](https://yandex.ru/dev/disk-api/doc/en/reference/response-objects.md#resource)). ||
||`limit` | The maximum number of items in the `items` array set in the request. ||
||`offset` | The offset from the first resource in the folder to the top of the list. ||
|#
<!-- endsource: en/_includes/reference/response-objects/id-link/filesresourcelist-table.md -->



## LastUploadedResourceList {#lastuploadedresourcelist}

A list of files recently added to Yandex Disk, sorted by upload date (from later to earlier).

```json
{
  "items": [ /* array of Resource objects */ ],
  "limit": 20
}
```

<!-- source: en/_includes/reference/response-objects/id-link/lastuploadedresourcelist-table.md -->


#|
|| **Element** | **Description** ||
||`items` | Array of recently uploaded files ([Resource](https://yandex.ru/dev/disk-api/doc/en/reference/response-objects.md#resource)).||
||`limit` | The maximum number of items in the `items` array set in the request.||
|#
<!-- endsource: en/_includes/reference/response-objects/id-link/lastuploadedresourcelist-table.md -->


## PublicResourcesList {#publicresourcelist}

List of files published on Yandex Disk.

```json
{
  "items": [ /* array of Resource objects */ ],
  "type": "dir",
  "limit": 20,
  "offset": 0
}
```

<!-- source: en/_includes/reference/response-objects/id-link/publicresourcelist-table.md -->


#|
|| **Element** | **Description** ||
||`items` | Array of recently uploaded files ([Resource](https://yandex.ru/dev/disk-api/doc/en/reference/response-objects.md#resource)).||
||`limit` | The maximum number of items in the `items` array set in the request.||
||`type` | Resource type:

- "dir" — folder.
- "File" — file.||
   ||`offset` | The offset from the first resource in the folder to the top of the list.||
   |#
<!-- endsource: en/_includes/reference/response-objects/id-link/publicresourcelist-table.md -->


## Disk {#disk}

Data about available and used space on Yandex Disk.

Sample response with this data:

```json
{
  "trash_size": 4631577437,
  "total_space": 319975063552,
  "used_space": 26157681270,
  "system_folders":
  {
    "applications": "disk:/Applications",
    "downloads": "disk:/Downloads/"
  }
}
```

<!-- source: en/_includes/reference/response-objects/id-link/disk-table.md -->
#|
|| **Element** | **Description** ||
||`trash_size` |Space used by files in Trash (bytes). ||
||`total_space` |Space available to the user on Yandex Disk (bytes). ||
||`used_space` |Space used by files on Yandex Disk (bytes). ||
||`system_folders` |
Absolute paths of Yandex Disk system folders. Folder names depend on the interface language used when the user's personal Yandex Disk was created. For example, the **Downloads** folder is created for an English-speaking user, **Загрузки** for a Russian-speaking user, and so on.

The following folders are currently supported:
- `Applications` — Folder for app files.
- `Downloads` — Folder for files downloaded from the internet (not from the user's device).||
   |#
<!-- endsource: en/_includes/reference/response-objects/id-link/disk-table.md -->


## Operation {#operation}

Operation status. Operations are launched when you [copy](https://yandex.ru/dev/disk-api/doc/en/reference/copy.md), [move](https://yandex.ru/dev/disk-api/doc/en/reference/move.md), or [delete](https://yandex.ru/dev/disk-api/doc/en/reference/delete.md) non-empty folders. The URL for [requesting status](https://yandex.ru/dev/disk-api/doc/en/reference/operations.md) is returned in response to these types of requests.

Sample response with an operation status:

```json
{
  "status":"success"
}
```

<!-- source: en/_includes/reference/response-objects/id-link/operation-table.md -->


#|
|| **Element** | **Description**||
|| `status` | Operation status. Possible values:

- `success` — Operation successfully completed.
- `failed` — Operation failed. Try repeating the original copy, move, or delete request.
- `in-progress` — Operation has started but not finished yet.||
   |#
<!-- endsource: en/_includes/reference/response-objects/id-link/operation-table.md -->


## Error processing request {#error}

An error can occur if the request was formed incorrectly, the specified resource doesn't exist on the server, the server isn't working, and so on. All errors are returned with HTTP response codes. All the possible response codes and explanations are given in [Sandbox](https://tech.yandex.com/disk/poligon/) in the section **Response messages** (to see them, expand the desired request).

Errors are additionally described by a JSON object. For example:

```json
{
  "description": "resource already exists",
  "error": "PlatformResourceAlreadyExists"
}
```

#|
|| **Element** | **Description**||
|| `description` | Detailed error description to assist developers. ||
|| `error` | Error ID for automatic processing.|||
|#

