Rotate the on-chain authority to a registered replacement credential
curl --request POST \
--url https://api.pid.peridotvault.com/v1/wallet/rotate \
--header 'Content-Type: application/json' \
--cookie pid_access= \
--data '
{
"oldCredentialId": "<string>",
"newCredentialId": "<string>",
"nonce": "<string>",
"expiry": 123,
"assertion": {
"id": "<string>",
"signature": "<string>",
"authenticatorData": "<string>",
"clientDataJSON": "<string>"
}
}
'const options = {
method: 'POST',
headers: {cookie: 'pid_access=', 'Content-Type': 'application/json'},
body: JSON.stringify({
oldCredentialId: '<string>',
newCredentialId: '<string>',
nonce: '<string>',
expiry: 123,
assertion: {
id: '<string>',
signature: '<string>',
authenticatorData: '<string>',
clientDataJSON: '<string>'
}
})
};
fetch('https://api.pid.peridotvault.com/v1/wallet/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pid.peridotvault.com/v1/wallet/rotate"
payload = {
"oldCredentialId": "<string>",
"newCredentialId": "<string>",
"nonce": "<string>",
"expiry": 123,
"assertion": {
"id": "<string>",
"signature": "<string>",
"authenticatorData": "<string>",
"clientDataJSON": "<string>"
}
}
headers = {
"cookie": "pid_access=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pid.peridotvault.com/v1/wallet/rotate"
payload := strings.NewReader("{\n \"oldCredentialId\": \"<string>\",\n \"newCredentialId\": \"<string>\",\n \"nonce\": \"<string>\",\n \"expiry\": 123,\n \"assertion\": {\n \"id\": \"<string>\",\n \"signature\": \"<string>\",\n \"authenticatorData\": \"<string>\",\n \"clientDataJSON\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "pid_access=")
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))
}{
"signature": "<string>",
"status": "confirmed"
}{
"statusCode": 400,
"message": [
"handle must be 3-20 chars: lowercase letters, numbers, underscore"
]
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "No Identity found"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}wallet
Rotate the on-chain authority to a registered replacement credential
Credential-lifecycle rotation: register the replacement credential first (approval
flow), then the current key authorizes on-chain update_authority here. The old
credential is revoked in DB only after the chain confirms the new authority.
POST
/
wallet
/
rotate
Rotate the on-chain authority to a registered replacement credential
curl --request POST \
--url https://api.pid.peridotvault.com/v1/wallet/rotate \
--header 'Content-Type: application/json' \
--cookie pid_access= \
--data '
{
"oldCredentialId": "<string>",
"newCredentialId": "<string>",
"nonce": "<string>",
"expiry": 123,
"assertion": {
"id": "<string>",
"signature": "<string>",
"authenticatorData": "<string>",
"clientDataJSON": "<string>"
}
}
'const options = {
method: 'POST',
headers: {cookie: 'pid_access=', 'Content-Type': 'application/json'},
body: JSON.stringify({
oldCredentialId: '<string>',
newCredentialId: '<string>',
nonce: '<string>',
expiry: 123,
assertion: {
id: '<string>',
signature: '<string>',
authenticatorData: '<string>',
clientDataJSON: '<string>'
}
})
};
fetch('https://api.pid.peridotvault.com/v1/wallet/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pid.peridotvault.com/v1/wallet/rotate"
payload = {
"oldCredentialId": "<string>",
"newCredentialId": "<string>",
"nonce": "<string>",
"expiry": 123,
"assertion": {
"id": "<string>",
"signature": "<string>",
"authenticatorData": "<string>",
"clientDataJSON": "<string>"
}
}
headers = {
"cookie": "pid_access=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pid.peridotvault.com/v1/wallet/rotate"
payload := strings.NewReader("{\n \"oldCredentialId\": \"<string>\",\n \"newCredentialId\": \"<string>\",\n \"nonce\": \"<string>\",\n \"expiry\": 123,\n \"assertion\": {\n \"id\": \"<string>\",\n \"signature\": \"<string>\",\n \"authenticatorData\": \"<string>\",\n \"clientDataJSON\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "pid_access=")
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))
}{
"signature": "<string>",
"status": "confirmed"
}{
"statusCode": 400,
"message": [
"handle must be 3-20 chars: lowercase letters, numbers, underscore"
]
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "No Identity found"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Authorizations
JWT access token set by /auth/google/callback or /auth/refresh
Body
application/json
Credential ID of the current (signing) authority
Credential ID of the already-registered replacement authority
Chain nonce the current key signed against
Chain-time expiry (unix seconds, TTL ≤ 600s)
Show child attributes
Show child attributes