curl --request POST \
--url https://app.trustivan.com/api/v1/workloads/{id}/rotate \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/workloads/{id}/rotate"
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/workloads/{id}/rotate', 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/workloads/{id}/rotate"
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"
}Rotate a workload's credential
Replaces the secret without replacing the workload. The id, scopes, kind, delegator and expiry are all unchanged, because rotation replaces a secret and never re-points authority, which is what delegation is for and has its own audit action.
Why in place: an agent’s declared tool inventory, its sessions and its recorded actions all hang off the workload’s id. Revoking and re-delegating mints a new id and discards every one of them, so an operator responding to a leaked credential would be asked to tear down the agent’s configuration as the price of rotating it.
The previous secret keeps working for a short overlap (five minutes, clamped so it can never outlive the credential’s own expiry), so requests already in flight finish against the secret they started with. A revoked or expired workload cannot be rotated: that would resurrect a credential the kill switch or the expiry sweep had already retired.
Human callers only, exactly as delegation is. A workload that could rotate its own credential could outrun the expiry that bounds it without any human reconfirming the delegation.
Not gated on any entitlement: a customer whose plan lapsed must still be able to replace a leaked secret.
curl --request POST \
--url https://app.trustivan.com/api/v1/workloads/{id}/rotate \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/workloads/{id}/rotate"
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/workloads/{id}/rotate', 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/workloads/{id}/rotate"
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 workload, and its new credential (shown once).