Create Upload Session

Creates a session for uploading a file. File upload procedure:

  1. Create a file upload session.
  2. Upload the file in parts using the Upload File Part method.
  3. Complete the upload session using the Complete Upload Session method.

After the upload is complete, you can attach the file to a page: Add Attachment.

Request

POST

https://api.wiki.yandex.net/v1/upload_sessions

Body

application/json
{
  "file_name": "example",
  "file_size": 0
}

Name

Description

file_name

Type: string

Example: example

file_size

Type: integer

Responses

200 OK

OK

Body

application/json
{
  "session_id": "example",
  "file_name": "example",
  "file_size": 0,
  "status": "not_started",
  "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",
  "finished_at": "2025-01-01T00:00:00Z",
  "storage_type": "mds"
}

Name

Description

created_at

Type: string<date-time>

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

file_name

Type: string

Example: example

file_size

Type: integer

session_id

Type: string<uuid4>

Example: example

status

Type: UploadSessionStatusType

An enumeration.

Enum: not_started, in_progress, finished, aborted, used, cleanup

user

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"
}

finished_at

Type: string<date-time>

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

storage_type

Type: StorageType

An enumeration.

Enum: mds, s3, custom_s3

UploadSessionStatusType

An enumeration.

Type: string

Enum: not_started, in_progress, finished, aborted, used, cleanup

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"
}

StorageType

An enumeration.

Type: string

Enum: mds, s3, custom_s3

Previous