Domain name for API request: alb.intl.tencentcloudapi.com.
This API is used to create a listener.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: CreateListener. |
| Version | Yes | String | Common Params. The value used for this API: 2025-10-30. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| DefaultActions.N | Yes | Array of DefaultAction | Default forwarding rule action list. Currently, a listener supports adding only 1 default forwarding rule action. |
| ListenerPort | Yes | Integer | Port used by the load balancing instance frontend. Value: 1-65535. |
| ListenerProtocol | Yes | String | Listening protocol. Parameter Value: HTTP, HTTPS, or QUIC. |
| LoadBalancerId | Yes | String | Cloud Load Balancer instance ID. The format is alb- followed by 8 alphanumeric characters. |
| CaCertificateIds.N | No | Array of String | List of CA certificate IDs configured for the listener. Currently, a listener supports adding only 1 CA certificate. |
| CaEnabled | No | Boolean | Whether mutual authentication is enabled. |
| CertificateIds.N | No | Array of String | List of server certificate IDs. |
| ClientToken | No | String | Client token, used to ensure the idempotency of requests. Generate a parameter value from your client to ensure the uniqueness of the value for different requests. ClientToken supports only ASCII characters. |
| GzipEnabled | No | Boolean | Whether Gzip compression is enabled. Value: true (default): yes. false: no |
| Http2Enabled | No | Boolean | Whether HTTP/2 is enabled. Default value: false for HTTP and true for HTTPS. Only the HTTPS protocol supports this parameter. |
| IdleTimeout | No | Integer | Connection idle timeout, in seconds. |
| ListenerName | No | String | Custom listener name, containing 1–255 characters. It must contain Chinese and harmless string characters, and can contain Chinese, letters, digits, dashes (-), forward slashes (/), half-width periods (.), and underscores (_). |
| RequestTimeout | No | Integer | Connection request timeout period. Unit: second. Value: 1–600. Default value: 60. If the real server does not return a response within the timeout period, load balancing will abandon waiting and return an HTTP 504 error code to the client. |
| SecurityPolicyId | No | String | Security policy ID, format: tls- followed by 8 alphanumeric characters. |
| Tags.N | No | Array of TagInfo | Tag list. Supports up to 20. |
| XForwardedForConfig | No | XForwardedForConfig | X-Forwarded-For configuration |
| Parameter Name | Type | Description |
|---|---|---|
| ListenerId | String | Listener ID, in the format of lst- followed by 8 alphanumeric characters. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: alb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateListener
<Common request parameters>
{
"LoadBalancerId": "alb-f8q2xk9m",
"ListenerProtocol": "HTTPS",
"ListenerPort": 80,
"ListenerName": "443",
"DefaultActions": [
{
"Type": "TargetGroup",
"TargetGroupConfig": {
"TargetGroups": [
{
"TargetGroupId": "lbtg-0zrnc9qa"
}
]
}
}
],
"CertificateIds": [
"Fm8Wp7x8"
],
"CaEnabled": false,
"Http2Enabled": false,
"GzipEnabled": false,
"RequestTimeout": 60,
"IdleTimeout": 15,
"SecurityPolicyId": "tls-t2ckydug",
"XForwardedForConfig": {
"XForwardedForMode": "append",
"XForwardedForProtoEnabled": false,
"XForwardedForPortEnabled": false,
"XForwardedForHostEnabled": false,
"XForwardedForClientSrcPortEnabled": false,
"XTencentClientSDNEnabled": false,
"XTencentClientIDNEnabled": false,
"XTencentClientSerialEnabled": false,
"XTencentClientVerifyEnabled": false
}
}
{
"Response": {
"ListenerId": "lst-d9p3k7wa",
"RequestId": "e3bc3ab0-e453-4a83-92c4-8fcdda1e08c1"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| UnsupportedOperation.TargetGroupProtocolMismatch | Listener protocol and target group backend forwarding protocol mismatch |
| UnsupportedOperation.UnsupportedProtocol | Operation not supported for the CLB listener protocol. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback