Palbase Auth API · API
/admin/users/importImport users
Brings users over from another system with what they sign in with, so they notice nothing: each keeps its id, its address and phone, its password (the source's hash, verified with the source's pepper until the user's next sign-in hashes it again with this platform's), its linked providers, second factors and recovery codes, its passkeys and its open sessions (the refresh token the user's app holds goes on working at POST /auth/token/refresh). Up to 1000 users per call, and the body is at most 1 MiB: split a larger export into calls that fit both. Each user is written whole or not at all, and one user's failure does not stop the others: the answer counts the users written and lists, by index, every one that was not, with why. A user whose id, email, phone, provider identity, passkey or session the project already has is refused (user_exists, email_exists, ...), never overwritten — sending a batch again writes only what the first call did not. A session that has ended (expired, timed out) or belongs to a banned user is not brought back (sessions_skipped). The hash block's pepper is kept sealed, used only to verify, and never returned, logged or audited. A batch the call cannot take at all — no users or more than 1000, hashes without the hash block, another algorithm than palbase-argon2id (unsupported_hash_algorithm) — is a 400 and writes nothing.
Called by your server, with the project's secret key.
Headers
Idempotency-Keystring · optionalMakes the creation safe to send again. A retry with the same key and the same request gets the first answer back (marked Idempotent-Replayed: true) instead of creating twice; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.Request body
hashobject · optionalHow the batch's password and recovery-code hashes were made. Required when a user carries password_hash or recovery_code_hashes.usersobject[] · requiredcurl -X POST "https://<your-ref>.palbase.studio/admin/users/import" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"users":[{"id":"string"}]}'Responses
200What the call wrote, and why each user it did not write was not
400Validation failed or required field missing
401Missing, invalid, or expired credentials
403Not permitted with this key; or the project is the platform's own (`owner_only`): every change on its admin surface — any account's address, password, factors, sessions or roles, an account made or imported, a sign-in minted, a setting — is its owner's or its operator's alone. The request carries, besides the project's key, the owner's access token (X-Palbase-Owner; a passkey sign-in of the last 15 minutes, else 401 `insufficient_user_authentication`) or the operator's token (X-Palbase-Operator). Its key reads.
413The body is over 1 MiB (request_too_large)
422The Idempotency-Key was already used with a different request (idempotency_key_reused)
503Downstream dependency unavailable (typically HIBP / breach service)
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation AdminImportUsers of auth's contract.