Skip to content

Commit f6f0f8d

Browse files
committed
add REST API section
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 866f118 commit f6f0f8d

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

docs/reference-policy-rules.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,25 @@ Two events are available:
243243
.. seealso::
244244
:ref:`integrations_webhook` for instructions on configuring webhook endpoints and
245245
event subscriptions.
246+
247+
7. REST API
248+
-----------
249+
250+
Active policy violations for a product are accessible via the REST API at::
251+
252+
GET /api/v2/products/{uuid}/policy_violations/
253+
254+
The response is a list of active (unresolved) violations, each including:
255+
256+
- ``rule_type``: the rule identifier (e.g., ``vulnerability_detected``).
257+
- ``rule_label``: the human-readable rule name.
258+
- ``rule_description``: a short description of what the rule detects.
259+
- ``rule_severity``: ``"error"`` or ``"warning"``.
260+
- ``violation_count``: the number of packages currently in violation.
261+
- ``detected_date``: when the violation was first recorded.
262+
263+
Only active (unresolved) violations are returned by this endpoint.
264+
265+
.. seealso::
266+
Refer to the **API documentation** from the :guilabel:`Tools` menu for detailed
267+
guidance on authentication and available endpoints.

0 commit comments

Comments
 (0)