GET /v1/organizations/{org_id}/projects/{id}/stack
La stack est la liste des vendors et produits surveillés pour un projet. Chaque item définit également un seuil de sévérité minimum à partir duquel une alerte CVE est déclenchée.
GET /api/v1/organizations/{org_id}/projects/{project_id}/stackAuthorization: Bearer twa_votre_cle_iciParamètres de chemin
Section intitulée « Paramètres de chemin »| Paramètre | Type | Description |
|---|---|---|
org_id |
UUID |
Identifiant de l’organisation |
project_id |
UUID |
Identifiant du projet |
Réponse 200 OK
Section intitulée « Réponse 200 OK »Retourne un tableau (un projet peut avoir plusieurs stacks, généralement une seule).
[ { "id": "018e5555-0000-7000-8000-000000000020", "name": "Stack", "project_id": "018e1234-abcd-7000-8000-000000000010", "items": [ { "id": "018e5555-0000-7000-8000-000000000021", "item_type": "vendor", "value": "apache", "min_severity": "HIGH", "tags": [] }, { "id": "018e5555-0000-7000-8000-000000000022", "item_type": "product", "value": "nginx", "min_severity": "CRITICAL", "tags": [ { "id": "018ec0de-0000-7000-8000-0000000000a1", "name": "production", "color": "#ef4444" } ] }, { "id": "018e5555-0000-7000-8000-000000000023", "item_type": "product", "value": "log4j", "min_severity": "MEDIUM", "tags": [] } ] }]Champs — Stack
Section intitulée « Champs — Stack »| Champ | Type | Description |
|---|---|---|
id |
string (UUID) |
Identifiant de la stack |
name |
string |
Nom de la stack (généralement "Stack") |
project_id |
string (UUID) | null |
Projet associé |
items |
array |
Items de surveillance |
Champs — Item
Section intitulée « Champs — Item »| Champ | Type | Description |
|---|---|---|
id |
string (UUID) |
Identifiant de l’item |
item_type |
"vendor" | "product" |
Type de surveillance |
value |
string |
Valeur surveillée (nom du vendor ou du produit, en minuscules) |
min_severity |
string | null |
CRITICAL, HIGH, MEDIUM, LOW ou NONE (toute CVE). null : l’élément hérite de la politique de priorisation du projet |
tags |
array<Tag> |
Tags assignés à cet item de stack. Chaque tag : { id, name, color } (couleur #rrggbb). Tableau vide si aucun. |
Types d’items
Section intitulée « Types d’items »item_type |
Comportement |
|---|---|
vendor |
Toutes les CVE affectant n’importe quel produit de cet éditeur |
product |
CVE affectant spécifiquement ce produit, tous éditeurs confondus |
| Code | Détail | Cause |
|---|---|---|
404 |
Projet introuvable |
Projet inexistant, d’une autre organisation, ou hors de la restriction de projets de la clé |
403 |
Cette clé API n'a pas le droit d'accéder à cette ressource. |
Le scope stack manque à la clé |
Lister tous les produits surveillés sur un projet
curl -s \ -H "Authorization: Bearer twa_votre_cle_ici" \ "https://app.techwatchalert.com/api/v1/organizations/018e5678-abcd-7000-8000-000000000001/projects/018e1234-abcd-7000-8000-000000000010/stack" \ | jq '.[0].items[] | select(.item_type == "product") | .value'Vérifier si un produit est surveillé
import httpx
BASE_URL = "https://app.techwatchalert.com/api/v1"headers = {"Authorization": "Bearer twa_votre_cle_ici"}org_id = "018e5678-abcd-7000-8000-000000000001"project_id = "018e1234-abcd-7000-8000-000000000010"
stacks = httpx.get(f"{BASE_URL}/organizations/{org_id}/projects/{project_id}/stack", headers=headers).json()
watched = { item["value"] for stack in stacks for item in stack["items"]}
print("nginx surveillé :", "nginx" in watched)