- Checkmarx Documentation
- Checkmarx One
- Checkmarx One User Guide
- Scan Management
- SAST Query Editor
- Query Editor API Compatibility
Query Editor API Compatibility
Overview
This page details the APIs and their changes in the new QueryEditor version.
In this version of QueryEditor, most of the APIs were improved to work with the new UI. Due to this update, Checkmarx cannot ensure their backward compatibility. Ensure your environment is updated before using a changed API.
Details:
SAST: APIs related explicitly to the QueryEditor SAST engine. These APIs will be gradually supported on other engines (like KICS)
NEWUI: APIs related to the UI and templates; these APIs are relevant to the QueryEditor UI/UX.
ASYNC: APIs are asynchronous and will return the request UUID. The process will run in the background, and to check the progress/final result, please use the get request API:
Flow Mechanism
The API flow mechanism to create/run a query and obtain the results has changed:
Old version:
Create Session
Detect Languages
ASYNC Scan Project
Return the Scan Project request number (
1
)
⏳Check if the SAST Engine is ready to use
Wait for Scan to finish (get sast-status API)
ASYNC Compile Query
Return the Run Query request number (
2
)
⏳Check if the query compilation has finished
Wait for query compilation to finish (get request-status API)
Create Query
ASYNC Run Query
Return the Run Query request number (
3
)
⏳Check if the run request status has finished
Wait for the run query to finish (get request-status API)
Get all the results/debug message structure.
New Version:
ASYNC Create Session
Starts the Detect Languages process.
Return the Detect Languages request identifier (UUID)
⏳Check the Detect Languages request
Wait for Detect Languages to finish (get request-status API)
ASYNC Scan Project
Return the Scan Project request identifier (UUID)
⏳Check if the SAST Engine is ready to use
Wait for Scan to finish (get request-status API)
ASYNC Create Query
Compiles the query
The Validate Queries API could also be triggered to validate/compile queries.
Return the Create Query request identifier.
⏳Check if the query was created
Wait for the create query to finish (get request-status API)
ASYNC Run Query
Return the Run Query request identifier.
⏳Check if the run request status has finished
Wait for the run query to finish (get request-status API)
Get Results
Get Vulnerabilities
Get Vulnerability Data (attack vector)
Get Debug Messages
APIs version comparison
A lot of changes were made to improve the QueryEditor experience. One of the primary changes is that almost all the APIs have the sessionId
as a required parameter. This will allow it to match all of its operations to a unique session and apply filter permissions to that operation.
Sessions
APIs related to QueryEditor sessions:
Description | Old API | New API | Details |
---|---|---|---|
Create Session ASYNC | [POST]
| [POST]
{ "projectId": "58d5807b-bd11-4ec3-93ef-e3ca36c40b0f", "scanId": "737c64f3-0c86-4cae-9e27-e2ef0b221a90", "scanner": "sast", "timeout": 30, #seconds "uploadUrl": "https://cx.one.com/storage/uploads/75d4fe35-965a-4506-b226-e0155ec84c34/231d5d89-4cf2-45e5-8cb0-6be6b072548b" } NoticeThe
| It's the same API but with a different mechanism. Previously, only the session was created, and other APIs would detect languages. Now, the same API does both (create session and detect languages). The new version will also return information relevant to the UI, like NoteThe Detect Languages process is an asynchronous operation. Please wait and check for the response status using the request status API. |
Get Active Sessions | [GET]
| NOT IMPLEMENTED | This API was not necessary on the new QueryEditor version. |
Get Session Details | [GET]
| NOT IMPLEMENTED | This API was not necessary on the new QueryEditor version. |
Health Check Session | [POST]
| [PATCH]
| It's the same API, but the REST type was improved. Now, in the new version, it is a PATCH instead of a POST. NoticePlease note that the parameter names have changed from |
Delete Session | [DELETE]
| [DELETE]
| It's the same API with the same behavior. NoticePlease note that the parameter names have changed from |
Get Logs SAST | [GET]
| [GET]
| It's the same API with the same behavior. NoticeThe parameter names have changed from |
Get Layout Type NEWUI | N/A | [POST] | Get the layout for a specific use case. The UI uses this API to support multiple engines (e.g., KICS and SAST) and, in this way, knows how to create and edit queries from fields. It is only used by the new version. |
Sources
APIs related to QueryEditor scan sources (get sources tree, get source content, and scan source files with SAST engine):
Description | Old API | New API | Details |
---|---|---|---|
Get Sources Tree NEWUI | N/A | [GET]
| API is only relevant for the new Query Editor UI to get the sources tree structure. |
Get Source File Content NEWUI | N/A | [GET]
| API is relevant for the UI to show the source file content. |
Scan Project Sources (SAST engine) ASYNC | [GET]
| [POST]
| This API will perform the same operation. It’s an asynchronous operation that scans the sources. The main difference is that the new version will return a request UUID. NoticeThe REST URL, operation type ( NoteThis API is an asynchronous operation, so please wait and check for the status of the result using the request status API. |
Queries
APIs related to QueryEditor SAST queries:
Description | Old API | New API | Details |
---|---|---|---|
Get Queries | [GET]
| [GET]
| This API has the same goal but different implementations, parameters, and responses. |
Get Queries Metadata | [GET]
| NOT IMPLEMENTED | This API was not necessary on the new QueryEditor version. We can get the metadata for each query for performance reasons. |
Get Query Data (Metadata & Source) | Get Query Source [GET] [GET]
| Get Query Source & Metadata [GET]
| The new version allows a unique API to get query metadata and source. |
Create/Override Query ASSYNC | [POST]
| [POST]
| It's the same API with the same goal but a different approach. The API is an asynchronous operation that checks the request status. The request body has not been changed; it does not require the path and This API can be overridden per tenant/application in the new version when the
NoticeIn the new version, this operation requires a session. NoteThis API is an asynchronous operation, so please wait and check for the status of the result using the request status API. |
Delete Query ASSYNC | [DELETE]
| [DELETE]
| It's the same API but relies on the NoteThis API is an asynchronous operation, so please wait and check for the status of the result using the request status API. |
Update Query (Source & Metadata) ASSYNC | Update Multiple Query Metadata & Source [PUT] [PUT]
| Update Query Metadata [PUT]
| These APIs were split into two because QueryEditor doesn’t have a way to edit multiple metadata, but updating multiple sources is possible. Currently, only Severity can be updated when it comes to metadata. This API overrode and updated query source/metadata in the previous version. NoticeThe REST URL and the parameter names have changed to NoteThis API is an asynchronous operation, so please wait and check for the status of the result using the request status API. |
Update Multiple Query Sources [PUT]
| |||
Validate Queries ASSYNC | [POST]
| [POST]
| The same API is also an asynchronous request to return the request identifier. The REST URL has been changed to NoticeThe REST URL and the parameter names have been changed from NoteThis API is an asynchronous operation, so please wait and check for the status of the result using the request status API. |
Run Queries ASSYNC | [POST]
| [POST]
| The same API also has an asynchronous request to return the request identifier. The result for the run will be different. NoticePlease be aware that the REST URL and the parameter names have changed from NoteThis API is an asynchronous operation, so please wait and check for the status of the result using the request status API. |
Cancel Queries Execution | [GET]
| NOT IMPLEMENTED | This API is retrieved using the get request status API. |
Requests
APIs related to QueryEditor asynchronous requests:
Notice
Please check the ASYNC operations.
Description | Old API | New API | Details |
---|---|---|---|
Check SAST Engine Status | [GET]
| [GET]
| There is a request UUID for each asynchronous operation and only one API to get the result. Each scan status operation will return the same response fields. This improves the experience and avoids duplicated efforts to check the status. NoteThe API URL and the parameter names have changed from |
Check Request Status | [GET]
| ||
Cancel Request Execution | [GET]
| [PUT]
| Previously, there was an option to cancel the query execution. It was missing other asynchronous requests like scan sources, create/edit/delete query, compile/validate queries… Now, you can reuse the request ID and cancel every asynchronous operation. NoteThe API URL and the parameter names have changed from |
Results
APIs related to QueryEditor SAST query results (vulnerabilities, debug messages, and attach vector).
These are new APIs that replace the old query mechanism. Previously, Run queries returned all the results and debug messages for each run. Now, Run queries return the run ID, and the results/debug messages are divided into the following 4 different APIs:
Get Results: Get all the results in the data summary tree for all the session runs.
Get Vulnerabilities: get all vulnerabilities related to a given result (result
key
from previous API)Get Vulnerability: get specific vulnerability data, such as the attack vector for the given vulnerability (
vulnerabilityId
from the previous API)Get Debug Messages: get debug messages for a specific result (result
key
from get results API)
Description | Old API | New API | Details |
---|---|---|---|
Get Results (Tree) | N/A NoticeAll this information was retrieved in the Run queries operation for the old version. | [GET]
| This is a new API that returns a summary of the results. |
Get Vulnerabilites | [GET]
| API to get all the vulnerabilities related to a given result. | |
Get Vulnerability Data (Attack Vector) | [GET]
| API to get the attack vector information. | |
Get Debug Messages | [GET]
| Get the debug messages for a specific result. |
Assistant SAST
APIs related to Query Builder Assistant (GPT):
Notice
The SAST QueryEditor uses the following APIs.
Descriprition | Old API | New API | Details |
---|---|---|---|
Get Query Builder (GPT) History | [GET]
| [GET]
| It has the same API, same parameter, and result. NotePlease note that the API URL and the parameter names have changed from |
Delete Query Builder (GPT) History | [DELETE]
| [DELETE]
| It has the same API, same parameter, and result. NotePlease note that the API URL and the parameter names have changed from |
Process Query Builder (GPT) Request | [POST]
| [POST]
| It has the same API, same parameter, and result. NotePlease note that the API URL and the parameter names have changed from |