All Products
Search
Document Center

Virtual Private Cloud:DeleteRouteEntry

Last Updated:Jun 19, 2026

Calls the DeleteRouteEntry operation to delete a route from the route table of a vRouter or Virtual Border Router (VBR).

Operation description

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

  • Only routes in the Available state can be deleted.

  • A route cannot be deleted if the VPC that contains the route table is creating or deleting a vSwitch or route.

  • To delete a route from the route table of a VBR, call the DescribeRouteEntryList operation to query the NextHopId of the route that you want to delete, and then call this operation to delete the route.

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

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

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

  • The DeleteRouteEntry operation does not support concurrent deletion of routes from the route table within the same VPC or VBR.

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:DeleteRouteEntry

delete

*RouteTable

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The ID of the region where the route table resides.

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

cn-hangzhou

RouteTableId

string

No

The ID of the route table that contains the route.

Note

If the RouteEntryId parameter is not specified, the DestinationCidrBlock and RouteTableId parameters are required. Configure the NextHopId or NextHopList parameter as needed.

vtb-2ze3jgygk9bmsj23s****

RouteEntryId

string

No

The ID of the route that you want to delete. This parameter is mutually exclusive with the DestinationCidrBlock parameter.

Note

If the DestinationCidrBlock parameter is not specified, the RouteEntryId parameter is required.

rte-bp1mnnr2al0naomnpv****

DestinationCidrBlock

string

No

The destination CIDR block of the route. IPv4 CIDR blocks, IPv6 CIDR blocks, prefix list CIDR blocks, and prefix list instance IDs are supported. This parameter is mutually exclusive with the RouteEntryId parameter.

Note

If the RouteEntryId parameter is not specified, the DestinationCidrBlock and RouteTableId parameters are required. Configure the NextHopId or NextHopList parameter as needed.

47.100.XX.XX/16

NextHopId

string

No

The ID of the next hop instance.

  • To delete a non-ECMP route, specify NextHopId. Do not specify NextHopList.

  • To delete an ECMP route, specify NextHopList. Do not specify NextHopId.

ri-2zeo3xzyf38r4urzd****

NextHopList

array<object>

No

The information about the next hop instances of the ECMP route. A maximum of 16 next hop instances are supported.

object

No

The information about the next hop instances of the ECMP route. A maximum of 16 next hop instances are supported.

NextHopId

string

No

The ID of the next hop instance of the ECMP route. A maximum of 16 next hop instances are supported.

ri-2zeo3xzyf38r43cd****

NextHopType

string

No

The type of the next hop of the ECMP route. Set the value to RouterInterface (router interface). A maximum of 16 next hop instances are supported.

RouterInterface

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

true: performs a dry run without deleting the route. 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 succeeds, the error code DryRunOperation is returned.

false (default): sends a normal request. After the check succeeds, a 2xx HTTP status code is returned and the route is deleted.

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

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

Examples

Success response

JSON format

{
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

Error codes

HTTP status code

Error code

Error message

Description

400 MissingParameter Miss mandatory parameter.
400 IncorrcetRouteEntryStatus Some route entry status blocked this operation.
400 InvalidCidrBlock.Malformed Specified CIDR block is not valid.
400 OperationDenied Specified operation is denied as route entry type is system.
400 InvalidRouteEntry.NotFound Route entry not exists.
400 InvalidVRouter.NotFound vRouter not exists.
400 IncorrectRouteEntryStatus Some route entry status blocked this operation.
400 Forbbiden Specified RouteEntry cannot allowed delete by openApi.
400 InvalidNextHop Specified nexthop and nexthop list cannot both null.
400 InvalidRouteEntry Specified routeEntry not exist.
400 Forbidden.VRouterNotFound pecified virtual switch is not found during access authentication.
400 TaskConflict The operation is too frequent, TaskConflict. The system is unavailable. Try again later.
400 InvalidRouteEntryId.NotFound Specified RouteEntryId does not exist. The specified route is not found.
400 IncorrectVpcStatus Current VPC status does not support this operation.
400 InvalidVpnInstanceId.NotFound %s
400 ParamExclusive.RouteEntryIdAndRouteTableIdOrDestCidrBlock %s
400 InvalidNextHopList.Size Nexthop list size should be between 2 and 16
400 ParamExclusive.NextHopIdAndList NextHopId and NextHopList cannot both be not null.
400 OperationFailed.DeleteMultiScopeEntry Multi or ecmp scope must delete with force.
400 OperationFailed.DistibuteLock Distibute lock fail. The operation is locked by another request;
400 OperationDenied.DeleteManagedRouteEntry The operation is not allowed because of route entry is managed. You cannot delete hosted routes.
400 OperationDenied.RouteTableTypeNotPermitted The operation is not allowed because the type of route table is not permitted. You cannot create routes for route tables of the specified type.
400 IncorrectStatus.VpcRouteEntry The status of the specified routeEntry is invalid. The status of the VPC route entry is invalid.
400 OperationDenied.NextHopNotChanged The operation is not allowed because of NextHopNotChanged. The operation is not allowed because the next hop is not changed.
400 OperationDenied.DeleteGatewayEndpointRoute The operation is not allowed to delete route entry pointing gateway endpoint.. You cannot delete a route that points to a gateway endpoint.
400 IncorrectStatus.PrefixList The status of prefixList is incorrect. The prefix list is in an unstable state.
400 InvalidCidrBlock Specified CIDR block is not valid. Possible reasons for error reporting: 1. You are not in the whitelist of the 10.0.0.0/8 CIDR block and cannot use this CIDR block. 2. The target CIDR block of the added custom route cannot belong to the CIDR block of all vSwitches under the same VPC. 3. Because 100.64.0.0/10 is a cloud service address, you cannot add this CIDR block to point to the IDC under the cloud. 4. Except for 100.64.0.0/10, the detailed route network segments such as 100.64.0.0/11 and 100.96.0.0/11 cannot be used in the IDC under the cloud.
400 OperationDenied.VbrAttachEcrInMiddleStatus The operation is not allowed because of VBR attach or detach ECR in middle status. The current operation cannot be performed because the VBR is in the process of loading or unloading the leased line gateway. Please wait a moment and try again.
400 UnsupportedFeature.NextHopType The operation is not allowed because the NextHopType of specified RouteEntry is modified from Local type. The operation is not allowed because the next hop type of the route is modified from the Local type.
400 ResourceNotFound.PrefixList The specified resource of prefixList is not found. The prefix list does not exist.
500 Vpc.Error error code 500,Internal server error.
500 Internal.Error The request processing has failed due to some unknown error, exception or failure.
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error occurred.
404 InvalidRouteTableId.NotFound Specified route table does not exist.
404 InvalidVpcId.NotFound Specified value of VpcId is not found in our record. The VPC does not exist. Check whether the specified VPC is valid.
404 ResourceNotFound.GatewayLoadBalancerEndpoint GatewayLoadBalancerEndpoint instance not found. GatewayLoadBalancerEndpoint instance not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.