Apply one lifecycle action to many findings
curl --request POST \
--url https://app.trustivan.com/api/v1/findings/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"finding_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"reason": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/findings/bulk"
payload = {
"finding_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"reason": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
finding_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
reason: '<string>',
expires_at: '2023-11-07T05:31:56Z',
idempotency_key: '<string>'
})
};
fetch('https://app.trustivan.com/api/v1/findings/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/findings/bulk"
payload := strings.NewReader("{\n \"finding_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"reason\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"requested": 123,
"applied": 123,
"already_applied": 123,
"rejected": 123,
"results": [
{
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "applied",
"reason": "<string>"
}
]
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Apply one lifecycle action to many findings
Always 200 when the request itself was valid, including when some
items were rejected. A caller branches on the counts in the body, not
on the status line. 207 is a WebDAV code most clients treat as an
error.
Validation happens entirely before any write, so the result is deterministic: the same request produces the same per-item outcomes whether or not it is retried.
Per-item outcomes are applied, already_applied, not_found,
invalid_transition or conflict. A finding belonging to another
tenant returns not_found, identical to one that does not exist,
because distinguishing them would be a fast way to enumerate which
UUIDs are real.
POST
/
findings
/
bulk
Apply one lifecycle action to many findings
curl --request POST \
--url https://app.trustivan.com/api/v1/findings/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"finding_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"reason": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/findings/bulk"
payload = {
"finding_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"reason": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
finding_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
reason: '<string>',
expires_at: '2023-11-07T05:31:56Z',
idempotency_key: '<string>'
})
};
fetch('https://app.trustivan.com/api/v1/findings/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/findings/bulk"
payload := strings.NewReader("{\n \"finding_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"reason\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"idempotency_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "<string>",
"requested": 123,
"applied": 123,
"already_applied": 123,
"rejected": 123,
"results": [
{
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "applied",
"reason": "<string>"
}
]
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Headers
Body
application/json