All Products
Search
Document Center

Global Accelerator:CreateCustomRoutingEndpoints

Last Updated:Jun 30, 2026

Invokes the CreateCustomRoutingEndpoints operation to create endpoints for a custom route type listener.

Operation description

After you configure a custom route type listener, the Alibaba Cloud Global Accelerator (GA) instance generates a port mapping table based on the configured listener port range, the protocol and port range of the destination endpoint group, and the IP address information of the endpoints (vSwitches). This way, traffic is deterministically routed to specific IP addresses and ports in the vSwitches.

This operation creates endpoints for a custom route type listener. When you invoke this operation, take note of the following items:

  • CreateCustomRoutingEndpoints is an asynchronous operation. After a request is sent, the system returns a request ID, but the endpoints are not yet created. The creation node continues to run in the background. You can invoke the DescribeCustomRoutingEndpointGroup operation to query the status of the endpoint group to confirm whether the endpoints are created:
    • If the endpoint group is in the updating state, the endpoints are being created. In this state, you can only execute query operations.

    • If the endpoint group is in the active state, the endpoints are created.

  • The CreateCustomRoutingEndpoints operation does not support concurrent requests to create endpoints for custom route listeners within the same Alibaba Cloud Global Accelerator (GA) instance.

Before you begin

Before you create endpoints for a custom route type listener, make sure that the following operations are complete:

  • A standard Global Accelerator instance is created. For more information, see CreateAccelerator.

  • A bandwidth plan is attached to the standard Alibaba Cloud Global Accelerator (GA) instance. For more information, see BandwidthPackageAddAccelerator.

  • Applications are deployed as backend services of Global Accelerator to accept forwarded requests. Custom route type listeners support only vSwitches as the backend service type.

  • You have obtained the permissions to use custom route type listeners and created a custom route type listener. The custom route type for listeners is in invitational preview. To use this feature, contact your account manager. To create a custom route type listener, see CreateListener.

  • An endpoint group for the custom route type listener is created. For more information, see CreateCustomRoutingEndpointGroups.

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

ga:CreateCustomRoutingEndpoints

create

*CustomRoutingEndpointGroup

acs:ga:{#regionId}:{#accountId}:customroutingendpointgroup/{#customroutingendpointgroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the Alibaba Cloud Global Accelerator (GA) instance. Set the value to cn-hangzhou.

cn-hangzhou

ClientToken

string

No

The client token that is used to ensure the idempotence of a request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The client token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId value as the ClientToken value. The RequestId value is different for each API request.

123e4567-e89b-12d3-a456-426655440000

EndpointGroupId

string

Yes

The ID of the endpoint group in which you want to create an endpoint.

epg-bp1bpn0kn908w4nb****

EndpointConfigurations

array<object>

Yes

The endpoint configurations.

You can specify up to 20 endpoint configurations.

array<object>

No

The endpoint configurations.

You can specify up to 20 endpoint configurations.

Type

string

No

The backend service type of the endpoint. Valid values:

PrivateSubNet (default): private CIDR block.

PrivateSubNet

Endpoint

string

No

The instance ID of the endpoint vSwitch.

vsw-test01

TrafficToEndpointPolicy

string

No

The traffic policy for the backend service. Valid values:

  • DenyAll (default): denies all traffic to the specified backend service.

  • AllowAll: allows all traffic to the specified backend service.

  • AllowCustom: allows traffic only to specified destinations. You must specify the IP address and port range of the destination. If the port range is left empty, all ports of the destination are supported.

DenyAll

PolicyConfigurations

array<object>

No

The traffic destination configurations.

You can specify up to 20 traffic destinations for each endpoint.

array<object>

Yes

The traffic destination configurations.

You can specify up to 20 traffic destinations for each endpoint.

Address

string

Yes

The IP address of the traffic destination that can receive traffic.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 traffic destination IP addresses for each endpoint.

10.0.XX.XX

PortRanges

array<object>

No

The port range of the traffic destination that can receive traffic. The port range must fall within the backend service port range of the endpoint group.

If this parameter is left empty, all ports of the traffic destination are supported.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify up to 20 port ranges for each endpoint, and up to 20 port ranges for each traffic destination.

object

No

The port range of the destination to which traffic is forwarded. The value of this parameter must fall within the port range of the endpoint group.

If you leave this parameter empty, traffic is forwarded to all destination ports.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 port ranges for each destination.

FromPort

integer

No

The first port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 first ports for each destination.

80

ToPort

integer

No

The last port of the destination port range. The value of this parameter must fall within the port range of the endpoint group.

This parameter takes effect only when TrafficToEndpointPolicy is set to AllowCustom.

You can specify port ranges for up to 20 destinations for each endpoint and specify up to 20 last ports for each destination.

80

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

04F0F334-1335-436C-A1D7-6C044FE73368

EndpointIds

array

The list of endpoint IDs.

string

The list of endpoint IDs.

epg-bp1dmlohjjz4kqaun****

Examples

Success response

JSON format

{
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  "EndpointIds": [
    "epg-bp1dmlohjjz4kqaun****"
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 NotExist.EndPointGroup endpoint group %s is not exist The endpoint group %s does not exist.
400 StateError.Accelerator accelerator state %s is illegal The GA instance is in an invalid state %s.
400 StateError.EndPointGroup endpoint group state %s is illegal The endpoint group is in an invalid state.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.