FlexScan APIs
FlexScan APIs let you onboard your cloud accounts for agentless, snapshot-based scanning and manage the full scan lifecycle programmatically. Use these APIs to register and configure the cloud accounts you want Qualys to scan, monitor the status of scans that run against your virtual machines, images, and other resources, and track the workflows and configuration changes made through the API.
This topic describes what you need before you start calling FlexScan APIs, including authentication, the base URL, request and response formats, pagination, and error handling. Refer to this topic before you use any of the individual FlexScan API operations described in this guide.
What you can do
FlexScan APIs are organized into the following groups:
- Service Accounts - Register and configure the cloud provider accounts (GCP project, AWS account, or Azure subscription) that Qualys is authorized to scan.
- Target Accounts - Configure scan settings for individual accounts scoped under a parent service account, such as a member account in an AWS Organization.
- Scan Logs - Retrieve the status and history of resource scans.
- Audit Trail - Track the workflows and configuration changes triggered through the API.
Prerequisites
Before you start using FlexScan APIs, make sure you have the following:
- A Qualys subscription with FlexScan enabled.
- A Qualys user account with the permissions required to manage cloud connectors and scans.
- The cloud provider account you want to onboard (GCP project, AWS account, or Azure subscription) along with the access Qualys needs to scan it. Refer to the Setup Service Account and related topics for account-specific requirements.
- A valid authentication token to include with every API request. See Authentication below.
A service account must be registered before you can configure or scan it, and a target account must belong to an already-registered service account.
Base URL
All FlexScan API requests use the following base path:
<qualys_gateway_url>/flexscan-api/rest/v1
Each API operation in this guide documents the path appended to this base URL.
Authentication
All FlexScan API requests must include a bearer token in the Authorization header.
Authorization: Bearer <qas-jwt-token>
Requests with a missing, expired, or invalid token receive a 401 Unauthorized response. Requests from an authenticated user who lacks the required permissions for an operation receive a 403 Forbidden response.
Request Format
For operations that accept a request body (such as POST requests), set the Content-Type header to application/json and send the payload as JSON.
Response Format
Every FlexScan API response is returned as JSON with the following top-level fields:
| Field | Data Type | Description |
|---|---|---|
| data | Object/Array | The response payload. Its shape depends on the API operation. |
| errors | Array | List of errors, if any. Empty when the request succeeds. |
| meta | Object | Additional context about the response, such as the response timestamp and, for list operations, pagination details. |
Sample response
{
"data": { },
"errors": [],
"meta": {
"timestamp": "2026-05-28T11:30:00Z"
}
}
Pagination
APIs that return a list of items support pagination through the following query parameters.
| Parameter | Data Type | Default | Description |
|---|---|---|---|
| page | Integer | 1 | Page number (1-based). |
| limit | Integer | 25 | Number of items per page. Range: 1-100. |
| sort | String | createdAt,desc | Sort field and direction, in the format field,direction. |
For paginated responses, the meta object in the response also includes page, limit, and total fields describing the current page, page size, and total number of items.
Error Handling
FlexScan APIs use standard HTTP status codes to indicate the outcome of a request. When a request fails, the errors array in the response includes a code and a message describing the problem.
| Status Code | Meaning |
|---|---|
| 200 | OK - Request completed successfully. |
| 400 | Bad Request - The request was invalid, such as a missing required field or a malformed value. |
| 401 | Unauthorized - The bearer token is missing, expired, or invalid. |
| 403 | Forbidden - You are authenticated but do not have permission to perform this operation. |
| 404 | Not Found - The requested resource does not exist. |
| 409 | Conflict - The request could not be completed due to a conflicting or concurrent change. |
| 500 | Internal Server Error - An unexpected error occurred while processing the request. |
| 503 | Service Unavailable - A dependent service is temporarily unavailable. Retry the request after some time. |