All Products
Document Center

Create an Plugin

Last Updated: Apr 24, 2019


You can call this operation to create a plug-in.

  • This operation is intended for API providers.
  • There is a limit on the maximum number of plug-ins of the same type that each user can create. This limit varies with the plug-in type.
  • In the near future, you will be able to use API Gateway to create plug-ins that provide advanced functions.
  • After a plug-in is bound to an API, it takes effect immediately.

Request parameters

Name Type Required Description
Action String Yes The operation that you want to perform. Set this value to CreatePlugin.
PluginName String Yes The name of the plug-in that you want to create. It can contain uppercase English letters, lowercase English letters, Chinese characters, numbers, and underscores (). It must be 4 to 50 characters in length and cannot start with an underscore ().
PluginType String Yes The type of the plug-in. Valid values:
  • ipControl: indicates IP address-based access control.
  • trafficControl: indicates throttling.
  • backendSignature: indicates backend signature.
  • jwtAuth: indicates JWT (OpenId Connect).
  • cors: indicates cross-origin resource access (CORS).
  • caching: indicates caching.
PluginData String Yes The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
Description String No The description of the plug-in, which cannot exceed 200 characters.

Response parameters

Name Type Description
RequestId String The request ID
PluginId String The generated plug-in ID


Sample request

  2. &PluginName=NewCors
  3. &PluginType=cors
  4. &PluginData="Plugin definition"
  5. &Description="createPlugin"
  6. &<Common request parameters>

Sample responses

XML format

  1. <CreatePluginResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
  3. <PluginId>285bb759342649a1b70c2093a772e087</PluginId>
  4. </CreatePluginResponse>

JSON format

  1. {
  2. "RequestId":"EF924FE4-2EDD-4CD3-89EC-34E4708574E7",
  3. "PluginId" :"1f3bde29b43d4d53989248327ff737f2"
  4. }