{"openapi":"3.1.0","info":{"title":"QuotaQueue API","version":"1.0.0","description":"Manage core commission operations: organizations, users, plans, rules, assignments, quotas, deals, pay periods, statements, reports, and calculations. Monetary values are integer minor currency units unless noted otherwise."},"servers":[{"url":"https://quotaqueue.com"}],"tags":[{"name":"Organization"},{"name":"Users"},{"name":"Plans"},{"name":"Deals"},{"name":"Pay periods"},{"name":"Statements"},{"name":"Reports"},{"name":"Integrations"},{"name":"Calculations"}],"paths":{"/api/v1/organization":{"get":{"tags":["Organization"],"summary":"Get organization","description":"Returns the organization associated with the API key.","operationId":"getOrganization","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Organization"],"summary":"Update organization","description":"Updates core organization settings. Omitted fields are unchanged.","operationId":"patchOrganization","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Organization name."},"timezone":{"type":"string","description":"IANA timezone, for example America/Los_Angeles."},"defaultCurrency":{"type":"string","description":"ISO 4217 currency code."},"fiscalYearStartMonth":{"type":"integer","description":"Month number from 1 through 12."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/users":{"get":{"tags":["Users"],"summary":"List users","description":"Lists every team member in the organization. Clerk identity IDs are never returned.","operationId":"getUsers","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Users"],"summary":"Create user","description":"Creates an active team member and schedules identity-provider synchronization.","operationId":"postUsers","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Unique team member email."},"name":{"type":"string","description":"Full name."},"role":{"type":"string","enum":["admin","manager","rep","other"],"description":"Access role."},"managerId":{"type":"string","description":"Manager user ID."},"title":{"type":"string","description":"Job title."},"startDate":{"type":"string","format":"date","description":"Employment start date in YYYY-MM-DD format."}},"required":["email","name","role"]}}}},"responses":{"201":{"description":"201 Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/users/{id}":{"get":{"tags":["Users"],"summary":"Get user","description":"Returns one team member by ID.","operationId":"getUsersId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Users"],"summary":"Update user","description":"Updates profile, role, reporting line, employment dates, or active state. The final active admin cannot be demoted or deactivated.","operationId":"patchUsersId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Full name."},"email":{"type":"string","description":"Email address."},"title":{"type":"string","description":"Job title."},"role":{"type":"string","enum":["admin","manager","rep","other"],"description":"Access role."},"managerId":{"type":["string","null"],"description":"Manager user ID; null removes the manager."},"startDate":{"type":"string","format":"date","description":"Start date."},"endDate":{"type":"string","format":"date","description":"End date."},"isActive":{"type":"boolean","description":"Whether the user is active."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Users"],"summary":"Deactivate user","description":"Deactivates a team member without deleting audit or commission history.","operationId":"deleteUsersId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans":{"get":{"tags":["Plans"],"summary":"List plans","description":"Lists draft, active, and archived commission plans.","operationId":"getPlans","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Plans"],"summary":"Create plan","description":"Creates a draft commission plan.","operationId":"postPlans","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Plan name."},"quotaPeriod":{"type":"string","enum":["monthly","quarterly","semiannual","annual"],"description":"Quota cadence."}}}}}},"responses":{"201":{"description":"201 Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}":{"get":{"tags":["Plans"],"summary":"Get plan","description":"QuotaQueue commission plan ID.","operationId":"getPlansId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Plans"],"summary":"Update plan","description":"Updates plan metadata, dates, quota strategy, and quota amount.","operationId":"patchPlansId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Plan name."},"description":{"type":"string","description":"Plan description."},"quotaAmount":{"type":"number","description":"Default quota in the organization's minor currency unit."},"quotaDistribution":{"type":"string","enum":["same_for_all","per_rep","per_period","per_rep_per_period"],"description":"Quota distribution model."},"quotaPeriod":{"type":"string","enum":["monthly","quarterly","semiannual","annual"],"description":"Quota cadence."},"effectiveStart":{"type":"string","format":"date","description":"Effective start date."},"effectiveEnd":{"type":"string","format":"date","description":"Effective end date."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/publish":{"post":{"tags":["Plans"],"summary":"Publish plan","description":"Activates a draft plan.","operationId":"postPlansIdPublish","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/unpublish":{"post":{"tags":["Plans"],"summary":"Unpublish plan","description":"Returns an active plan to draft state.","operationId":"postPlansIdUnpublish","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/archive":{"post":{"tags":["Plans"],"summary":"Archive plan","description":"Archives a plan. Existing history is retained.","operationId":"postPlansIdArchive","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/unarchive":{"post":{"tags":["Plans"],"summary":"Unarchive plan","description":"Returns an archived plan to draft state.","operationId":"postPlansIdUnarchive","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/duplicate":{"post":{"tags":["Plans"],"summary":"Duplicate plan","description":"Creates a draft copy including rules and period quotas.","operationId":"postPlansIdDuplicate","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"201 Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/rules":{"get":{"tags":["Plans"],"summary":"List plan rules","description":"QuotaQueue commission plan ID.","operationId":"getPlansIdRules","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Plans"],"summary":"Create plan rule","description":"Adds a validated commission rule to a plan.","operationId":"postPlansIdRules","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"flat_rate, tiered_rate, accelerator, decelerator, milestone, spif, split, clawback, cap, draw, modifier, team_bonus, or overlay."},"name":{"type":"string","description":"Rule name."},"config":{"type":"object","description":"Rule-specific configuration. Omit to use the type's defaults."}},"required":["type"]}}}},"responses":{"201":{"description":"201 Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/rules/{ruleId}":{"patch":{"tags":["Plans"],"summary":"Update plan rule","description":"QuotaQueue plan rule ID.","operationId":"patchPlansIdRulesRuleId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Rule name."},"description":{"type":"string","description":"Rule description."},"config":{"type":"object","description":"Complete validated rule configuration."},"isEnabled":{"type":"boolean","description":"Whether this rule participates in calculations."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Plans"],"summary":"Delete plan rule","description":"Permanently removes a rule from the plan.","operationId":"deletePlansIdRulesRuleId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/rules/reorder":{"post":{"tags":["Plans"],"summary":"Reorder plan rules","description":"Sets calculation order. Supply every rule ID exactly once.","operationId":"postPlansIdRulesReorder","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ruleIds":{"type":"array","items":{"type":"string"},"description":"All rule IDs in desired order."}},"required":["ruleIds"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/assignments":{"get":{"tags":["Plans"],"summary":"List plan assignments","description":"QuotaQueue commission plan ID.","operationId":"getPlansIdAssignments","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Plans"],"summary":"Assign user to plan","description":"Creates an effective-dated plan assignment.","operationId":"postPlansIdAssignments","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID."},"effectiveStart":{"type":"string","format":"date","description":"Assignment start date."},"effectiveEnd":{"type":"string","format":"date","description":"Assignment end date."},"quotaOverride":{"type":"number","description":"User-specific default quota."},"ruleOverrides":{"type":"object","description":"Rule-ID keyed override configuration."}},"required":["userId","effectiveStart"]}}}},"responses":{"201":{"description":"201 Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/assignments/{assignmentId}":{"patch":{"tags":["Plans"],"summary":"Update assignment","description":"QuotaQueue plan assignment ID.","operationId":"patchPlansIdAssignmentsAssignmentId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"assignmentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"effectiveStart":{"type":"string","format":"date","description":"Assignment start date."},"effectiveEnd":{"type":"string","format":"date","description":"Assignment end date."},"quotaOverride":{"type":"number","description":"User-specific default quota."},"ruleOverrides":{"type":"object","description":"Rule-ID keyed override configuration."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Plans"],"summary":"Remove assignment","description":"Removes a user from the plan without deleting historical statements.","operationId":"deletePlansIdAssignmentsAssignmentId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"assignmentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/quotas":{"get":{"tags":["Plans"],"summary":"List quota overrides","description":"Returns both plan-period and rep-period quota overrides.","operationId":"getPlansIdQuotas","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/quotas/{payPeriodId}":{"put":{"tags":["Plans"],"summary":"Set plan-period quota","description":"Upserts a plan-wide quota override. QuotaQueue pay period ID. Omit quotaAmount to clear the override.","operationId":"putPlansIdQuotasPayPeriodId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"payPeriodId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"quotaAmount":{"type":"number","description":"Quota in the organization's minor currency unit; omit to clear."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/plans/{id}/assignments/{assignmentId}/quotas/{payPeriodId}":{"put":{"tags":["Plans"],"summary":"Set rep-period quota","description":"Upserts the most specific quota override for an assignment and pay period. Omit quotaAmount to clear it.","operationId":"putPlansIdAssignmentsAssignmentIdQuotasPayPeriodId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"assignmentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"payPeriodId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"quotaAmount":{"type":"number","description":"Quota in the organization's minor currency unit; omit to clear."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/deals":{"get":{"tags":["Deals"],"summary":"List deals","description":"Returns an offset-paginated list of organization deals.","operationId":"getDeals","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, default 100, maximum 500.","schema":{"type":"integer"}},{"name":"offset","in":"query","required":false,"description":"Zero-based offset, default 0.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Deals"],"summary":"Create deal","description":"Creates a deal in the organization's base currency. Monetary values use minor currency units.","operationId":"postDeals","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Deal name."},"amount":{"type":"number","description":"Deal amount in minor currency units."},"closeDate":{"type":"string","format":"date","description":"Close date."},"primaryRepId":{"type":"string","description":"Primary credited user ID."},"dealType":{"type":"string","enum":["new_business","expansion","renewal","one_time"],"description":"Deal type; defaults to new_business."},"revenueType":{"type":"string","enum":["one_time","recurring"],"description":"Revenue type; defaults to one_time."},"contractLengthMonths":{"type":"number","description":"Contract term."},"stage":{"type":"string","enum":["pending","closed_won","churned","refunded"],"description":"Commission stage."},"product":{"type":"string","description":"Product name."},"notes":{"type":"string","description":"Internal notes."},"externalId":{"type":"string","description":"Source-system identifier."},"splitAllocations":{"type":"array","items":{"type":"string"},"description":"Manual credit splits; percentages must total 100."}},"required":["name","amount","closeDate","primaryRepId"]}}}},"responses":{"201":{"description":"201 Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/deals/{id}":{"get":{"tags":["Deals"],"summary":"Get deal","description":"Returns one deal, including split, hold, CRM, and FX stamps when present.","operationId":"getDealsId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Deals"],"summary":"Update deal","description":"Updates editable deal and crediting fields.","operationId":"patchDealsId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Deal name."},"amount":{"type":"number","description":"Amount in minor currency units."},"closeDate":{"type":"string","format":"date","description":"Close date."},"primaryRepId":{"type":"string","description":"Primary credited user ID."},"dealType":{"type":"string","description":"Deal type."},"revenueType":{"type":"string","description":"Revenue type."},"contractLengthMonths":{"type":"number","description":"Contract term."},"stage":{"type":"string","description":"Commission stage."},"product":{"type":"string","description":"Product name."},"notes":{"type":"string","description":"Internal notes."},"splitAllocations":{"type":"array","items":{"type":"string"},"description":"Manual splits; use [] to clear."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Deals"],"summary":"Delete deal","description":"Deletes a deal and its manual override. Locked historical artifacts are not rewritten.","operationId":"deleteDealsId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/deals/{id}/hold":{"post":{"tags":["Deals"],"summary":"Hold deal","description":"Excludes the deal from open-period calculations and enqueues recalculation.","operationId":"postDealsIdHold","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Required audit reason."}},"required":["reason"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/deals/{id}/release":{"post":{"tags":["Deals"],"summary":"Release deal","description":"Removes a hold and enqueues recalculation.","operationId":"postDealsIdRelease","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/pay-periods":{"get":{"tags":["Pay periods"],"summary":"List pay periods","description":"Lists open, locked, approved, and paid periods.","operationId":"getPayPeriods","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/pay-periods/{id}":{"get":{"tags":["Pay periods"],"summary":"Get pay period","description":"QuotaQueue pay period ID.","operationId":"getPayPeriodsId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/pay-periods/{id}/lock":{"post":{"tags":["Pay periods"],"summary":"Lock pay period","description":"Locks a period against ordinary recalculation.","operationId":"postPayPeriodsIdLock","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/pay-periods/{id}/unlock":{"post":{"tags":["Pay periods"],"summary":"Unlock pay period","description":"Returns a period to open state.","operationId":"postPayPeriodsIdUnlock","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/pay-periods/{id}/approve":{"post":{"tags":["Pay periods"],"summary":"Approve pay period","description":"Advances a locked period and its statements to approved.","operationId":"postPayPeriodsIdApprove","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/pay-periods/{id}/mark-paid":{"post":{"tags":["Pay periods"],"summary":"Mark pay period paid","description":"Advances an approved period and its statements to paid.","operationId":"postPayPeriodsIdMarkPaid","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/statements":{"get":{"tags":["Statements"],"summary":"List statements","description":"Lists statements for one pay period.","operationId":"getStatements","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"payPeriodId","in":"query","required":true,"description":"Pay period ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/statements/{id}":{"get":{"tags":["Statements"],"summary":"Get statement","description":"Returns statement totals, quota attainment, and lifecycle state.","operationId":"getStatementsId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/statements/{id}/line-items":{"get":{"tags":["Statements"],"summary":"List statement line items","description":"Returns the calculation line items underlying a statement.","operationId":"getStatementsIdLineItems","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/statements/{id}/approve":{"post":{"tags":["Statements"],"summary":"Approve statement","description":"Approves a locked, rep-approved, or disputed statement.","operationId":"postStatementsIdApprove","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/statements/{id}/dispute":{"post":{"tags":["Statements"],"summary":"Dispute statement","description":"Marks a statement disputed and stores an audit note.","operationId":"postStatementsIdDispute","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","description":"Reason for dispute."}},"required":["note"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/reports":{"get":{"tags":["Reports"],"summary":"List saved reports","description":"Lists saved report definitions for the organization.","operationId":"getReports","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/reports/{id}":{"get":{"tags":["Reports"],"summary":"Get saved report","description":"Returns a saved report definition and its validated configuration.","operationId":"getReportsId","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/reports/{id}/results":{"get":{"tags":["Reports"],"summary":"Run saved report","description":"Runs a saved report against current organization data and returns columns, rows, totals, and truncation metadata.","operationId":"getReportsIdResults","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/reports/{id}/export":{"get":{"tags":["Reports"],"summary":"Export saved report as CSV","description":"Runs a saved report and downloads its current result as CSV. Money is expressed in major currency units and percentages as percentage points.","operationId":"getReportsIdExport","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/integrations":{"get":{"tags":["Integrations"],"summary":"List integrations","description":"Lists connected integrations without access or refresh tokens.","operationId":"getIntegrations","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"read","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/calculate":{"post":{"tags":["Calculations"],"summary":"Recalculate commissions","description":"Queues commission recalculation for an open pay period.","operationId":"postCalculate","security":[{"bearerAuth":[]}],"x-quotaqueue-permission":"write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payPeriodId":{"type":"string","description":"Pay period ID."}},"required":["payPeriodId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"QuotaQueue API key","description":"Keys begin with qq_live_."}},"schemas":{"SuccessEnvelope":{"type":"object","required":["data"],"properties":{"data":{},"meta":{"type":"object","additionalProperties":true}}},"ErrorEnvelope":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}},"responses":{"ValidationError":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthorized":{"description":"API key is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Forbidden":{"description":"The API key lacks the required write or admin permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"The resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"RateLimited":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}