palbaseDocs

Palbase Auth API · API

POST/auth/devices/bind

Bind a public key to a device

Stores the signing key of one of the signed-in user's devices — once. The device must be verified and have no key yet. A device that already has a key — every device enrolled with App Attest or Android Key Attestation: enrolment establishes its key — answers 409 device_key_bound; to use a new key, enrol a new device and delete the old one. A device that is not verified answers 400 device_not_verified. public_key must be a DER SubjectPublicKeyInfo holding an ECDSA key, or the call answers 400 invalid_public_key.

Called by a signed-in user of your app, with their token and the publishable key.

Request body

device_idstring · requiredDevice ID (`dev_…`).
public_keystring (byte) · requiredECDSA public key, DER-encoded SubjectPublicKeyInfo, base64.
curl
curl -X POST "https://<your-ref>.palbase.studio/auth/devices/bind" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"device_id":"string","public_key":"string"}'

Responses

200Key bound

400Validation failed or required field missing

401Missing, invalid, or expired credentials

404Resource does not exist or is not visible to the caller

409Conflict with current resource state (duplicate, race)

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

Operation BindDeviceKey of auth's contract.