All Products
Search
Document Center

Virtual Private Cloud:CreateVpcPrefixList

Last Updated:Aug 28, 2026

Creates a prefix list.

Operation description

Do not call the CreateVpcPrefixList operation repeatedly within a specific period of time.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

PrefixListName

string

No

The name of the prefix list.

The name must be 1 to 128 characters in length, and cannot start with http:// or https://.

name

PrefixListDescription

string

No

The description of the prefix list.

The description must be 1 to 256 characters in length and cannot start with http:// or https://.

description

ClientToken

string

No

The client token that ensures the idempotence of the request.

You can use the client to generate the token value, but you must ensure that the value is unique across all requests. ClientToken can contain only ASCII characters.

Note

If you do not specify this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.

123e4567-e89b-12d3-a456-426655440000

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.

  • false (default): performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.

false

MaxEntries

integer

No

The maximum number of CIDR blocks that you can specify in the prefix list. Default value: 50.

50

PrefixListEntries

array<object>

No

The CIDR blocks in the prefix list.

object

No

Cidr

string

No

The CIDR block specified in the prefix list.

192.168.0.0/16

Description

string

No

The description of the CIDR block specified in the prefix list.

The description must be 1 to 256 characters in length and cannot start with http:// or https://.

CIDR

ResourceGroupId

string

No

The ID of the resource group to which the prefix list belongs.

rg-bp67acfmxazb4ph****

RegionId

string

Yes

The ID of the region where you want to create the prefix list.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

IpVersion

string

No

The IP version. Valid values:

  • IPv4 (default)

  • IPv6

IPv4

Tag

array<object>

No

The tags to add to the prefix list.

object

No

Key

string

No

The key of tag N. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceDept

Value

string

No

The value of tag N. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

PrefixListId

string

The ID of the prefix list.

pl-0b700s2ee3***

RequestId

string

The ID of the request.

54B48E3D-DF70-471B-AA93-08E683A1B45

ResourceGroupId

string

The ID of the resource group to which the prefix list belongs.

rg-bp67acfmxazb4ph****

Examples

Success response

JSON format

{
  "PrefixListId": "pl-0b700s2ee3***",
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "ResourceGroupId": "rg-bp67acfmxazb4ph****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 UnsupportedFeature.IpVersion The ipversion type is not supported.
400 QuotaExceeded.PrefixListCidrCount The quota of prefixListMaxEntry count is exceeded. The value of entryCount exceeds the upper limit.
400 OperationFailed.CidrCountExceedMaxCount The operation is failed because of cidrCountExceedMaxCount.
400 IllegalParam.CidrBlock The param of cidrBlock is illegal. The error message returned because the value of the cidrBlock parameter is invalid.
400 IllegalParam.CidrName The param of cidrName is illegal.
400 DuplicatedParam.CidrBlock The param of cidrBlock is duplicated. The error message returned because a duplicate CIDR block is specified.
400 QuotaExceeded.PrefixListCount The quota of prefixList count is exceeded. The value of prefixList exceeds the upper limit.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.