/{app_slug}/v1/auth/accept-inviteAccept an EndUser invite by code
Materialises a pre-allocated invite into a real EndUser: creates account + primary email contact (verified, since mailing the code proved control) + password credential + role membership, then mints app-scoped tokens. Public endpoint — the invite code is the authority. 410 on revoked/expired/exhausted invites; 409 on duplicate email or username. The same password policy as `/auth/signup` applies, including the common-password deny-list and the breach check, and so does the app-level MFA mandate: on an `auth_config.mfa: "required"` app the account is created but the response is `mfa_enrollment_required: true` with no session behind it.
Path parameters
app_slug*stringSlug of the app.
Request body
code*stringInvite code from the invitation email (`inv_…`).
Example: "inv_x7H2k3jLqXr"
password*stringPassword the accepter sets for their new account.
Example: "CorrectHorseBatteryStaple"
usernamestringOptional username override. Defaults to a derivation of the invite email local-part.
Example: "john_doe"
display_namestringOptional display name shown back to the user.
Example: "Jane Doe"
Response · 201 Account created from the invite. A session was minted unless `mfa_enrollment_required` is present — branch on that flag.
object
Example
Request
POST https://api.auth.productcraft.co/{app_slug}/v1/auth/accept-invite
Content-Type: application/json
{
"code": "inv_x7H2k3jLqXr",
"password": "CorrectHorseBatteryStaple",
"username": "john_doe",
"display_name": "Jane Doe"
}Response
{}