Description: Create a new custom condition.
Since: 3.116.x
Security: Requires a valid user with the "MANAGE_POLICIES" permission.
Usage: POST /xray/api/v1/curation/conditions
Consumes: application/json
Produces: application/json
Path Parameters: None
Query Parameters: None
Request Body
Name | Type | Description |
|---|---|---|
| string | One of the IDs of the supported condition templates returned by the list condition templates API. |
| string | The name of the condition |
| Array[ParamWithValue] | Array of parameter values. |
ParamWithValue
Name | Type | Description |
|---|---|---|
| string | A |
| Various. See explanation in the section about List Curation Condition Templates” API. | A value that is allowed for the |
Response Body
Name | Type | Description |
|---|---|---|
| string | The ID of the condition, used as path parameter when updating or deleting the condition and when referring to it in a policy. |
| string | One of the IDs of the supported condition templates returned by the list condition templates api |
| string | The name of the condition |
| Boolean | false for built-in immutable conditions, true for mutable user created custom conditions |
| string | Timestamp when the condition was created |
| Timestamp when the condition was updated | |
| One of: | |
| One of: " | |
| Array[ParamWithValue] | Array of parameter values. |
Sample Request
POST /xray/api/v1/curation/conditions
Authorization: …
Content-Type: application/json
{
"name": "a vuln",
"condition_template_id": "CVEName",
"param_values": [
{"param_id": "cve_name", "value": "CVE-2021-45105"}
]
}
Sample Response
{
"id": "29",
"is_custom": true,
"created_by": "admin",
"created_at": "2025-03-12T13:16:29+02:00",
"updated_by": "admin",
"updated_at": "2025-03-12T13:16:29+02:00",
"risk_type": "security",
"supported_pkg_types": ["Gradle", "Maven"],
"condition_template_id": "CVEName",
"name": "a vuln",
"param_values": [
{
"param_id": "cve_name",
"value": "CVE-2021-45105"
}
]
}
Response Codes
Status | Description |
|---|---|
201 | Created |
400 | Bad request |