All Products
Search
Document Center

API Gateway:CreateInstance

Last Updated:Jul 31, 2025

Creates an API Gateway instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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 Resources is 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.
OperationAccess levelResource typeCondition keyAssociated operation
apigateway:CreateInstancecreate
*Instance
acs:apigateway:{#regionId}:{#accountId}:instance/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ChargeTypestringYes

The billing method of the instance. Valid values: PostPaid (pay-as-you-go) and PrePaid (subscription).

PostPaid PrePaid
InstanceNamestringYes

Instance Name

ApigatewayInstance
InstanceSpecstringYes

Instance specifications

api.s1.small
ZoneIdstringNo

The zone in which you want to create the instance. This parameter is required for a conventional dedicated instance and optional for a virtual private cloud (VPC) integration instance.

cn-beijing-MAZ3(c,e)
HttpsPolicystringYes

The HTTPS policy.

HTTPS2_TLS1_2
DurationintegerNo

The subscription duration of the instance.

  • If PricingCycle is set to Month, set this parameter to an integer ranges from 1 to 9.
  • If PricingCycle is set to Year, set this parameter to an integer ranges from 1 to 3.
Note This parameter is valid and required only if the ChargeType parameter is set to PrePaid.
1
PricingCyclestringNo

The unit of the subscription duration of the subscription instance. Valid values:

  • year
  • month
Note This parameter is required if the ChargeType parameter is set to Prepaid.
Month
AutoPaybooleanNo

Whether to automatically pay when renewing. Value:

  • True: Automatic payment. Please ensure that your account has sufficient balance.
  • False: Console manual payment. The specific operation is to log in to the console, select Expenses in the upper right corner, enter the Expense Center, and find the target order in Order Management to make payment.

Default value: False.

false
TokenstringYes

Passwords are used to prevent duplicate requests from being submitted, please do not reuse them.

c20d86c4-1eb3-4d0b-afe9-c586df1e2136
Tagarray<object>No

The tags that you want to add to the instance.

objectNo
KeystringNo

The tag key.

test1
ValuestringNo

The tag value.

v1
InstanceTypestringNo

The type of the dedicated instance. Valid values:

  • vpc_connect: a VPC integration instance
  • normal: a conventional dedicated instance
Note This parameter is in invitational preview and not available for public use.
vpc_connect
InstanceCidrstringNo

The CIDR block of the VPC integration instance.

  • 192.168.0.0/16
  • 172.16.0.0/12

**

Warning The VPC integration instance is connected to the specified CIDR block. Plan your CIDR block carefully to prevent overlaps with the private IP addresses of cloud services.

Note This parameter is in invitational preview and not available for public use.
172.16.0.0/12
UserVpcIdstringNo

The ID of the user's VPC to be connected by the VPC integration instance.

Note This parameter is in invitational preview and not available for public use.
vpc-m5eo7khlb4h4f8y9egsdg
ZoneVSwitchSecurityGrouparray<object>No

The network information when the instance is a VPC integration instance, such as the zone, vSwitch, and security group.

Note This parameter is in invitational preview and not available for public use.
objectNo
ZoneIdstringNo

The zone ID.

cn-beijing-c
VSwitchIdstringNo

The vSwitch ID.

vsw-0xi349n11cxogmvm866tb
CidrBlockstringNo

The IPv4 CIDR block for the vSwitch.

192.168.9.0/24
SecurityGroupIdstringNo

The ID of the security group. Services in the same security group can access each other.

sg-2ze2ql9nozv8q7kmlt6e

Response parameters

ParameterTypeDescriptionExample
object
TagStatusboolean

Indicates whether the tag exists. Valid values: true and false.

True
InstanceIdstring

Instance ID

apigateway-hz-b3c5dadd5***
RequestIdstring

Request ID

CEB6EC62-B6C7-5082-A45A-45A204724AC2

Examples

Sample success responses

JSONformat

{
  "TagStatus": true,
  "InstanceId": "apigateway-hz-b3c5dadd5***",
  "RequestId": "CEB6EC62-B6C7-5082-A45A-45A204724AC2"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-01-19The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-03-07The request parameters of the API has changedView Change Details