palbaseDocs

Palbase Auth API · API

POST/auth/devices/attest/ios

Enrol an iOS device with App Attest

Verifies an Apple App Attest attestation object against a challenge from POST /auth/devices/challenge and stores the attested key as a verified device. No session is required: with a valid user token the device is enrolled under that user, otherwise under the installation anchor in X-Palbase-Installation-Anchor (the anchor the challenge was issued for). A caller with neither is refused with 401. The challenge is spent by this call. 400: the request cannot be evaluated (invalid_attestation_object, key_id_mismatch — key_id does not name the attested key, invalid_challenge — not issued for this anchor or already spent, invalid_installation_anchor). 403: the attestation was evaluated and refused, with the reason (cert_chain_invalid, nonce_invalid, rpid_hash_invalid, invalid_sign_count, invalid_aaguid). 409 app_attest_not_configured: no iOS app is configured for this project. 503: the challenge store (challenge_unavailable) or the rate limiter cannot be reached; retry after Retry-After. Rate limited per IP address.

Called by your app, with the publishable key.

Headers

X-Palbase-Installation-Anchorstring · optionalThe installation anchor (`ins_…`) this device enrols under when the caller is not signed in: exactly the `installation_anchor` this server issued (`ins_` and a UUID). Anything else answers 400 `invalid_installation_anchor`. Ignored when a valid session is present.

Request body

attestation_objectstring (byte) · requiredThe attestation object from DCAppAttestService, base64.
challengestring (byte) · requiredThe challenge from `POST /auth/devices/challenge`, base64, exactly as received.
device_namestring · optional
key_idstring · requiredThe App Attest key identifier.
curl
curl -X POST "https://<your-ref>.palbase.studio/auth/devices/attest/ios" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "content-type: application/json" \
  -d '{"attestation_object":"string","challenge":"string","key_id":"string"}'

Responses

200Device enrolled and verified

400Validation failed or required field missing

401Missing, invalid, or expired credentials

403Authenticated but not permitted (banned, hook denial, role mismatch)

409Conflict with current resource state (duplicate, race)

429Rate limit exceeded

503Downstream dependency unavailable (typically HIBP / breach service)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation AttestIOSDevice of auth's contract.