Skip to content

Accept Invitation New Account

POST
/api/auth/invitations/accept
curl --request POST \
--url https://example.com/api/auth/invitations/accept \
--header 'Content-Type: application/json' \
--data '{ "full_name": "example", "password": "example", "token": "example", "username": "example" }'

Create an account by accepting an organization invitation.

REGISTRATION CARVE-OUT — deliberately NOT gated by ALLOW_REGISTRATION (compare register() above): an owner’s invitation, delivered to the invitee’s mailbox, IS the authorization. It stays scoped to exactly that one address: the request carries no email, the account is created for the invitation’s stored address, and the token is burned in the same transaction. /register itself is unchanged and stays closed.

The account is created verified (receiving the token proves mailbox ownership, exactly what /verify-email proves) and with NO default organization — the invitee joins the inviter’s org instead of minting a stray trial org + billing owner. Terms acceptance is captured by the console’s post-login gate (terms_accepted_at stays NULL here, same as a Google sign-up). LOGIN_ALLOWED_EMAILS is enforced before anything is written, so a locked-down server never gets an account that cannot sign in.

Media type application/json
InvitationAcceptNewAccountRequest

BUG-377: create an account by accepting an invitation.

Deliberately carries NO email: the account is always created for the invitation’s own stored address, so a token can never mint an account for any other address (the ALLOW_REGISTRATION=false carve-out stays scoped to exactly the invited email). Field rules match RegisterRequest.

object
full_name
Any of:
string
<= 255 characters
password
required
Password
string
>= 8 characters <= 128 characters
token
required
Token
string
>= 1 characters <= 256 characters
username
required
Username
string
>= 3 characters <= 50 characters /^[a-zA-Z0-9_-]+$/
Example generated
{
"full_name": "example",
"password": "example",
"token": "example",
"username": "example"
}

Successful Response

Media type application/json
Example generated
example

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}