Upload Part

Uploads file data to the session that you created.

  • Use Content-Type: application/octet-stream and send the data in the request body.
  • When uploading to S3, send parts with the part_number parameter, starting with 1. You can
    upload parts in parallel and retry failed uploads. Service settings limit the part size.
  • When using the file upload service, send the entire file in one request. Its size
    must match the size that you specified when creating the session.

For common headers and authentication methods, see Access to the API. For sample scenarios, see API usage examples.

Request

PUT

https://api.wiki.yandex.net/v1/upload_sessions/{session_id}/upload_part

Path parameters

Name

Description

session_id

Type: string<uuid4>

Upload session ID in UUID format. Pass the session_id field value from the response to POST /v1/upload_sessions.

Example: ``

Query parameters

Name

Description

part_number

Type: integer

Number of the file part to upload, from 1 to 10000. When uploading the entire file, specify 1. For multipart uploads, number the parts sequentially, starting with 1.

Min value: 1

Max value: 10000

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>

Date and time when the upload session was created.

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

file_name

Type: string

The name of the file to upload.

Example: example

file_size

Type: integer

File size in bytes, as specified when the session was created.

session_id

Type: string<uuid4>

File upload session ID in UUID format. Use this value as session_id in methods for uploading, completing, and aborting a session.

Example: example

status

All of 1 type
  • UploadSessionStatusType

    Type: UploadSessionStatusType

    An enumeration.

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

Upload session state.

Example: not_started

user

All of 1 type
  • UserSchema

    Type: UserSchema

    User information

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

User who created the upload session.

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>

The date and time when the upload finished. null if the upload has not finished yet.

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

storage_type

All of 1 type
  • StorageType

    Type: StorageType

    An enumeration.

    Enum: mds, s3, custom_s3

File storage type.

Example: mds

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

Example: example

uid

Type: string

Yandex user ID

Example: example

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

UserSchema

User information

Name

Description

affiliation

Type: string

User affiliation

Example: example

display_name

Type: string

User display name

Example: example

id

Type: integer

Internal user identifier

is_dismissed

Type: boolean

The user is 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