Skip to main content

QuotaHeadroom

How many more of a resource the organization can create on its plan.

Computed by the same code the create-time gate uses (billing.QuotaHeadroomFor shares the counter, the cap parser and the comparison with Enforce*Limit), so canCreate is exactly the verdict a create would get, and plan/limit/resource equal the extensions of the QUOTA_EXCEEDED refusal.

type QuotaHeadroom {
resource: QuotaResource!
resourceNoun: String!
resourcePlural: String!
plan: String!
limit: Int
used: Int!
remaining: Int
overBy: Int!
canCreate: Boolean!
largerPlanExists: Boolean!
scope: QuotaScope!
organizationId: String!
}

Fields​

QuotaHeadroom.resource ● QuotaResource! non-null enum​

QuotaHeadroom.resourceNoun ● String! non-null scalar​

Singular noun, equal to the QUOTA_EXCEEDED resource extension (e.g. "strategy").

QuotaHeadroom.resourcePlural ● String! non-null scalar​

Plural noun, equal to the QUOTA_EXCEEDED resourcePlural extension.

QuotaHeadroom.plan ● String! non-null scalar​

The plan in force, equal to the QUOTA_EXCEEDED plan extension.

QuotaHeadroom.limit ● Int scalar​

The plan's cap. NULL means the plan declares no cap (unlimited).

QuotaHeadroom.used ● Int! non-null scalar​

Current count, taken over scope (the whole organization).

QuotaHeadroom.remaining ● Int scalar​

max(limit - used, 0). Never negative; NULL when unlimited.

QuotaHeadroom.overBy ● Int! non-null scalar​

How far used exceeds limit (0 within the cap or when unlimited).

QuotaHeadroom.canCreate ● Boolean! non-null scalar​

Whether a create would pass the plan cap right now.

QuotaHeadroom.largerPlanExists ● Boolean! non-null scalar​

Whether ANY plan in the catalogue declares a HIGHER cap for this resource than the plan in force.

Read this before telling anyone to upgrade. It is computed by comparing the actual declared caps, never by plan name or position: there is no tier type in this codebase, so "upgrade to Pro" is not automatically more of anything. False on the top plan for this resource, and false when the cap is already unlimited — an Enterprise org at its strategy cap has nothing to upgrade to, and telling it to is GH#2710.

QuotaHeadroom.scope ● QuotaScope! non-null enum​

The set the count spans — always ORGANIZATION.

QuotaHeadroom.organizationId ● String! non-null scalar​

The organization the count was taken over.

Returned By​

quotaHeadroom query