Register a passkey
curl --request POST \
--url https://app.trustivan.com/api/v1/auth/passkeys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"credential": {},
"name": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/auth/passkeys"
payload = {
"token": "<string>",
"credential": {},
"name": "<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({token: '<string>', credential: {}, name: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/auth/passkeys', 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/auth/passkeys"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"credential\": {},\n \"name\": \"<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))
}{
"passkey": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"backup_eligible": true,
"synced": true,
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
},
"recovery_codes": [
"<string>"
]
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Register a passkey
Finishes the ceremony begun at /auth/passkeys/options. The first
passkey of an account with no recovery codes issues them, once. A
passkey makes a password alone insufficient to sign in, and satisfies
an organization’s MFA policy.
POST
/
auth
/
passkeys
Register a passkey
curl --request POST \
--url https://app.trustivan.com/api/v1/auth/passkeys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"credential": {},
"name": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/auth/passkeys"
payload = {
"token": "<string>",
"credential": {},
"name": "<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({token: '<string>', credential: {}, name: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/auth/passkeys', 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/auth/passkeys"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"credential\": {},\n \"name\": \"<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))
}{
"passkey": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"backup_eligible": true,
"synced": true,
"created_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
},
"recovery_codes": [
"<string>"
]
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
application/json