Description: Retrieves a list of available policy templates in the system.
Usage: GET https://{{artifactory-host}}/unifiedpolicy/api/v1/templates
Query Parameters:
Parameter | Type | Description |
|---|---|---|
| array[string] | Filter by template IDs |
| array[string] | Filter by template names |
| integer | Page offset (default: 0) |
| integer | Items per page (1-250, default: 100) |
| string | Sort field: |
| string | Sort direction: |
Sample Response:
{
"items": [
{
"id": "67890",
"name": "Security Vulnerability Template",
"description": "Template for creating security vulnerability policies",
"created_at": "2024-01-10T09:00:00Z",
"created_by": "system",
"updated_at": "2024-01-10T09:00:00Z",
"updated_by": "system",
"version": "1.0.0",
"category": "security",
"scanners": ["sca"],
"data_source_type": "xray",
"is_custom": false,
"rego": "package policy\\n\\ndefault allow = false\\n\\nallow {\\n input.parameters.severity_threshold == \"critical\"\\n count(input.vulnerabilities) <= input.parameters.max_vulnerabilities\\n}",
"parameters": [
{
"name": "severity_threshold",
"type": "string"
},
{
"name": "max_vulnerabilities",
"type": "int"
}
]
}
],
"offset": 0,
"limit": 100,
"page_size": 1,
"total_count": 1
}Code Status
Code | Status |
|---|---|
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
500 | Internal Server Error |