Approve one irreversible action by an agent
curl --request POST \
--url https://app.trustivan.com/api/v1/agents/{id}/approvals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"code": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}/approvals"
payload = {
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"code": "<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({
tool: '<string>',
resource_type: '<string>',
resource_id: '<string>',
code: '<string>'
})
};
fetch('https://app.trustivan.com/api/v1/agents/{id}/approvals', 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/agents/{id}/approvals"
payload := strings.NewReader("{\n \"tool\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"code\": \"<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))
}{
"token": "<string>",
"approval": {}
}{
"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"
}Approve one irreversible action by an agent
A human approves exactly one action (this agent, this declared tool,
this resource) and receives a token for the agent to present as
approval_token at POST /agents/{id}/actions. The token is returned
once, is single-use and expires after five minutes; only its SHA-256
is stored.
Human-only and behind workloads:manage, which no machine can hold,
so an agent can neither approve itself nor a peer. An approver with a
confirmed second factor must send a current TOTP code, which is
consumed. Recorded on the identity trail as agent.action.approved.
POST
/
agents
/
{id}
/
approvals
Approve one irreversible action by an agent
curl --request POST \
--url https://app.trustivan.com/api/v1/agents/{id}/approvals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"code": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}/approvals"
payload = {
"tool": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"code": "<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({
tool: '<string>',
resource_type: '<string>',
resource_id: '<string>',
code: '<string>'
})
};
fetch('https://app.trustivan.com/api/v1/agents/{id}/approvals', 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/agents/{id}/approvals"
payload := strings.NewReader("{\n \"tool\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"code\": \"<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))
}{
"token": "<string>",
"approval": {}
}{
"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
Body
application/json