All Products
Search
Document Center

Virtual Private Cloud:DeleteRouteEntries

Last Updated:Sep 07, 2026

Deletes custom route entries in a batch.

Operation description

When you call this operation to delete route entries, take note of the following items:

  • Only route entries in the Available state can be deleted.

  • Route entries cannot be deleted if the VPC to which the route table belongs has a vSwitch or route entry being created or deleted.

  • The DeleteRouteEntries operation is asynchronous. After you send a request, the system returns a request ID. However, the route entry is not yet deleted. The deletion task runs in the background. You can call DescribeRouteEntryList to query the deletion status of the route entry:

    • If the route entry is in the Deleting state, the route entry is being deleted.

    • If the specified route entry cannot be found, the route entry is deleted.

  • The DeleteRouteEntries operation does not support concurrent batch deletion of route entries from route tables in the same VPC.

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

vpc:DeleteRouteEntries

delete

*RouteTable

acs:vpc:{#regionId}:{#accountId}:routetable/{#routetableId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the route table resides.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

RouteEntries

array<object>

No

The information about the route entries to delete.

object

No

The information about the route entries to delete.

DstCidrBlock

string

No

The destination CIDR block of the route entry to delete. IPv4 CIDR blocks, IPv6 CIDR blocks, and prefix list CIDR blocks are supported. You can specify up to 50 destination CIDR blocks.

Note

If the RouteEntryId parameter is not specified, the DstCidrBlock and NextHop parameters are required.

47.100.XX.XX/24

NextHop

string

No

The ID of the next hop instance to delete. You can specify up to 50 instance IDs.

Note

If the RouteEntryId parameter is not specified, the DstCidrBlock and NextHop parameters are required.

i-j6c2fp57q8rr4jlu****

RouteEntryId

string

No

The ID of the route entry to delete. You can specify up to 50 route entry IDs.

Note

If the RouteEntryId parameter is not specified, the DstCidrBlock and NextHop parameters are required.

rte-bp1mnnr2al0naomnpv****

RouteTableId

string

Yes

The ID of the route table that contains the route entry to delete. You can specify up to 50 route table IDs.

vtb-2ze3jgygk9bmsj23s****

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

true: performs a dry run without actually deleting the route entries. The system checks the AccessKey pair, the authorization of the Resource Access Management (RAM) user, and the required parameters. If the check fails, the corresponding error is returned. If the check passes, the DryRunOperation error code is returned.

false (default): sends a normal request. If the check passes, a 2xx HTTP status code is returned and the route entries are deleted.

Response elements

Element

Type

Description

Example

object

The response parameters.

FailedCount

integer

The number of route entries that failed to be deleted.

2

FailedRouteEntries

array<object>

The information about the route entries that failed to be deleted.

object

The information about the route entries that failed to be deleted.

DstCidrBlock

string

The destination CIDR block of the route entry that failed to be deleted. IPv4 CIDR blocks, IPv6 CIDR blocks, and prefix list CIDR blocks are supported.

47.100.XX.XX/24

FailedCode

string

The error code returned for the failure.

VPC_ROUTER_ENTRY_NOT_EXIST

FailedMessage

string

The error message returned for the failure.

vRouterEntry not exists

NextHop

string

The instance ID of the next hop that failed to be deleted.

i-j6c2fp57q8rr4jlu****

RouteEntryId

string

The ID of the route entry that failed to be deleted.

rte-bp1mnnr2al0naomnpv****

RequestId

string

The request ID.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

SuccessCount

integer

The number of route entries that were deleted.

2

Examples

Success response

JSON format

{
  "FailedCount": 2,
  "FailedRouteEntries": [
    {
      "DstCidrBlock": "47.100.XX.XX/24",
      "FailedCode": "VPC_ROUTER_ENTRY_NOT_EXIST",
      "FailedMessage": "vRouterEntry not exists",
      "NextHop": "i-j6c2fp57q8rr4jlu****",
      "RouteEntryId": "rte-bp1mnnr2al0naomnpv****"
    }
  ],
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
  "SuccessCount": 2
}

Error codes

HTTP status code

Error code

Error message

Description

400 DryRunOperation Request validation has been passed with DryRun flag set. The request passed the dry run.
400 TaskConflict The operation is too frequent. Please wait a moment and try again. The system is unavailable. Try again later.
400 MissingParam.RouteTableId The parameter RouteTableId is missing. The required parameter RouteTableId is missing.
400 IncorrectStatus.PrefixListRelation The related prefix list relation is in an intermediate state and cannot perform the current operation. The associated prefix list association is in an intermediate state, and the current operation cannot be performed.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.