Attach File

Add a file from the specified upload session to the page. How to create a file upload session

Request

POST

https://api.wiki.yandex.net/v1/pages/{idx}/attachments

Path parameters

Name

Description

idx

Type: integer

Body

application/json
{
  "upload_sessions": [
    "example"
  ]
}

Name

Description

upload_sessions

Type: string<uuid4>[]

Example
[
  "example"
]

Responses

200 OK

OK

Body

application/json
{
  "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"
    }
  ]
}

Name

Description

results

Type: AttachmentSchema[]

Example
[
  {
    "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"
  }
]

UserIdentity

User identifier

Name

Description

cloud_uid

Type: string

User identifier in the cloud (for the external instance)

Example: example

uid

Type: string

User identifier in Yandex (for the internal instance)

Example: example

Example
{
  "uid": "example",
  "cloud_uid": "example"
}

UserSchema

Information about the user

Name

Description

affiliation

Type: string

User affiliation (for example, yandex, external)

Example: example

display_name

Type: string

User display name

Example: example

id

Type: integer

Internal user identifier

is_dismissed

Type: boolean

The user has been dismissed

username

Type: string

User login

Example: example

identity

All of 1 type
  • UserIdentity

    Type: UserIdentity

    User identifier

    Example
    {
      "uid": "example",
      "cloud_uid": "example"
    }
    

User identifier in the system

Example
{
  "uid": "example",
  "cloud_uid": "example"
}
Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}

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: check, ready, deleted, infected, error

AttachmentSchema

A file attached to the page

Name

Description

created_at

Type: string<date-time>

Date and time the file was uploaded

Example: 2025-01-01T00:00:00Z

description

Type: string

File description

Example: example

download_url

Type: string

File download URL

Example: example

has_preview

Type: boolean

Whether a file preview is available

id

Type: integer

Unique file identifier

mimetype

Type: string

File MIME type

Example: example

name

Type: string

File name

Example: example

size

Type: string

File size

Example: example

check_status

All of 1 type
  • FileCheckStatusType

    Type: 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: check, ready, deleted, infected, error

Antivirus file check status

Default: ready

is_downloadable

Type: boolean

Whether the file is available for download

Default: true

user

All of 1 type
  • UserSchema

    Type: UserSchema

    Information about the user

    Example
    {
      "id": 0,
      "identity": {
        "uid": "example",
        "cloud_uid": "example"
      },
      "username": "example",
      "display_name": "example",
      "is_dismissed": true,
      "affiliation": "example"
    }
    

The user who uploaded the file

Example
{
  "id": 0,
  "identity": {
    "uid": "example",
    "cloud_uid": "example"
  },
  "username": "example",
  "display_name": "example",
  "is_dismissed": true,
  "affiliation": "example"
}
Example
{
  "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"
}