Setup Target Accounts API

POST/flexscan-api/rest/v1/target-accounts/setup

This API configures scan settings for a target account. Updates only the target account record - does not modify the parent service account or trigger new infrastructure provisioning.

Validation Rules

  • Target account regions must be a subset of (or equal to) the parent service account's configured regions.
  • vmScanTypes must be a subset of the parent service account's vmScanTypes.
  • If the parent service account has ["os"], the target may specify ["os"] but not ["os", "sca"].

Input parametersInput parameters

Parameter Mandatory/Optional Data Type Description
accountId Mandatory String (path) Target account identifier
regions Mandatory Array of String Regions to scan - must be subset of parent service account's regions
scanInterval Optional Integer Scan interval in hours. Range: 24–720.
Default: 24
resourceTypes Optional Array of String Resource types to scan. Allowed value: vm.
Default: ["vm"]
vmScanTypes Optional Array of String VM scan types. Options: os, sca, secret.
Must be subset of parent service account's vmScanTypes.
Default: ["os"]
mustHaveTags Optional Array of String Resources must have ALL of these tags (AND logic).
Format: "key=value"
atLeastOneTag Optional Array of String Resources must have AT LEAST ONE of these tags (OR logic).
Format: "key=value"
noneOfTheTag Optional Array of String Resources with ANY of these tags are excluded.
Format: "key=value"

Tag Behavior: If a tag parameter is set to an empty array ([]) or null, no filtering is applied for that parameter. When all three tag parameters are empty or null, all resources are included in the scan.
Currently, these parameters are referred to as tags, however, in GCP they are called labels.

Target Account Tag Fallback: For target accounts, null tag values inherit the configuration from the parent service account. Setting a tag parameter to an empty array ([]) overrides the parent configuration and disables filtering for that parameter.

Tag Format Examples by Cloud:

  • AWS: "Environment=Production", "Owner:PlatformTeam" (supports both equals (=) and colon (:) separators)
  • Azure: "environment=production", "owner=platform-team" (keys are case-sensitive)
  • GCP: "environment=production", "owner=platform-team" (only the equals (=) separator is supported)

Sample - Setup a Target AccountSample - Setup a Target Account

API Request

curl -X POST \
  '<qualys_gateway_url>/flexscan-api/rest/v1/target-accounts/setup' \
  -H 'Authorization: Bearer <qas-jwt-token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "accountId": "target-xxxxxxxx",
    "regions": ["us-east1"],
    "scanInterval": 48,
    "resourceTypes": ["vm"],
    "vmScanTypes": ["os"],
    "mustHaveTags": ["env=staging"]
  }'

API Response

{
  "data": {
    "status": "ACCEPTED",
    "accountId": "target-xxxxxxxxx",
    "serviceAccountId": "my-gcp-project-123",
    "cloudType": "GCP",
    "previousRegions": [],
    "currentRegions": ["us-east1"],
    "addedRegions": ["us-east1"],
    "removedRegions": [],
    "scanInterval": 48,
    "resourceTypes": ["vm"],
    "vmScanTypes": ["os"],
    "mustHaveTags": ["env=staging"],
    "atLeastOneTag": null,
    "noneOfTheTag": null
  },
  "errors": [],
  "meta": {
    "timestamp": "2026-05-28T11:30:00Z"
  }
}