Creates a domain name.
Operation description
Create Domain.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| apig:CreateDomain | create | *Domain acs:apig:{#regionId}:{#accountId}:domain/* |
| none |
Request syntax
POST /v1/domains HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| body | object | No | The request body parameters. | |
| name | string | Yes | The domain name. | abc.com |
| protocol | string | Yes | The protocol type supported by the domain name.
| HTTP |
| forceHttps | boolean | No | Specifies whether to enable forced HTTP to HTTPS redirection. | false |
| mTLSEnabled | boolean | No | Specifies whether to enable mutual Transport Layer Security (mTLS) authentication. | |
| certIdentifier | string | No | The certificate identifier. | 1ef1da5f-38ed-69b3-****-037781890265 |
| caCertIdentifier | string | No | The CA certificate ID. | 1ef1da5f-38ed-69b3-****-037781890265 |
| clientCACert | string | No | The client CA certificate content. | -----BEGIN CERTIFICATE----- MIIFBTCCAu2gAwIBAgIUORLpYPGSFD1YOP6PMbE7Wd/mpTQwDQYJKoZIhvcNAQEL BQAwE************************************************2VwVOJ2gqX3 YuGaxvIbDy0iQJ1GMerPRyzJTeVEtdIKT29u0PdFRr4KZWom35qX7G4= -----END CERTIFICATE----- |
| http2Option | string | No | HTTP/2 configuration options. Valid values:
| Open |
| tlsMax | string | No | The maximum TLS protocol version (up to TLS 1.3). | TLS1.3 |
| tlsMin | string | No | The minimum TLS protocol version (minimum TLS 1.0). | TLS1.0 |
| resourceGroupId | string | No | The resource group ID. | rg-aekzoiafjtr7zyq |
| tlsCipherSuitesConfig | TlsCipherSuitesConfig | No | The cipher suite configuration. | |
| gatewayType | string | No | The gateway type. Valid values:
| API |
Response parameters
Examples
Sample success responses
JSONformat
{
"requestId": "0C2D1C68-0D93-5561-8EE6-FDB7BF067A30",
"data": {
"domainId": "d-cpu1aullhtgkidg7sa4g"
},
"code": "Ok",
"message": "success"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-04-25 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2025-02-27 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2024-11-28 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2024-11-20 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2024-09-23 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
| 2024-07-25 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
