End a session
curl --request DELETE \
--url https://app.trustivan.com/api/v1/agents/{id}/sessions/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}/sessions/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/agents/{id}/sessions/{sessionId}', 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/agents/{id}/sessions/{sessionId}"
req, _ := http.NewRequest("DELETE", 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"
}End a session
Stops a run of work. Available to the agent itself (finishing its own
task) and to any human holding workloads:manage, for the reason
revocation is not limited to the delegator: during an incident the
person who can stop an agent is whoever is awake.
Ending a session does not revoke the credential. The agent can still act outside the session; what stops is this run.
Idempotent: the first reason recorded is the one kept.
DELETE
/
agents
/
{id}
/
sessions
/
{sessionId}
End a session
curl --request DELETE \
--url https://app.trustivan.com/api/v1/agents/{id}/sessions/{sessionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/agents/{id}/sessions/{sessionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/agents/{id}/sessions/{sessionId}', 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/agents/{id}/sessions/{sessionId}"
req, _ := http.NewRequest("DELETE", 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 ended session.