Was this helpful?

The ResetQuota policy type enables you to dynamically reset the limit for a specified Quota. For example, you can use this policy to reset a developer's Quota counter when additional API calls are purchased.

The name attribute for this policy is restricted to these characters: A-Z0-9._\-$ %. However, the Management UI enforces additional restrictions, such as automatically removing characters that are not alphanumeric.

Configuring a ResetQuota policy

Configure your ResetQuota policy using the following elements.

Field Name Description
Quota Name Specifies the name of the Quota policy whose counter should be reset.
Identifier name Variable used for uniquely identifying the client, for example client_id.
Allow (Allow integer) Specifies the message count to which the Quota will be reset.

Reset Quota examples

Reset top-level Quota.

<ResetQuota name="resetQuota">
 <Quota name="request.header.quotapolicy">
  <Identifier name="_default">
    <Allow>100</Allow>
  </Identifier>
 </Quota>
</ResetQuota>

<ResetQuota name="resetQuota">
 <Quota name="request.header.quotapolicy">
  <Identifier name="_default">
    <Allow ref="request.header.allowquota" />
  </Identifier>
 </Quota>
</ResetQuota>

Reset top-level Quota for different identifiers.

<ResetQuota name="resetQuota">
 <Quota ref="request.header.quotapolicy">
  <Identifier ref="request.header.identifier">
    <Allow>100</Allow>
  </Identifier>
 </Quota>
</ResetQuota>

Reset class-level Quotas.

<ResetQuota name="resetQuota">
 <Quota name="quotapolicy">
  <Identifier name="_default">
   <Class ref="request.header.classIdentifier">
    <Allow>200</Allow>
  </Identifier>
  </Identifier>
 </Quota>
</ResetQuota>

Policy-specific error codes

The default format for error codes returned by Policies is:

{
  "code" : " {ErrorCode} ",
  "message" : " {Error message} ",
  "contexts" : [ ]
}
Error Code Message
InvalidRLPolicyDefinition Invalid rate limit policy {0}
NoRLPolicy Quota policy {0} is not attached.
InvalidCount Invalid count value {0} for identifier {1} in {2}
FailedToResolveAllowCountRef Failed to resolve allow count reference {0} for identifier {1} in {2}

Policy schema

Each policy type is defined by an XML schema (.xsd). For reference, policy schemas are available on GitHub.

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)