Palbase Auth API · API
/admin/hooksRegister a blocking hook
Registers an endpoint auth calls, and waits for, before the event's operation (a signup, a login, a token). Every call and answer is signed with the hook's own secret (Standard Webhooks), which is returned once, in this response. The create is recorded with its answer: a retry with the same Idempotency-Key gets the same hook and secret back, never a second hook.
Called by your server, with the project's secret key.
Headers
Idempotency-Keystring · optionalMakes the create safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, instead of a second resource; 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.Request body
enabledboolean · optionalAbsent: true.eventstring · requiredfailure_mode"deny" | "allow" · optionalAbsent: deny.timeout_msinteger · optional100–5000; absent or 0: 5000.urlstring · requiredhttps URL that does not resolve to a private address (http only in development or for an allow-listed host).curl -X POST "https://<your-ref>.palbase.studio/admin/hooks" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"event":"before.user.create","url":"string"}'Responses
201The hook, with its secret
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.
409Conflict with current resource state (duplicate, race)
413A request carrying an Idempotency-Key is larger than 1 MiB
422The Idempotency-Key was already used with a different request
503Downstream dependency unavailable (typically HIBP / breach service)
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation AdminCreateHook of auth's contract.