Sign-in
Sign-up, password and provider sign-in (web and native apps), two-factor step, verification, password reset, team invites.
Second step of sign-in: the authenticator or a recovery code
Called with the waiting session. Five wrong codes end it (401 signed_out). Then the same token works for 30 days.
Second step of sign-in: the authenticator or a recovery code › Request Body
codeA 6-digit authenticator code, or a recovery code (xxxx-xxxx).
Second step of sign-in: the authenticator or a recovery code › Responses
OK
verifiedalreadyVerifiednextWhere the app goes first: billing until a subscription is paid, checkout right after a website sign-up, else the signals.
recoveryCodesLeftSign in with email and password
Account holders and team members. With two-factor sign-in the session starts waiting (twoFactor: "required") and works only after POST /api/v1/customer/2fa/verify. Locks after 8 failures per email and address, 50 per email (15 minutes).
Sign in with email and password › Request Body
emailpasswordhandoffWebsite only.
Sign in with email and password › Responses
OK
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: session, next | |
| type = object · requires: handoff |
sessionA customer session (rps_…, 30 days). Send it as Authorization: Bearer. Turn it into a device session with POST /api/v1/customer/sessions/device.
nextWhere the app goes first: billing until a subscription is paid, checkout right after a website sign-up, else the signals.
twoFactorPresent when the session waits for a code: send it to POST /api/v1/customer/2fa/verify (10 minutes, 5 tries).
Native apps: exchange the sign-in code for a session
The code from the redirect works once, for two minutes, only with the verifier of the challenge sent to start and the same redirect URI (400 invalid_grant otherwise; the code is spent either way). 404 native_not_configured until RP_NATIVE_REDIRECT_URIS is set.
Native apps: exchange the sign-in code for a session › Request Body
codecodeVerifierRFC 7636 verifier.
redirectUriNative apps: exchange the sign-in code for a session › Responses
OK
sessionA customer session (rps_…, 30 days). Send it as Authorization: Bearer. Turn it into a device session with POST /api/v1/customer/sessions/device.
nextWhere the app goes first: billing until a subscription is paid, checkout right after a website sign-up, else the signals.
twoFactorPresent when the session waits for a code: send it to POST /api/v1/customer/2fa/verify (10 minutes, 5 tries).
Provider callback (called by the provider through the browser)
Not for clients. Ends on the web app's /c/auth?code=<handoff>, or for a native flow on the app's redirect URI with code and state; errors carry oauth_error (web) or error (native): denied, expired, mismatch, provider, not_configured, email_unverified_account, email_password_account, email_taken.
path Parameters
providergoogle, github, microsoft or apple (when configured).
query Parameters
codeFrom the provider.
stateFrom the provider.
errorFrom the provider.
Provider callback (called by the provider through the browser) › Responses
To the web app, the website, or the native app.
Provider callback as a form POST (Sign in with Apple)
path Parameters
providergoogle, github, microsoft or apple (when configured).
Provider callback as a form POST (Sign in with Apple) › Request Body
codestateuserApple: the name, first sign-in only.
errorProvider callback as a form POST (Sign in with Apple) › Responses
Like the GET callback.
Start a provider sign-in (a browser navigation)
Open in a browser; never call it with fetch. Web: surface=site|app and an optional packageId (a new account goes to checkout).
Native apps (RFC 8252): open it in the system browser (ASWebAuthenticationSession, Custom Tabs) with redirect_uri (one of RP_NATIVE_REDIRECT_URIS, exact match), code_challenge (base64url SHA-256 of a random verifier) and code_challenge_method=S256, and optionally state. The flow ends on redirect_uri?code=…&state=… (or ?error=<code>&state=…); exchange the code at POST /api/v1/customer/oauth/native/token. A bad redirect_uri is answered here with JSON, never redirected to.
Connecting a provider to a signed-in account starts from POST /api/v1/customer/oauth/{provider}/link instead (link=).
path Parameters
providergoogle, github, microsoft or apple (when configured).
query Parameters
surfaceWeb: where an error returns (the website or the web app).
packageIdWeb: the plan a new account will buy.
linkA connect ticket from POST …/link.
redirect_uriNative: the app's registered redirect URI.
code_challenge^[A-Za-z0-9_-]{43}$Native: PKCE challenge (S256).
code_challenge_methodNative: S256.
stateNative: returned unchanged to the app.
Start a provider sign-in (a browser navigation) › Responses
To the provider's sign-in page (sets the short-lived rp_oauth cookie that binds the flow to this browser).
Set a new password from a reset or invite link, and sign in
Confirms the address and ends every other session (device sessions too).
Set a new password from a reset or invite link, and sign in › Request Body
tokenpassword10 to 200 characters.
handoffWebsite only.
Set a new password from a reset or invite link, and sign in › Responses
OK
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: session, next | |
| type = object · requires: handoff |
sessionA customer session (rps_…, 30 days). Send it as Authorization: Bearer. Turn it into a device session with POST /api/v1/customer/sessions/device.
nextWhere the app goes first: billing until a subscription is paid, checkout right after a website sign-up, else the signals.
twoFactorPresent when the session waits for a code: send it to POST /api/v1/customer/2fa/verify (10 minutes, 5 tries).
emailExchange a website handoff code for a session
Exchange a website handoff code for a session › Request Body
codeExchange a website handoff code for a session › Responses
OK
sessionA customer session (rps_…, 30 days). Send it as Authorization: Bearer. Turn it into a device session with POST /api/v1/customer/sessions/device.
nextWhere the app goes first: billing until a subscription is paid, checkout right after a website sign-up, else the signals.
twoFactorPresent when the session waits for a code: send it to POST /api/v1/customer/2fa/verify (10 minutes, 5 tries).
Create an account (then pay in Stripe Checkout)
Creates the account in checkout state and mails a verification link. The answer carries the live key (shown only here) and a session that works before the address is confirmed. An app that wants its own return pages ignores checkoutUrl and calls POST /api/v1/customer/billing/checkout with successUrl and cancelUrl.
Create an account (then pay in Stripe Checkout) › Request Body
nameemailpassword10 to 200 characters.
packageIdA package that is for sale (GET /api/v1/customer/plans).
acceptTermsmarketingOptInConsent to marketing email.
campaignA campaign code from a landing page.
handoffWebsite only: answer with a handoff code instead of a session.
Create an account (then pay in Stripe Checkout) › Responses
Created.
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: customerId, key, session +1 more | |
| type = object · requires: customerId, handoff |
customerIdkeyThe live API key (rp_…), shown only here.
sessionverificationSentcheckoutUrlStripe Checkout (returns to the web app); null when Stripe could not be reached.
Accept a team invite: choose a password
The invite link opens /c/team/accept?token=…. Sign in afterwards with POST /api/v1/customer/login.
Accept a team invite: choose a password › Request Body
tokenrpmi_…
password10 to 200 characters.
nameAccept a team invite: choose a password › Responses
OK
emailaccepted