All Products
Search
Document Center

API Gateway:CreateInstance

Last Updated:Jan 29, 2026

Creates an API Gateway instance.

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

apigateway:CreateInstance

create

*Instance

acs:apigateway:{#regionId}:{#accountId}:instance/*

None None

Request parameters

Parameter

Type

Required

Description

Example

ChargeType

string

Yes

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

PostPaid 后付费 PrePaid 预付费

InstanceName

string

Yes

The name of the instance.

ApigatewayInstance

InstanceSpec

string

Yes

The instance type.

api.s1.small

ZoneId

string

No

The zone where the instance is deployed. This parameter is required for classic network-type dedicated instances. This parameter is optional for VPC-connected dedicated instances.

cn-beijing-MAZ3(c,e)

HttpsPolicy

string

No

The HTTPS policy.

HTTPS2_TLS1_2

Duration

integer

No

The subscription duration of the instance. Valid values:

  • If PricingCycle is set to Month, the valid values are 1 to 9.

  • If PricingCycle is set to Year, the valid values are 1 to 3.

Note

This parameter is required and takes effect only if you set ChargeType to PrePaid.

1

PricingCycle

string

No

The billing cycle of the subscription instance. Valid values:

  • year

  • month

Note

This parameter is required if you set ChargeType to PrePaid.

Month

AutoPay

boolean

No

Specifies whether to enable auto-payment for renewals. Valid values:

  • True: Auto-payment is enabled. Make sure that your account has a sufficient balance.

  • False: Manual payment is required. To pay for an order, log on to the console. In the upper-right corner, choose Billing > User Center. On the Order Management page, find the order and complete the payment.

Default value: False.

false

Token

string

Yes

A security token used to prevent duplicate requests. Do not reuse the token. The gateway automatically removes leading and trailing spaces from the token string.

c20d86c4-1eb3-4d0b-afe9-c586df1e2136

Tag

array<object>

No

A list of tags.

object

No

Key

string

No

The tag key.

test1

Value

string

No

The tag value.

v1

InstanceType

string

No

The type of the dedicated instance.

  • vpc_connect: a VPC-connected dedicated instance

  • normal: a classic network-type dedicated instance

Important This parameter is available only for invitational preview and is not publicly available.

vpc_connect

InstanceCidr

string

No

The CIDR block of the instance if the instance is a VPC-connected dedicated instance.

  • 192.168.0.0/16

  • 172.16.0.0/12

Warning The VPC-connected dedicated instance connects to the specified CIDR block. To prevent IP address conflicts, make sure that the CIDR block does not overlap with the private IP addresses of your Alibaba Cloud services.
Important This parameter is available only for invitational preview and is not publicly available.

172.16.0.0/12

UserVpcId

string

No

The ID of the user VPC to which you want to connect. This parameter is required if the instance is a VPC-connected dedicated instance.

Important This parameter is available only for invitational preview and is not publicly available.

vpc-m5eo7khlb4h4f8y9egsdg

ZoneVSwitchSecurityGroup

array<object>

No

The zone, vSwitch, and security group information required for network connectivity. This parameter is required if the instance is a VPC-connected dedicated instance.

Important This parameter is available only for invitational preview and is not publicly available.

object

No

ZoneId

string

No

The zone ID.

cn-beijing-c

VSwitchId

string

No

The vSwitch ID.

vsw-0xi349n11cxogmvm866tb

CidrBlock

string

No

The IPv4 CIDR block of the vSwitch.

192.168.9.0/24

SecurityGroupId

string

No

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

sg-2ze2ql9nozv8q7kmlt6e

Response elements

Element

Type

Description

Example

object

TagStatus

boolean

Indicates whether the tag exists. Valid values are `true` and `false`.

True

InstanceId

string

The ID of the instance.

apigateway-hz-b3c5dadd5***

RequestId

string

The ID of the request.

CEB6EC62-B6C7-5082-A45A-45A204724AC2

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.