Scan Health Configuration REST API

Scan Health Configuration REST API

Overview

The Scan Health Configuration API allows administrators to configure automatic build failure when a scan detects zero components. This helps identify scan misconfigurations early in the CI/CD pipeline instead of producing empty scan results. Configuration supports hierarchical inheritance. Settings can be configured at the organization level and inherited by applications, or overridden at the application level.

Base URL

/api/v2/config/scanHealth/{ownerType}/{ownerId}
Path Parameter Type Value Description
ownerType string application or organization Level where the configuration is applied
ownerId string Internal ID Internal ID of the application or organization

Authentication and Permissions

All endpoints require authentication.

Operation Required Permission
GET View IQ Elements (READ)
PUT Edit IQ Elements (WRITE)
DELETE Edit IQ Elements (WRITE)

Configuration Model

{
  "failOnZeroComponents": true | false | null
}
Field Type Description
failOnZeroComponents Boolean true fails scans with zero components. false explicitly disables the behavior. null or absent inherits configuration from the parent organization.

Inheritance Rules

Configuration is resolved using the following priority order:

By default, scans with zero components are allowed.

Endpoints

GET - Retrieve Configuration

Returns the directly stored configuration for the specified owner. This operation does not resolve inherited configuration values.

GET /api/v2/config/scanHealth/organization/{orgId}

GET /api/v2/config/scanHealth/application/{appId}
{
    "failOnZeroComponents": true
}

An empty response indicates that no direct configuration exists for the specified owner.

Owner not found

PUT - Create or Update Configuration

Creates or updates the scan health configuration for the specified owner.

PUT /api/v2/config/scanHealth/organization/{orgId}
Content-Type: application/json
{
    "failOnZeroComponents": true
}
Request body is null
Owner not found

DELETE - Remove Configuration

Removes the direct configuration for the specified owner. After deletion, configuration inheritance applies again from the parent organization or default behavior.

DELETE /api/v2/config/scanHealth/organization/{orgId}

DELETE /api/v2/config/scanHealth/application/{appId}
Configuration deleted successfully
No configuration found for the specified owner

Scan Behavior

When failOnZeroComponents is enabled for an application, either directly or through inheritance:

Scenario Behavior
Scan finds components Normal evaluation behavior
Scan finds zero components Report is persisted, SBOM is activated, and the build returns HTTP 400
Scan finds only unknown components Normal evaluation behavior. Unknown components count as detected components.

Failure Response

When a scan detects zero components:

HTTP 400 Bad Request

Scan failed: zero components detected. This may indicate a scan misconfiguration.

Key Details

Examples

Enable at organization level

curl -u admin:admin123 -X PUT 
"https://iq-server/api/v2/config/scanHealth/organization/{orgId}" 
-H "Content-Type: application/json" 
-d '{"failOnZeroComponents": true}'

Enable at application level

curl -u admin:admin123 -X PUT 
"https://iq-server/api/v2/config/scanHealth/application/{appId}" 
-H "Content-Type: application/json" 
-d '{"failOnZeroComponents": true}'

Disable at application level

curl -u admin:admin123 -X PUT 
"https://iq-server/api/v2/config/scanHealth/application/{appId}" 
-H "Content-Type: application/json" 
-d '{"failOnZeroComponents": false}'

Revert application to inherited behavior

curl -u admin:admin123 -X DELETE 
"https://iq-server/api/v2/config/scanHealth/application/{appId}"

Check direct configuration

curl -u admin:admin123 
"https://iq-server/api/v2/config/scanHealth/application/{appId}"

Cascade Deletion

When an application or organization is deleted, its scan health configuration is automatically removed.

Audit Events

GET operations are not audited.

Operation Audit Domain Audit Type
PUT governance.scan-health configure
DELETE governance.scan-health delete