All Products
Search
Document Center

API Gateway:ModifyApiConfiguration

Last Updated:Mar 30, 2026

This API operation is used to modify the draft definition of an API. It is different from the ModifyApi operation in that it does not require all information about the API. You need to only specify the parameters that you want to modify. For example, if you want to change the authentication method of the API from Anonymous to APP, you need to only specify the value of AuthType, which is APP.

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:ModifyApiConfiguration

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ApiId

string

Yes

The ID of the API.

baacc592e63a4cb6a41920d9d3f91f38

ApiName

string

No

The name of the API.

testModifyApiName

Description

string

No

The description of the API.

TestModifyDescription

Visibility

string

No

Specifies whether to make the API public. Valid values:

  • PUBLIC: The API is public. If this parameter is set to PUBLIC, the API is displayed on the APIs page for all users after the API is published to the production environment.

  • PRIVATE: The API is private. Private APIs are not displayed in the Alibaba Cloud Marketplace after the API group to which they belong is made available.

PUBLIC

ForceNonceCheck

boolean

No

  • Specifies whether to forcibly check X-Ca-Nonce. If the ForceNonceCheck parameter is set to true, X-Ca-Nonce is forcibly checked. X-Ca-Nonce is the unique identifier of the request and is generally identified by UUID. After receiving this parameter, API Gateway verifies the validity of this parameter. The same value can be used only once within 15 minutes. This helps prevent replay attacks.

  • If the ForceNonceCheck parameter is set to false, X-Ca-Nonce is not checked. If you do not modify this parameter when you modify an API, the original value is used.

true

DisableInternet

boolean

No

  • Specifies whether to call the API only in an internal network. If the DisableInternet parameter is set to true, the API can be called only in an internal network.

  • If the DisableInternet parameter is set to false, the API can be called over the Internet and in an internal network.

false

AppCodeAuthType

string

No

If the AuthType parameter is set to APP, the valid values are:

  • DEFAULT: The default value that is used if no other values are passed. This value indicates that the settings of the group are used.

  • DISABLE: The authentication is disabled.

  • HEADER: AppCode can be placed in the Header parameter for authentication.

  • HEADER_QUERY: AppCode can be placed in the Header or Query parameter for authentication.

DEFAULT

AllowSignatureMethod

string

No

If the AuthType parameter is set to APP, you must include this parameter to specify the signature algorithm. If you do not specify a value, HmacSHA256 is used by default. Valid values:

  • HmacSHA256

  • HmacSHA1,HmacSHA256

HmacSHA256

AuthType

string

No

API Security authentication type,Valid values::

  • APP:Only authorized APP Call

  • ANONYMOUS:Allow anonymous calls,Exercise caution when you allow anonymous calls.:
    • Anyone who can obtain this API person who can access service information,can call this API.The gateway does not authenticate callers.,You cannot configure user-level throttling either.,If you expose this API Configure API traffic throttling;

    • AppCodeAuthType does not take effect.

APP

RequestProtocol

string

No

The protocol type supported by the API. Valid values: HTTP and HTTPS. Separate multiple values with commas (,), such as "HTTP,HTTPS".

HTTP

RequestHttpMethod

string

No

The HTTP method used to make the request. Valid values: GET, POST, DELETE, PUT, HEADER, TRACE, PATCH, CONNECT, and OPTIONS.

GET

RequestPath

string

No

The path of the API request. If the complete API URL is http://api.a.com:8080/object/add?key1=value1&key2=value2, the path of the API request is /object/add.

/test/api

RequestMode

string

No

The request mode. Valid values:

  • MAPPING: Parameters are mapped. Unknown parameters are filtered out.

  • PASSTHROUGH: Parameters are passed through.

  • MAPPING_PASSTHROUGH: Parameters are mapped. Unknown parameters are passed through.

MAPPING

BodyFormat

string

No

This parameter takes effect only when the RequestMode parameter is set to MAPPING.

The format in which data is transmitted to the server for POST and PUT requests. Valid values: FORM and STREAM. FORM indicates that data is transmitted in the key-value pair format. STREAM indicates that data is transmitted as byte streams.

STREAM

PostBodyDescription

string

No

The description of the request body.

The description of the request body

BodyModel

string

No

The body model.

https://apigateway.aliyun.com/models/f4e7333c****40dcbaf7c9da553ccd8d/3ab61f775b****d4bc35e993****87aa8

ModelName

string

No

The name of the model.

Test

BackendName

string

No

The name of the backend service. This parameter takes effect only when the UseBackendService parameter is set to TRUE.

testBackendService

ServiceProtocol

string

No

The protocol that is used to access backend services. Valid values:

  • Http: for backend services that use HTTP or HTTPS

  • Vpc: for backend services that use VPC

  • FC: for Function Compute

  • OSS: for Object Storage Service

  • Mock: for backend services that use the Mock mode

  • EventBridge: for EventBridge

You must specify the config value for the corresponding backend service.

HTTP

HttpConfig

string

No

The HTTP configuration.

{"serviceAddress":"http://test.api.com","servicePath":"/test/api","serviceHttpMethod":"GET"}

VpcConfig

string

No

The VPC configuration.

{"VpcId":"vpc-xxxxxxx","Name":"testVpc","InstanceId":"i-p0ssssss","Port":80,"servicePath":"/test/vpc","serviceHttpMethod":"HEAD"}

FunctionComputeConfig

string

No

The Function Compute configuration.

{"FcType":"FCEvent","FcRegionId":"cn-hangzhou","RoleArn":"acs:ram::xxxxxxxx:role/aliyunserviceroleforapigateway","selectServiceName":"fcTest","FunctionName":"funcTest","selectFunctionName":"funcTest","Qualifier":"LATEST","Path":"","FcBaseUrl":"","ServiceName":"fcTest"}

OssConfig

string

No

The OSS configuration.

{"OssRegionId":"cn-hangzhou","Key":"/test.html","BucketName":"test-api-oss","Action":"GetObject"}

MockConfig

string

No

The Mock configuration.

{"MockResult":"test","MockHeaders":[{"HeaderName":"testHeader","HeaderValue":"testHeader"}],"MockStatusCode":"400"}

ServiceTimeout

integer

No

The timeout period of the backend service. Unit: milliseconds.

10000

ContentTypeCategory

string

No

The ContentType configuration of the backend request.

  • DEFAULT: the default configuration in API Gateway

  • CUSTOM: a custom configuration

DEFAULT

ContentTypeValue

string

No

The value of the ContentType header when the ServiceProtocol parameter is set to HTTP and the ContentTypeCatagory parameter is set to DEFAULT or CUSTOM.

application/x-www-form-urlencoded; charset=UTF-8

RequestParameters

string

No

The parameters of API requests sent by the consumer to API Gateway.

For more information, see RequestParameter.

[{"ParameterLocation":{"name":"Head","orderNumber":2},"ParameterType":"String","Required":"OPTIONAL","isHide":false,"ApiParameterName":"header1","DefaultValue":"123124","Location":"Head"},{"ParameterLocation":{"name":"Head","orderNumber":2},"ParameterType":"String","Required":"REQUIRED","isHide":false,"ApiParameterName":"header2","DefaultValue":"","Location":"Head"},{"ParameterLocation":{"name":"Query","orderNumber":3},"ParameterType":"String","Required":"OPTIONAL","isHide":false,"ApiParameterName":"query1","DefaultValue":"1245","Location":"Query"},{"ApiParameterName":"CaClientIp","ParameterLocation":{"name":"Query","orderNumber":0},"Location":"Query","ParameterType":"String","Required":"REQUIRED","Description":"ClientIP"},{"ApiParameterName":"testConstant","ParameterLocation":{"name":"Head","orderNumber":0},"Location":"Head","ParameterType":"String","Required":"REQUIRED","DefaultValue":"111"}]

ServiceParameters

string

No

The parameters of API requests sent by API Gateway to the backend service.

For more information, see ServiceParameter.

[{"ServiceParameterName":"header1","Location":"Head","Type":"String","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"header2","Location":"Query","Type":"String","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"query1","Location":"Head","Type":"String","ParameterCatalog":"REQUEST"},{"ServiceParameterName":"ipp","Location":"Query","Type":"String","ParameterCatalog":"SYSTEM"},{"ServiceParameterName":"testConstant","Location":"Head","Type":"String","ParameterCatalog":"CONSTANT"}]

ServiceParametersMap

string

No

The mappings between parameters of requests sent by the consumer to API Gateway and parameters of requests sent by API Gateway to the backend service.

For more information, see ServiceParameterMap.

[{"ServiceParameterName":"header1","RequestParameterName":"header1"},{"ServiceParameterName":"header2","RequestParameterName":"header2"},{"ServiceParameterName":"query1","RequestParameterName":"query1"},{"ServiceParameterName":"ipp","RequestParameterName":"CaClientIp"},{"ServiceParameterName":"testConstant","RequestParameterName":"testConstant"}]

ResultType

string

No

The format of the response from the backend service. Valid values: JSON, TEXT, BINARY, XML, and HTML. This value is used only to generate documents. It does not affect the returned result.

JSON

ResultSample

string

No

The sample response from the backend service. This value is used only to generate documents. It does not affect the returned result.

{\n \"status\": 0,\n \"data\": {\n \"count\": 1,\n \"list\": [\n \"352\"\n ]\n },\n \"message\": \"success\"\n}

FailResultSample

string

No

The sample error response from the backend service. This value is used only to generate documents. It does not affect the returned result.

{"errorCode":"fail","errorMessage":"param invalid"}

ErrorCodeSamples

string

No

The sample error codes returned by the backend service.

For more information, see ErrorCodeSample.

[{"Code":"400","Message":"Missing the userId","Description":"param invalid"}]

UseBackendService

boolean

No

Specifies whether to use the information about the created backend service. Valid values:

  • TRUE: uses the information about the created backend service.

  • FALSE: uses the information about the custom backend service.

TRUE

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

6C87A26A-6A18-4B8E-8099-705278381A2C

Examples

Success response

JSON format

{
  "RequestId": "6C87A26A-6A18-4B8E-8099-705278381A2C"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.