Generate or rotate an app's backend secret
curl --request POST \
--url https://api.pid.peridotvault.com/v1/apps/{id}/secret \
--cookie pid_access=const options = {method: 'POST', headers: {cookie: 'pid_access='}};
fetch('https://api.pid.peridotvault.com/v1/apps/{id}/secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pid.peridotvault.com/v1/apps/{id}/secret"
headers = {"cookie": "pid_access="}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pid.peridotvault.com/v1/apps/{id}/secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("cookie", "pid_access=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"secret": "pidsk_9f2c…",
"prefix": "pidsk_9f2c41"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "No Identity found"
}apps
Generate or rotate an app's backend secret
Returns a pidsk_… secret once — only its SHA-256 hash is stored, so an
existing secret can never be read back, only replaced. Afterwards, code
exchange for this app requires the secret. Backend-only: never ship it in
frontend code. Owners only.
POST
/
apps
/
{id}
/
secret
Generate or rotate an app's backend secret
curl --request POST \
--url https://api.pid.peridotvault.com/v1/apps/{id}/secret \
--cookie pid_access=const options = {method: 'POST', headers: {cookie: 'pid_access='}};
fetch('https://api.pid.peridotvault.com/v1/apps/{id}/secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pid.peridotvault.com/v1/apps/{id}/secret"
headers = {"cookie": "pid_access="}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pid.peridotvault.com/v1/apps/{id}/secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("cookie", "pid_access=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"secret": "pidsk_9f2c…",
"prefix": "pidsk_9f2c41"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "No Identity found"
}