All Products
Search
Document Center

Platform For AI:CreateDatasetVersion

Last Updated:Oct 17, 2025

Creates a dataset version.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

paidataset:CreateDatasetVersion

create

*All Resource

*

None None

Request syntax

POST /api/v1/datasets/{DatasetId}/versions HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

DatasetId

string

Yes

The dataset ID. For more information about how to obtain the dataset ID, see ListDatasets.

d-rbvg5*****jhc9ks92

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

Property

string

Yes

The property of the dataset. Valid values:

  • FILE: A file.

  • DIRECTORY: A folder.

Valid values:

  • DIRECTORY :

    DIRECTORY

  • FILE :

    FILE

DIRECTORY

DataSourceType

string

Yes

The type of the data source. If you specify multiple types, separate them with commas (,). Valid values:

  • NAS: The data is stored in Alibaba Cloud File Storage (NAS).

  • OSS: The data is stored in Alibaba Cloud Object Storage Service (OSS).

  • CPFS

Note: The DataSourceType of the version must be the same as the DataSourceType of the dataset. The system verifies this consistency when you create the version.

Valid values:

  • NAS :

    NAS

  • OSS :

    OSS

OSS

Uri

string

Yes

The following examples show how to configure the URI:

  • If the data source type is OSS: oss://bucket.endpoint/object

  • If the data source type is NAS: The format for a general-purpose NAS file system is nas://<nasfisid>.region/subpath/to/dir/. CPFS 1.0: nas://<cpfs-fsid>.region/subpath/to/dir/. CPFS 2.0: nas://<cpfs-fsid>.region/<protocolserviceid>/. CPFS 1.0 and CPFS 2.0 are distinguished by the format of the fsid. The format for CPFS 1.0 is cpfs-<8 ASCII characters>. The format for CPFS 2.0 is cpfs-<16 ASCII characters>.

oss://mybucket.oss-cn-beijing.aliyuncs.com/mypath/

Labels

array

No

A list of tags for the dataset version.

Label

No

The tag.

SourceType

string

No

The type of the data source. The default value is USER. Valid values:

  • PAI-PUBLIC-DATASET: a public dataset from PAI.

  • ITAG: a dataset generated from the annotation results of the iTAG module.

  • USER: a dataset registered by a user.

Valid values:

  • PAI_PUBLIC_DATASET :

    PAI_PUBLIC_DATASET

  • ITAG :

    ITAG

  • USER :

    USER

USER

SourceId

string

No

The ID of the data source.

  • If SourceType is set to USER, you can customize the SourceId.

  • If SourceType is set to ITAG, which indicates a dataset generated from the annotation results of the iTAG module, SourceId is the task ID from iTAG.

  • If SourceType is set to PAI_PUBLIC_DATASET, which indicates a dataset created from a public PAI dataset, SourceId is empty by default.

d-a0xbe5n03bhqof46ce

Options

string

No

The extended field, which is a JSON string. When DLC uses the dataset, you can configure the mountPath field to specify the default mount path for the dataset.

{ "mountPath": "/mnt/data/" }

Description

string

No

A custom description for the dataset version. This helps distinguish different dataset versions.

This is a description of the dataset version.

DataSize

integer

No

The size of the space occupied by the dataset files. Unit: bytes.

19000

DataCount

integer

No

The number of files in the dataset.

300

ImportInfo

string

No

The storage import configuration of the dataset. Supported storage types include OSS, NAS, and CPFS.

OSS

{
"region": "${region}",// The region ID.
"bucket": "${bucket}",// The bucket name.
"path": "${path}" // The file path.
}

NAS

{
"region": "${region}",// The region ID.
"fileSystemId": "${file_system_id}", // The file system ID.
"path": "${path}", // The file system path.
"mountTarget": "${mount_target}" // The mount target of the file system.
}

CPFS

{
"region": "${region}",// The region ID.
"fileSystemId": "${file_system_id}", // The file system ID.
"protocolServiceId":"${protocol_service_id}", // The protocol service of the file system.
"exportId": "${export_id}", // The exported directory of the file system.
"path": "${path}", // The file system path.
}

Intelligent Computing CPFS

{
"region": "${region}",// The region ID.
"fileSystemId": "${file_system_id}", // The file system ID.
"path": "${path}", // The file system path.
"mountTarget": "${mount_target}", // The mount target of the file system. This parameter is specific to the Intelligent Computing edition.
"isVpcMount": boolean, // Specifies whether the mount target is in a VPC. This parameter is specific to the Intelligent Computing edition.
}

{ "region": "cn-wulanchabu", "fileSystemId": "bmcpfs-xxxxxxxxxxx", "path": "/mnt", "mountTarget": "cpfs-xxxxxxxxxxxx-vpc-gacs9f.cn-wulanchabu.cpfs.aliyuncs.com", "isVpcMount": true }

Response elements

Element

Type

Description

Example

object

The response body.

RequestId

string

Id of the request

41A847C8-3D12-5F24-8CE9-7F9EB2DA9ECD

VersionName

string

The name of the dataset version.

v1

Examples

Success response

JSON format

{
  "RequestId": "41A847C8-3D12-5F24-8CE9-7F9EB2DA9ECD",
  "VersionName": "v1"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.