curl --request POST \
--url https://app.trustivan.com/api/v1/notification-targets/{id}/rotate-secret \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"secret": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/notification-targets/{id}/rotate-secret"
payload = { "secret": "<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({secret: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/notification-targets/{id}/rotate-secret', 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/notification-targets/{id}/rotate-secret"
payload := strings.NewReader("{\n \"secret\": \"<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))
}{
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"channel": "<string>",
"configured": true,
"events": [
"<string>"
],
"only_blocking": true,
"enabled": true,
"consecutive_failures": 123,
"created_at": "2023-11-07T05:31:56Z",
"config": {},
"min_severity": "critical",
"disabled_at": "2023-11-07T05:31:56Z",
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"secret_rotated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z"
}
}Replace a destination's credential
No overlap window, unlike webhook secret rotation: this secret is the customer’s own, so the moment they supply a new one the old one is either revoked or irrelevant, and keeping a copy of a retired credential is a liability.
Deliberately NOT gated on the plan. A customer whose token has leaked must be able to replace it immediately, whatever their billing state.
curl --request POST \
--url https://app.trustivan.com/api/v1/notification-targets/{id}/rotate-secret \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"secret": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/notification-targets/{id}/rotate-secret"
payload = { "secret": "<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({secret: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/notification-targets/{id}/rotate-secret', 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/notification-targets/{id}/rotate-secret"
payload := strings.NewReader("{\n \"secret\": \"<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))
}{
"target": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"channel": "<string>",
"configured": true,
"events": [
"<string>"
],
"only_blocking": true,
"enabled": true,
"consecutive_failures": 123,
"created_at": "2023-11-07T05:31:56Z",
"config": {},
"min_severity": "critical",
"disabled_at": "2023-11-07T05:31:56Z",
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"secret_rotated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Response
Rotated. The response does not carry the secret.
One outbound notification destination. The stored secret is not
here and has no read path at all, in any response: it is the customer's
own credential and TRUSTIVAN has no business showing it back. url is
absent for the same reason (for Slack and Teams the destination URL IS
the credential), and configured reports only whether a secret is set.
Show child attributes
Show child attributes