Get Compliance Analysis
curl --request GET \
--url https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysisimport requests
url = "https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"resource_id": "res_abc123",
"repository_url": "https://github.com/owner/repo",
"environment_name": "production",
"compliance_analysis": {
"overall_score": 0.85,
"by_standard": {
"PCI-DSS": {
"score": 0.90,
"total_controls": 50,
"passed_controls": 45,
"failed_controls": 5
},
"HIPAA": {
"score": 0.80,
"total_controls": 30,
"passed_controls": 24,
"failed_controls": 6
}
},
"critical_issues": [
{
"control_id": "PCI-3.4",
"standard": "PCI-DSS",
"severity": "CRITICAL",
"description": "Encryption key management not properly configured"
}
],
"recommendations": [
{
"priority": "HIGH",
"action": "Enable encryption at rest for S3 buckets",
"impact": "Will improve PCI-DSS compliance score"
}
]
}
}
{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to get compliance analysis"
}
Indexing
Get Compliance Analysis
Get aggregated compliance analysis for an indexed repository
GET
/
v1
/
indexing
/
resources
/
{resource_id}
/
compliance-analysis
Get Compliance Analysis
curl --request GET \
--url https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysisimport requests
url = "https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"resource_id": "res_abc123",
"repository_url": "https://github.com/owner/repo",
"environment_name": "production",
"compliance_analysis": {
"overall_score": 0.85,
"by_standard": {
"PCI-DSS": {
"score": 0.90,
"total_controls": 50,
"passed_controls": 45,
"failed_controls": 5
},
"HIPAA": {
"score": 0.80,
"total_controls": 30,
"passed_controls": 24,
"failed_controls": 6
}
},
"critical_issues": [
{
"control_id": "PCI-3.4",
"standard": "PCI-DSS",
"severity": "CRITICAL",
"description": "Encryption key management not properly configured"
}
],
"recommendations": [
{
"priority": "HIGH",
"action": "Enable encryption at rest for S3 buckets",
"impact": "Will improve PCI-DSS compliance score"
}
]
}
}
{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to get compliance analysis"
}
Get aggregated compliance analysis from knowledge articles for an indexed repository
curl --request GET \
--url 'https://api.wistx.ai/v1/indexing/resources/res_abc123/compliance-analysis?standards=PCI-DSS&standards=HIPAA&refresh=false' \
--header 'Authorization: Bearer YOUR_API_KEY'
import requests
api_key = "YOUR_API_KEY"
resource_id = "res_abc123"
response = requests.get(
f"https://api.wistx.ai/v1/indexing/resources/{resource_id}/compliance-analysis",
headers={"Authorization": f"Bearer {api_key}"},
params={
"standards": ["PCI-DSS", "HIPAA"],
"refresh": False
}
)
analysis = response.json()
print(f"Compliance analysis for: {analysis['repository_url']}")
const apiKey = "YOUR_API_KEY";
const resourceId = "res_abc123";
const params = new URLSearchParams({
standards: "PCI-DSS",
standards: "HIPAA",
refresh: "false"
});
const response = await fetch(
`https://api.wistx.ai/v1/indexing/resources/${resourceId}/compliance-analysis?${params}`,
{
headers: {
Authorization: `Bearer ${apiKey}`
}
}
);
const analysis = await response.json();
console.log(`Compliance analysis for: ${analysis.repository_url}`);
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
apiKey := "YOUR_API_KEY"
resourceID := "res_abc123"
baseURL := fmt.Sprintf("https://api.wistx.ai/v1/indexing/resources/%s/compliance-analysis", resourceID)
params := url.Values{}
params.Add("standards", "PCI-DSS")
params.Add("standards", "HIPAA")
params.Add("refresh", "false")
fullURL := baseURL + "?" + params.Encode()
req, _ := http.NewRequest("GET", fullURL, nil)
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var analysis map[string]interface{}
json.NewDecoder(resp.Body).Decode(&analysis)
fmt.Printf("Compliance analysis for: %v\n", analysis["repository_url"])
}
require 'net/http'
require 'json'
require 'uri'
api_key = "YOUR_API_KEY"
resource_id = "res_abc123"
url = URI("https://api.wistx.ai/v1/indexing/resources/#{resource_id}/compliance-analysis")
params = {
standards: ["PCI-DSS", "HIPAA"],
refresh: false
}
url.query = URI.encode_www_form(params)
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer #{api_key}"
response = http.request(request)
analysis = JSON.parse(response.body)
puts "Compliance analysis for: #{analysis['repository_url']}"
<?php
$apiKey = "YOUR_API_KEY";
$resourceId = "res_abc123";
$url = "https://api.wistx.ai/v1/indexing/resources/" . $resourceId . "/compliance-analysis?" . http_build_query([
"standards" => ["PCI-DSS", "HIPAA"],
"refresh" => false
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);
$analysis = json_decode($response, true);
echo "Compliance analysis for: " . $analysis['repository_url'];
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
public class GetComplianceAnalysis {
public static void main(String[] args) throws Exception {
String apiKey = "YOUR_API_KEY";
String resourceId = "res_abc123";
URL url = new URL("https://api.wistx.ai/v1/indexing/resources/" + resourceId + "/compliance-analysis?standards=PCI-DSS&standards=HIPAA&refresh=false");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization", "Bearer " + apiKey);
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
Gson gson = new Gson();
JsonObject analysis = gson.fromJson(response.toString(), JsonObject.class);
System.out.println("Compliance analysis for: " + analysis.get("repository_url"));
}
}
Path Parameters
string
required
Resource ID of the indexed repository.
Query Parameters
array[string]
Filter by compliance standards (e.g.,
["PCI-DSS", "HIPAA", "SOC2"]).boolean
Force recalculation of compliance analysis.Default:
falseResponse
{
"resource_id": "res_abc123",
"repository_url": "https://github.com/owner/repo",
"environment_name": "production",
"compliance_analysis": {
"overall_score": 0.85,
"by_standard": {
"PCI-DSS": {
"score": 0.90,
"total_controls": 50,
"passed_controls": 45,
"failed_controls": 5
},
"HIPAA": {
"score": 0.80,
"total_controls": 30,
"passed_controls": 24,
"failed_controls": 6
}
},
"critical_issues": [
{
"control_id": "PCI-3.4",
"standard": "PCI-DSS",
"severity": "CRITICAL",
"description": "Encryption key management not properly configured"
}
],
"recommendations": [
{
"priority": "HIGH",
"action": "Enable encryption at rest for S3 buckets",
"impact": "Will improve PCI-DSS compliance score"
}
]
}
}
{
"detail": "User ID not found"
}
{
"detail": "Resource not found or access denied"
}
{
"detail": "Failed to get compliance analysis"
}
Related Endpoints
- Get Cost Analysis - Get cost analysis
- Get Resource Status - Check resource status
- Compliance Requirements - Get compliance requirements