.do
ApiBusiness

Quota

A consumption limit for API usage, resource allocation, or feature access in usage-based and tiered pricing models.

Quota

A consumption limit for API usage, resource allocation, or feature access in usage-based and tiered pricing models.

Properties

  • id (string): Unique identifier for the quota.
  • customer ([[Customer]]): Customer this quota applies to.
  • subscription ([[Subscription]]): Associated subscription.
  • plan ([[Plan]]): Associated plan.
  • tier ([[Tier]]): Associated pricing tier.
  • api ([[API]]): API this quota applies to.
  • endpoint ([[Endpoint]]): Specific endpoint quota.
  • resource (string): Resource type (api-calls, tokens, storage, bandwidth, seats, credits).
  • metric (string): Quota metric name.
  • limit (number): Quota limit.
  • unit (string): Unit of measurement (requests, tokens, gb, hours, users).
  • period (string): Reset period (hourly, daily, weekly, monthly, yearly, total).
  • periodStart (number): Period start timestamp (Unix timestamp).
  • periodEnd (number): Period end timestamp (Unix timestamp).
  • consumed (number): Amount consumed in current period.
  • remaining (number): Remaining quota.
  • percentUsed (number): Percentage of quota used.
  • exceeded (boolean): Whether quota is exceeded.
  • status (string): Quota status (active, exceeded, warning, disabled).
  • type (string): Quota type (hard, soft, rolling, burst).
  • enforcement (string): Enforcement action (block, throttle, overage-charge, warn).
  • overageAllowed (boolean): Whether overage is allowed.
  • overageRate (number): Overage rate in cents per unit.
  • overage (number): Amount of overage.
  • overageCost (number): Overage cost in cents.
  • warnings (object): Warning threshold configuration.
  • warningThreshold (number): Threshold for warning (e.g., 80% for 80%).
  • warningsEnabled (boolean): Whether warnings are enabled.
  • warningsSent (number): Number of warnings sent.
  • lastWarning (number): Timestamp of last warning (Unix timestamp).
  • resetAt (number): Next reset timestamp (Unix timestamp).
  • autoReset (boolean): Whether quota auto-resets.
  • rollover (boolean): Whether unused quota rolls over.
  • rolloverAmount (number): Amount rolled over from previous period.
  • scope (string): Quota scope (global, per-user, per-api-key, per-ip).
  • apiKeys (string[]): API keys this quota applies to.
  • users ([[User]][]): Users this quota applies to.
  • metadata (object): Set of key-value pairs for storing additional information.
  • created (number): Timestamp when created (Unix timestamp).
  • updated (number): Timestamp of last update (Unix timestamp).
  • lastConsumed (number): Timestamp of last consumption (Unix timestamp).

Actions

create

Create a new quota.

Input: [[Quota]]
Output: [[Quota]]

update

Update quota configuration.

Input: [[Quota]]
Output: [[Quota]]

delete

Permanently remove the quota.

Input: [[Quota]]
Output: [[Quota]]

check

Check quota status.

Input: [[QuotaRequest]]
Output: [[QuotaStatus]]

consume

Consume quota.

Input: [[ConsumeRequest]]
Output: [[Quota]]

enforce

Enforce quota limits.

Input: [[QuotaRequest]]
Output: [[QuotaEnforcement]]

reset

Reset quota to limit.

Input: [[Quota]]
Output: [[Quota]]

increase

Increase quota limit.

Input: [[IncreaseRequest]]
Output: [[Quota]]

decrease

Decrease quota limit.

Input: [[DecreaseRequest]]
Output: [[Quota]]

refund

Refund consumed quota.

Input: [[RefundRequest]]
Output: [[Quota]]

rollover

Roll over unused quota.

Input: [[Quota]]
Output: [[Quota]]

sendWarning

Send quota warning.

Input: [[Quota]]
Output: [[Warning]]

getUsage

Get current usage.

Input: [[Quota]]
Output: [[QuotaUsage]]

Events

  • created: Triggered when a new quota is created.
  • updated: Triggered when quota configuration is modified.
  • deleted: Triggered when quota is permanently removed.
  • consumed: Triggered when quota is consumed.
  • exceeded: Triggered when quota limit is exceeded.
  • warning: Triggered when quota warning threshold is reached.
  • reset: Triggered when quota is reset.
  • increased: Triggered when quota limit is increased.
  • decreased: Triggered when quota limit is decreased.
  • refunded: Triggered when quota is refunded.
  • rolledOver: Triggered when quota is rolled over.