--- title: Validating API specifications in API Insights description: You can access API specification validation rules to verify that your API specifications are complete, consistent, and adhere to best practices. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/api-insights/api-insights-validating-rules.html release: australia product: API Insights classification: api-insights topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 3 breadcrumb: [CMDB administrator tasks, Configure, API Insights, Configuration Management Database \(CMDB\), Configuration Management, Extend ServiceNow AI Platform capabilities] --- # Validating API specifications in API Insights You can access API specification validation rules to verify that your API specifications are complete, consistent, and adhere to best practices. Validation rules identify structural issues early during import or analysis, improving overall API quality. You can manage these rules to enforce standardization across API specifications and reduce errors by checking for missing or incorrect fields before APIs are published or used in production. ## Storing API specifications The API Specification \[sn\_api\_insights\_ws\_api\_specification\] table stores the specification documents that describe individual APIs. Each record includes the following details to identify the API to which the specification belongs and to manage multiple versions.
| Field | Description |
|---|---|
| Name | Name of the API. |
| Version | Version of the API. |
| Type | Format and version of the API specification standard being used. For example, `openapi3.0.0` for an OpenAPI specification. |
| State | Current status indicating whether the API specification has been validated against the applicable rules and the validation outcome. Valid values are:- **Unprocessed**: Indicates that the API specification hasn’t been validated. - **Valid**: Indicates that the API specification was validated and processed successfully or with warnings. If warnings are present, details are displayed in the **Message** field. - **Invalid**: Indicates that the API specification was validated but contains errors. Error details are displayed in the **Message** field. |
| Specification | Full content of the API specification file. **Note:** For OpenAPI, includes the complete OpenAPI document describing endpoints, methods, and schema. |
| Message | Messages are generated after processing all validation rules for the specification type. They include errors or warnings with explanations. |
| Component | Description |
|---|---|
| Specification | API specification for which the rule is designed. |
| Version | Version of the API specification the rule validates. If specified, the rule applies only to those versions. To restrict validation to specific versions, specify them in the **Version** field. Separate multiple values with commas. For example, `1.0,1.1,2.0`.**Note:** If the **Version** field is left empty, the rule runs for all installed versions of the specified API specification type. |
| Type | Type of validation to perform. The valid values are:- **Path**: Verifies that the specific keys are present within arrays of objects, individual objects, or both, in the designated sections of the API specification document. - **Expected value**: Validates whether the specified key matches the expected values specified in the **Value** field. This validation applies only to a single key specified in the **Key** field. |
| Key | Part of the specification to verify. If no expected value is provided, you can enter multiple keys in the **Key** field, separated by commas. |
| Value | Expected values for the key specified in the **Key** field. Separate multiple values with commas. |
| Severity | Severity level of the validation rule outcome, either a warning or an error.**Note:** When set to warning, the API specification remains valid if the rule isn’t met, indicating it is not a failure, and only a message is displayed. |
| Message | Explanation of the issue when the rule is triggered. |
| Active | Option to activate the rule. Only active rules are triggered by the **API Specification Validation** scheduled job. |