---
metadata:
  - name: generator
    content: Diplodoc Platform v5.46.1
alternate:
  - https://yandex.com.tr/support/wiki/en/api-ref/attachments/pagesattachments__attach_file.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/support/wiki/en/llms.txt

<div class="openapi">

# Attach File

<!-- markdownlint-disable-file -->

Add a file from the specified upload session to the page. [How to create a file upload session](https://yandex.com.tr/support/wiki/en/api-ref/upload_sessions/upload_sessions__create_upload_session.md)

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api.wiki.yandex.net/v1/pages/{idx}/attachments
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_idx_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "upload_sessions": [
    "example"
  ]
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_upload_sessions_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;uuid4&gt;[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "results": [
    {
      "id": 0,
      "name": "example",
      "is_downloadable": true,
      "download_url": "example",
      "size": "example",
      "description": "example",
      "user": {
        "id": 0,
        "identity": null,
        "username": "example",
        "display_name": "example",
        "is_dismissed": true,
        "affiliation": "example"
      },
      "created_at": "2025-01-01T00:00:00Z",
      "mimetype": "example",
      "has_preview": true,
      "check_status": "ready"
    }
  ]
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_results_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [AttachmentSchema](#entity-AttachmentSchema)[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "id": 0,
    "name": "example",
    "is_downloadable": true,
    "download_url": "example",
    "size": "example",
    "description": "example",
    "user": {
      "id": 0,
      "identity": null,
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    },
    "created_at": "2025-01-01T00:00:00Z",
    "mimetype": "example",
    "has_preview": true,
    "check_status": "ready"
  }
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### UserIdentity {#entity-UserIdentity}

User identifier

#|
|| **Name** | **Description** ||
||

_cloud_uid_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

User identifier in the cloud (for the external instance)

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uid_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

User identifier in Yandex (for the internal instance)

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uid": "example",
  "cloud_uid": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### UserSchema {#entity-UserSchema}

Information about the user

#|
|| **Name** | **Description** ||
||

_affiliation_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

User affiliation (for example, `yandex`, `external`)

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_display_name_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

User display name

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Internal user identifier
{.table-cell}
||
||

_is_dismissed_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: boolean

The user has been dismissed
{.table-cell}
||
||

_username_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

User login

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_identity_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **UserIdentity**

  **Type**: [UserIdentity](#entity-UserIdentity)

  User identifier

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "uid": "example",
    "cloud_uid": "example"
  }
  ```

  {% endcut %}

{% endcut %}

User identifier in the system

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uid": "example",
  "cloud_uid": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### FileCheckStatusType {#entity-FileCheckStatusType}

Antivirus file check status:
- `check` — the file is being checked
- `ready` — the file has been checked and is safe
- `deleted` — the file has been deleted
- `infected` — a virus has been detected
- `error` — an error occurred during the check


**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `check`, `ready`, `deleted`, `infected`, `error`

</div>

<div class="openapi-entity">

### AttachmentSchema {#entity-AttachmentSchema}

A file attached to the page

#|
|| **Name** | **Description** ||
||

_created_at_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Date and time the file was uploaded

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_description_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

File description

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_download_url_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

File download URL

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_has_preview_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: boolean

Whether a file preview is available
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Unique file identifier
{.table-cell}
||
||

_mimetype_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

File MIME type

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_name_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

File name

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_size_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

File size

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_check_status_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **FileCheckStatusType**

  **Type**: [FileCheckStatusType](#entity-FileCheckStatusType)

  Antivirus file check status:
  - `check` — the file is being checked
  - `ready` — the file has been checked and is safe
  - `deleted` — the file has been deleted
  - `infected` — a virus has been detected
  - `error` — an error occurred during the check


  _Enum:_{.json-schema-reset .json-schema-value} `check`, `ready`, `deleted`, `infected`, `error`

{% endcut %}

Antivirus file check status

_Default:_{.json-schema-reset .json-schema-value} `ready`
{.table-cell}
||
||

_is_downloadable_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Whether the file is available for download

_Default:_{.json-schema-reset .json-schema-value} `true`
{.table-cell}
||
||

_user_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **UserSchema**

  **Type**: [UserSchema](#entity-UserSchema)

  Information about the user

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  }
  ```

  {% endcut %}

{% endcut %}

The user who uploaded the file

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": 0,
  "name": "example",
  "is_downloadable": true,
  "download_url": "example",
  "size": "example",
  "description": "example",
  "user": {
    "id": 0,
    "identity": {
      "uid": "example",
      "cloud_uid": "example"
    },
    "username": "example",
    "display_name": "example",
    "is_dismissed": true,
    "affiliation": "example"
  },
  "created_at": "2025-01-01T00:00:00Z",
  "mimetype": "example",
  "has_preview": true,
  "check_status": "ready"
}
```

{% endcut %}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.