Retrieve Size Analysis status check rules for a project
Retrieve the current Size Analysis status check rules configured for a project.
Use this endpoint after receiving a size_analysis.completed webhook when you
want external CI to evaluate the same Size Analysis status check thresholds that
Sentry uses. The endpoint returns the current project configuration, not a
historical snapshot from when the webhook was emitted.
The response includes whether status check enforcement is enabled and the normalized rule list Sentry uses when evaluating Size Analysis thresholds.
This endpoint requires a bearer token with project:read access. Project
distribution tokens are not supported.
Response notes:
enabled: falsemeans status-check enforcement is disabled for the project.rules: []means there are no configured thresholds to evaluate.valueis returned as a string. Forabsoluteandabsolute_diffmeasurements it is a byte value; forrelative_diffit is a percentage.filterQueryis the original configured filter string.filtersis the machine-readable version offilterQuery.filters: []means the rule has no filters and applies to all builds.filters: nullmeans the saved filter query could not be parsed; Sentry's status check trigger treats that rule as non-matching.
Rule evaluation semantics:
- Threshold comparisons are strict: a rule triggers only when the computed value is greater than the configured threshold, not greater than or equal to it.
absolute_diffandrelative_diffrequire a matching base metric/build.relative_diffdoes not trigger when the base size is zero.artifactTypeidentifies the artifact scope the rule evaluates.main_artifact,watch_artifact,android_dynamic_feature_artifact, andapp_clip_artifacttarget their matching artifact metric.all_artifactsevaluates all available artifact metrics.- Rule filters support the keys
app_id,git_head_ref,build_configuration_name, andplatform_name. - Filter objects are combined with AND. Multiple
conditionsinside one filter object are combined with OR. - Each condition uses
values; single-value operators still return a one-item array. - Values in
filtersare decoded literal values for exact/simple operators, not query syntax. For example,app_id:\*cominfilterQuerybecomesvalues: ["*com"]withoperator: "equals". - The same key can appear in more than one filter object when positive and negative conditions both exist; those filter objects are still combined with AND.
- Supported filter operators are
equals,notEquals,in,notIn,contains,notContains,startsWith,notStartsWith,endsWith,notEndsWith,matches, andnotMatches. matchesandnotMatchesvalues use Sentry wildcard pattern syntax, not regular expressions.*matches zero or more characters, escaped\*matches a literal asterisk, and a pattern without*is an exact match.inandnotInare evaluated as one condition against all values, matching Sentry's status check trigger behavior.- A rule applies only when the build metadata matches all filters. If a referenced metadata key is missing, the filter does not match, even for negated operators.
Path Parameters
organization_id_or_slug(string)REQUIREDThe ID or slug of the organization the resource belongs to.
project_id_or_slug(string)REQUIREDThe ID or slug of the project the resource belongs to.
Scopes
<auth_token> requires one of the following scopes:project:adminproject:readproject:write
curl https://sentry.io/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/preprod/size-analysis/status-check-rules/ \ -H 'Authorization: Bearer <auth_token>'
Copied{ "enabled": true, "rules": [ { "id": "rule-1", "metric": "install_size", "measurement": "absolute_diff", "value": "5000000", "filterQuery": "app_id:com.example.app platform_name:apple build_configuration_name:Release", "filters": [ { "key": "app_id", "conditions": [ { "operator": "equals", "values": [ "com.example.app" ] } ] }, { "key": "platform_name", "conditions": [ { "operator": "equals", "values": [ "apple" ] } ] }, { "key": "build_configuration_name", "conditions": [ { "operator": "equals", "values": [ "Release" ] } ] } ], "artifactType": "main_artifact" } ] }