All Products
Search
Document Center

API Gateway:ModifyApiConfiguration

Last Updated:Jul 31, 2025

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.

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:ModifyApiConfigurationupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ApiIdstringYes

The ID of the API.

baacc592e63a4cb6a41920d9d3f91f38
ApiNamestringNo

The name of the API.

testModifyApiName
DescriptionstringNo

The description of the API.

TestModifyDescription
VisibilitystringYes

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
ForceNonceCheckbooleanNo
  • 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
DisableInternetbooleanNo
  • 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
AppCodeAuthTypestringNo

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
AllowSignatureMethodstringNo

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
AuthTypestringNo

API 安全认证类型,目前可以取值:

  • APP:只允许已授权的 APP 调用
  • ANONYMOUS:允许匿名调用,设置为允许匿名调用需要注意:
    • 任何能够获取该 API 服务信息的人,都将能够调用该 API。网关不会对调用者做身份认证,也无法设置按用户的流量控制,若开放该 API 请设置好按 API 的流量控制;
    • AppCodeAuthType 的值不会生效。
APP
RequestProtocolstringNo

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

HTTP
RequestHttpMethodstringNo

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

GET
RequestPathstringNo

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
RequestModestringNo

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
BodyFormatstringNo

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
PostBodyDescriptionstringNo

The description of the request body.

The description of the request body
BodyModelstringNo

The body model.

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

The name of the model.

Test
BackendNamestringNo

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

testBackendService
ServiceProtocolstringNo

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
HttpConfigstringNo

The HTTP configuration.

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

The VPC configuration.

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

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"}
OssConfigstringNo

The OSS configuration.

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

The Mock configuration.

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

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

10000
ContentTypeCategorystringNo

The ContentType configuration of the backend request.

  • DEFAULT: the default configuration in API Gateway
  • CUSTOM: a custom configuration
DEFAULT
ContentTypeValuestringNo

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
RequestParametersstringNo

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"}]
ServiceParametersstringNo

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"}]
ServiceParametersMapstringNo

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"}]
ResultTypestringNo

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
ResultSamplestringNo

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}
FailResultSamplestringNo

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"}
ErrorCodeSamplesstringNo

The sample error codes returned by the backend service.

For more information, see ErrorCodeSample .

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

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 parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

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

Error codes

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

Change history

Change timeSummary of changesOperation
No change history