SDK reference
Sign-in approvals
GET/
Sign-in approvals for your account: on, pausedUntil (epoch ms, while requests are paused after denials), the phones that approve (devices: name, model, system, where the key lives, when added and last used; never keys) and twoStep (whether the account has a code to fall back to; requests need one). From the Authenticator app's sign-in only.
curl 'https://api.cactive.com.au/v1/me/sign-in-approvals/settings' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
Sign-in requests waiting for an answer, newest first: what's signing in (app), from which browser (device), roughly where (place), createdAt and expiresAt. No numbers. What the app shows when it opens, for a notification that never arrived.
curl 'https://api.cactive.com.au/v1/me/sign-in-approvals/requests' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
One waiting request with the three numbers to show (choices), the account (userId, email) and the binding the answer is signed with; 404 once answered, withdrawn or expired.
curl 'https://api.cactive.com.au/v1/me/sign-in-approvals/requests/{approvalId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Answers a request from this phone (deviceId): decision approve with the number tapped, or deny, with signature (see above). The right number approves; another number or deny denies (reason wrong_number or not_me, and paused when requests are now paused for an hour). 403 when the signature doesn't verify or the phone was removed, 409 when already answered or expired, 429 past 20 answers in 15 minutes.
curl -X POST 'https://api.cactive.com.au/v1/me/sign-in-approvals/requests/{approvalId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"deviceId": "<deviceId>",
"decision": "approve",
"signature": "example"
}'POST/
Enrols this phone's key: publicKey, keyStorage (secure-enclave, keychain or keystore), name, optional model, os, appVersion, installId, timeZone, with signedAt and the key's signature over the enrolment message. 201 with the device (200 for a key already enrolled); the same phone's older key is replaced; up to 10 phones. 403 with code: "reauth" until the app's sign-in is recent and two-step or a passkey. Turns approvals on.
curl -X POST 'https://api.cactive.com.au/v1/me/sign-in-approvals/devices' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"publicKey": "example",
"keyStorage": "secure-enclave",
"name": "Example",
"signedAt": 1,
"signature": "example"
}'DELETE/
Removes a phone: it gets no more requests and its answers are refused.
Parameters and answerscurl -X DELETE 'https://api.cactive.com.au/v1/me/sign-in-approvals/devices/{deviceId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Signs your account out everywhere but this app, after this phone answered a request with No (approvalId, within 30 minutes): every browser session at ID with the web apps' sign-ins from them, every other phone app and every command-line sign-in. Signed with the phone's key (deviceId, signedAt, signature). Returns how many browsers, apps and commandLine sign-ins ended.
curl -X POST 'https://api.cactive.com.au/v1/me/sign-in-approvals/secure' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"deviceId": "<deviceId>",
"approvalId": "<approvalId>",
"signedAt": 1,
"signature": "example"
}'