curl --request POST \
--url https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Start collecting an account's posture now
Starts a collection in the background and answers 202 with the account,
collecting: true, at once. A run can take five minutes, which is longer
than a request stays open. Read GET /cloud/accounts or
GET /cloud/accounts/{id} until collecting is false: the run has then
ended, and status and status_reason say how (active, degraded for
a partial run, failed). Starting one while another runs answers the same
way and starts nothing.
If the service restarts during the run, the run is lost. Within about 90
seconds collecting goes false with status: failed and a status_reason
saying so, and it can be started again.
A collection enumerates the account, evaluates the posture corpus, and reconciles the result through the same finding lifecycle a scan uses, so triage, suppression, SLA and policy work on cloud findings without any of them knowing a cloud exists.
An account that has not yet collected successfully (a new role connection, or one whose last run failed) is VALIDATED first. For a role that means two calls to STS: one WITHOUT the external ID, which must be refused (a role assumable without it can be assumed by any tenant who learns its ARN, so the run fails with that reason), and one with it. Every collection then confirms which account the credential reaches before reading anything, because the stored credential can be rotated.
A partial run RESOLVES NOTHING: a role that lost permission to read one service must never become an automatic all-clear for every finding in it. The posture endpoint says which regions were actually read, because a clean result from one region is not a clean account.
Behind scans:create.
curl --request POST \
--url https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/cloud/accounts/{id}/collect"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
The collection is running; the body is the account.