⚓️ Portcall

How to set limits for metered feature usage

Quota limits are enforced through plan-feature configuration.

Set limits with the quota field on POST /v1/plan-features.

Quota behavior

  • quota = -1: unlimited usage.
  • quota > 0: hard cap.

When usage reaches the quota, entitlement enabled becomes false.

POST /v1/meter-events also rejects writes that would exceed a positive quota.

Example

curl -sS -X POST "$PORTCALL_API_BASE/v1/plan-features" \
  -H "x-api-key: $PORTCALL_API_KEY" \
  -H "content-type: application/json" \
  -d '{"plan_id":"plan_x","feature_id":"api_calls","quota":10000,"interval":"month"}'