Update a vulnerability
Updates a finding's assignee, report link or custom fields. These are the only fields you can change through the API. You can't change status, severity, title, affected resources or source, and you can close a finding only in the Scrut app.
Send only the fields you want to change; fields you leave out stay as they are. assigneeEmail must belong to a user in your Scrut organization.
The response doesn't include affectedResources, tickets or mappedRisks. To get them, call GET /v1/vulnerabilities/{vulnerabilityId} with the fields parameter.
Scrut drops any other fields in the body without returning an error. If the body contains only unsupported fields, the request returns 400 with the message "value" must have at least 1 key.
curl -X PATCH "https://api.scrut.io/v1/vulnerabilities/import%23CVE-2024-1234" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-d '{
"assigneeEmail": "admin@example.com",
"reportLink": "https://example.com/report",
"customFields": [
{
"customFieldId": "e760f5cb-3de6-49b4-a0c9-425076e033a1",
"fieldValue": "production"
},
{
"customFieldId": "3f1a2b4c-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"fieldValue": {
"id": "8d7c6b5a-4e3f-4210-9a8b-7c6d5e4f3a2b",
"value": "no"
}
}
]
}'
import requests
import json
url = "https://api.scrut.io/v1/vulnerabilities/import%23CVE-2024-1234"
headers = {
"Content-Type": "application/json",
"Idempotency-Key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
}
data = {
"assigneeEmail": "admin@example.com",
"reportLink": "https://example.com/report",
"customFields": [
{
"customFieldId": "e760f5cb-3de6-49b4-a0c9-425076e033a1",
"fieldValue": "production"
},
{
"customFieldId": "3f1a2b4c-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"fieldValue": {
"id": "8d7c6b5a-4e3f-4210-9a8b-7c6d5e4f3a2b",
"value": "no"
}
}
]
}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.scrut.io/v1/vulnerabilities/import%23CVE-2024-1234", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
},
body: JSON.stringify({
"assigneeEmail": "admin@example.com",
"reportLink": "https://example.com/report",
"customFields": [
{
"customFieldId": "e760f5cb-3de6-49b4-a0c9-425076e033a1",
"fieldValue": "production"
},
{
"customFieldId": "3f1a2b4c-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"fieldValue": {
"id": "8d7c6b5a-4e3f-4210-9a8b-7c6d5e4f3a2b",
"value": "no"
}
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"assigneeEmail": "admin@example.com",
"reportLink": "https://example.com/report",
"customFields": [
{
"customFieldId": "e760f5cb-3de6-49b4-a0c9-425076e033a1",
"fieldValue": "production"
},
{
"customFieldId": "3f1a2b4c-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"fieldValue": {
"id": "8d7c6b5a-4e3f-4210-9a8b-7c6d5e4f3a2b",
"value": "no"
}
}
]
}`)
req, err := http.NewRequest("PATCH", "https://api.scrut.io/v1/vulnerabilities/import%23CVE-2024-1234", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "7c9e6679-7425-40de-944b-e07fc1f90ae7")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.scrut.io/v1/vulnerabilities/import%23CVE-2024-1234')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Content-Type'] = 'application/json'
request['Idempotency-Key'] = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (JWT)'
request.body = '{
"assigneeEmail": "admin@example.com",
"reportLink": "https://example.com/report",
"customFields": [
{
"customFieldId": "e760f5cb-3de6-49b4-a0c9-425076e033a1",
"fieldValue": "production"
},
{
"customFieldId": "3f1a2b4c-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"fieldValue": {
"id": "8d7c6b5a-4e3f-4210-9a8b-7c6d5e4f3a2b",
"value": "no"
}
}
]
}'
response = http.request(request)
puts response.body
{
"data": {
"vulnerabilityId": "import%23CVE-2024-1234",
"title": "public s3 bucket",
"description": "Bucket is world-readable.",
"status": "open",
"severity": "high",
"source": "import",
"assignees": [
{
"name": "Alex Rivera",
"email": "admin@example.com",
"isPrimary": true
}
],
"firstSeen": 1704067200000,
"cveId": "cve-2024-1234",
"reportLink": "https://example.com/report",
"remediation": "Block public ACLs.",
"stepsToReproduce": "Open the bucket URL.",
"customFields": [
{
"customFieldId": "e760f5cb-3de6-49b4-a0c9-425076e033a1",
"title": "Environment",
"fieldType": "text_box",
"options": [],
"fieldValue": "production"
},
{
"customFieldId": "3f1a2b4c-5d6e-4f70-8a9b-0c1d2e3f4a5b",
"title": "Fix verified",
"fieldType": "single_select",
"options": [
{
"id": "8d7c6b5a-4e3f-4210-9a8b-7c6d5e4f3a2b",
"value": "no"
}
],
"fieldValue": [
{
"id": "8d7c6b5a-4e3f-4210-9a8b-7c6d5e4f3a2b",
"value": "no"
}
]
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "validation_failed",
"message": "Request validation failed.",
"details": [
{
"field": "assigneeEmail",
"message": ""assigneeEmail" must be a valid email"
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "validation_failed",
"message": "Request validation failed.",
"details": [
{
"field": "reportLink",
"message": ""reportLink" must be a valid uri with a scheme matching the http|https pattern"
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "validation_failed",
"message": "Request validation failed.",
"details": [
{
"message": ""value" must have at least 1 key"
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "unauthorized",
"message": "Missing, malformed, or invalid Bearer token.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "token_revoked",
"message": "The API credential was revoked.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "token_stale",
"message": "The access token is stale; obtain a new token.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "forbidden",
"message": "Insufficient scope.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "idempotency_key_reused",
"message": "Idempotency key was reused with a different request body.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "idempotency_request_in_progress",
"message": "A request with this idempotency key is already being processed.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded.",
"details": [
{
"retryAfterSec": 12
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "upstream_unavailable",
"message": "Upstream service is unavailable.",
"details": [
{
"dependency": "frameworks",
"issue": "Failed to process frameworks."
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
/v1/vulnerabilities/{vulnerabilityId}Target server for requests. Edit to use your own host.
Machine access token from POST /oauth/token. Send Authorization: Bearer $SCRUT_ACCESS_TOKEN on every /v1 request.
POST /oauth/token. Send Authorization: Bearer $SCRUT_ACCESS_TOKEN on every /v1 request.Use the vulnerabilityId returned by list or get. It is already URL-encoded, so paste it as the path segment: /v1/vulnerabilities/{vulnerabilityId}. Findings created through the API use the api%23 prefix, for example api%23VUL-5672. Findings imported from CSV use import%23, for example import%23CVE-2024-1234.
The media type of the request body
Client-generated key identifying one logical write. 1–128 characters; letters, numbers, and . _ ~ - only. Reuse the same key and body to retry safely. Reusing a key with a different body returns 409 idempotency_key_reused. Successful 2xx responses are replayed for 24 hours.
Must be a valid email address. An invalid one returns 400.
An HTTP or HTTPS URL. Any other value returns 400. Send an empty string to clear the link.
Custom field values to set. For each item, send customFieldId and fieldValue. Send fieldValue as a string for a text field. For a select field, send one option as { id, value } or several options as [{ id, value }]. The response always returns select values as an array, even when you send a single option.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token (JWT). Machine access token from POST /oauth/token. Send Authorization: Bearer $SCRUT_ACCESS_TOKEN on every /v1 request.
Path Parameters
Use the vulnerabilityId returned by list or get. It is already URL-encoded, so paste it as the path segment: /v1/vulnerabilities/{vulnerabilityId}. Findings created through the API use the api%23 prefix, for example api%23VUL-5672. Findings imported from CSV use import%23, for example import%23CVE-2024-1234.
import%23CVE-2024-1234Headers
Client-generated key identifying one logical write. 1–128 characters; letters, numbers, and . _ ~ - only. Reuse the same key and body to retry safely. Reusing a key with a different body returns 409 idempotency_key_reused. Successful 2xx responses are replayed for 24 hours.
7c9e6679-7425-40de-944b-e07fc1f90ae7Body
Must be a valid email address. An invalid one returns 400.
admin@example.comAn HTTP or HTTPS URL. Any other value returns 400. Send an empty string to clear the link.
https://example.com/reportCustom field values to set. For each item, send customFieldId and fieldValue. Send fieldValue as a string for a text field. For a select field, send one option as { id, value } or several options as [{ id, value }]. The response always returns select values as an array, even when you send a single option.