palbaseDocs

Palbase Auth API · API

POST/auth/cli/owner-code

Hand the owner's sign-in to the CLI

The platform's own project alone. For the owner who confirmed with a passkey in the last two minutes (not a session a client opened, not one bound to a DPoP key): a one-time code, for two minutes, bound to the CLI's S256 challenge (RFC 7636) and loopback redirect_uri (RFC 8252 §7.3), and where to send the browser with it (redirect_to). The CLI redeems it at /oauth/token with grant_type urn:palbase:params:oauth:grant-type:owner-code, code, code_verifier and redirect_uri, for a token of this sign-in until 15 minutes after it, and no refresh token. Each code is in the project's audit (platform.owner_cli_sign_in) and mailed to the owner; each redemption is audited (platform.owner_cli_token).

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

Request body

code_challengestring · requiredbase64url of the SHA-256 of the CLI's verifier
code_challenge_method"S256" · required
redirect_uristring · requiredThe CLI's listener (RFC 8252 §7.3): a loopback IP literal and a port from 1024 to 65535.
statestring · requiredThe CLI's state, sent back to its listener.
curl
curl -X POST "https://<your-ref>.palbase.studio/auth/cli/owner-code" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"code_challenge":"string","code_challenge_method":"S256","redirect_uri":"string","state":"string"}'

Responses

200The code

400Validation failed or required field missing

401Missing, invalid, or expired credentials

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

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

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

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

Operation OwnerCLICode of auth's contract.