Mint a pid_code for the current session
curl --request POST \
--url https://api.pid.peridotvault.com/v1/auth/authorize \
--header 'Content-Type: application/json' \
--cookie pid_access= \
--data '
{
"returnTo": "<string>",
"clientId": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'pid_access=', 'Content-Type': 'application/json'},
body: JSON.stringify({returnTo: '<string>', clientId: '<string>'})
};
fetch('https://api.pid.peridotvault.com/v1/auth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pid.peridotvault.com/v1/auth/authorize"
payload = {
"returnTo": "<string>",
"clientId": "<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/auth/authorize"
payload := strings.NewReader("{\n \"returnTo\": \"<string>\",\n \"clientId\": \"<string>\"\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))
}{
"pidCode": "<string>"
}{
"statusCode": 400,
"message": [
"handle must be 3-20 chars: lowercase letters, numbers, underscore"
]
}{
"statusCode": 401,
"message": "Unauthorized"
}auth
Mint a pid_code for the current session
Issues a one-time pid_code for the caller’s existing session — no re-authentication. Powers consent screens on PeridotID-hosted pages: the user approves, the page redirects itself to returnTo with the code. Cookie-authenticated (same-site pages only). returnTo follows the same rules as login (loopback, registered app origins, global allowlist).
POST
/
auth
/
authorize
Mint a pid_code for the current session
curl --request POST \
--url https://api.pid.peridotvault.com/v1/auth/authorize \
--header 'Content-Type: application/json' \
--cookie pid_access= \
--data '
{
"returnTo": "<string>",
"clientId": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'pid_access=', 'Content-Type': 'application/json'},
body: JSON.stringify({returnTo: '<string>', clientId: '<string>'})
};
fetch('https://api.pid.peridotvault.com/v1/auth/authorize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pid.peridotvault.com/v1/auth/authorize"
payload = {
"returnTo": "<string>",
"clientId": "<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/auth/authorize"
payload := strings.NewReader("{\n \"returnTo\": \"<string>\",\n \"clientId\": \"<string>\"\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))
}{
"pidCode": "<string>"
}{
"statusCode": 400,
"message": [
"handle must be 3-20 chars: lowercase letters, numbers, underscore"
]
}{
"statusCode": 401,
"message": "Unauthorized"
}