statsig · API Governance Rules
statsig API Rules
Spectral linting rules defining API design standards and conventions for statsig.
10 Rules
error 2
warn 5
Rule Categories
statsig
Rules
error
statsig-api-key-header
Statsig APIs require authentication via the statsig-api-key header. All operations must declare this security requirement.
$.paths[*][*]
warn
statsig-operation-ids-camel-case
Statsig API operation IDs use camelCase naming convention throughout the HTTP, Console, Events, Client SDK, and Server SDK APIs.
$.paths[*][*].operationId
warn
statsig-summaries-title-case
All Statsig API operation summaries must use Title Case for readability and consistency across all API specifications.
$.paths[*][*].summary
error
statsig-tags-required
Every Statsig API operation must declare at least one tag for proper documentation grouping.
$.paths[*][*]
warn
statsig-client-time-header
Log event operations in Statsig APIs require the STATSIG-CLIENT-TIME header for timestamp normalization. Operations that accept events must declare this header parameter.
$.paths['/log_event'][*].parameters[?(@.name == 'STATSIG-CLIENT-TIME')]
hint
statsig-pagination-parameters
Console API list operations use limit and page query parameters for pagination. List endpoints should declare these parameters.
$.paths[?(!@ =~ /.*\{.*\}.*/)]..get.parameters[?(@.name == 'limit')]
hint
statsig-api-version-header
The Console API uses STATSIG-API-VERSION header for versioning. Console API operations should declare this optional header parameter.
$.paths[*].get.parameters[?(@.name == 'STATSIG-API-VERSION')]
warn
statsig-console-resource-ids
Statsig Console API uses string-type IDs (gate names, config names) as path parameters rather than numeric IDs.
$.paths[*][*].parameters[?(@.name == 'id' && @.in == 'path')]
warn
statsig-events-202-response
Statsig event ingestion endpoints return 202 Accepted (not 200 OK) since events are processed asynchronously.
$.paths['/log_event'][*].responses
hint
statsig-success-boolean-response
Statsig API event endpoints return a simple {"success": true} response body on success. Responses should follow this consistent pattern.
$.paths['/log_event'][*].responses['202'].content['application/json'].schema.properties