Convert Guest To User
POST/api/guests/convert-to-user
Converts a GUEST
account to a regular USER account.
You can learn more about GUEST accounts here.
Requirements
- The
emailshould be a valid email address (e.g., "[email protected]") that is not associated to an existing account. - The
passwordmust be at least 8 characters long and include at least one uppercase letter, one lowercase letter, one number, and one special character (!@#$%^&*()_+={}[]|:;'"<>,.?/).
Optional session data:
- The
sessionobject can be included in the request body. - Inside the
sessionobject, you can provide the following optional fields:browser: The name of the browser used (e.g., "Chrome", "Firefox").os: The operating system of the device (e.g., "Windows", "macOS", "Android").
This information helps users identify and manage authorized sessions, improving overall account security.
Locale
A locale can be specified for this request. This will be used for the email verification email. You can learn more about email verification here.
If no locale is specified, the applications default locale will be used. You can learn more about configuring the default locale here.
Tokens
- A valid
AccessTokenof aGUESTis required. - If successful, the tokens of the
GUESTaccount become invalid. A newAccessTokenandRefreshTokenwill automatically be set as HTTP-only cookies. If header authentication is enabled,AccessTokenandRefreshTokenwill be returned in the response body and can be used as bearer tokens in the authorization header for upcoming requests.
Request
Responses
- 200
- 304
- 401
- 404
- 409
- 500
Registration successful. Returns user details and tokens if header authentication is enabled.
The following error codes correspond to this status:
GUEST_IS_ALREADY_USER: Cannot convert guest to user because it is already a user.
The following error codes correspond to this status:
ACCESS_TOKEN_EXPIRED: Indicates that the access token is expired.ACCESS_TOKEN_INVALID: Indicates that the access token cannot be decoded.AUTHENTICATION_REQUIRED: User is not authenticated.
The following error codes correspond to this status:
GUEST_NOT_FOUND: Cannot convert guest to user because it does not exist.
The following error codes correspond to this status:
GUEST_EMAIL_TAKEN: Cannot convert guest to user because the email address is already taken.
The following error codes correspond to this status:
ACCESS_TOKEN_ALLOWLIST_READING_FAILURE: Represents an exception indicating a failure when reading the allowlist for an access token cache.DATABASE_FAILURE: Exception representing a general failure related to database operations.HASH_FAILURE: Exception representing a general failure related to hashing operations.POST_COMMIT_SIDE_EFFECT_FAILURE: Exception representing a failure to perform a side effect after a successful database operation.ACCESS_TOKEN_CACHE_FAILURE: Thrown when an access token could not be created due to an exception in the access token whitelist.ACCESS_TOKEN_ENCODING_FAILURE: Represents an exception that occurs during the encoding process of an access token.ACCESS_TOKEN_CREATION_FAILURE: Thrown when a generic exception occurred during the creation of an access token.ACCESS_TOKEN_INVALID_PRINCIPAL_DOCUMENT_FAILURE: Indicates that the principal document associated with the access token is invalid.ACCESS_TOKEN_SECRET_FAILURE: Represents an exception that occurs when there is a failure related to the secret required for creating an access token.REFRESH_TOKEN_ENCODING_FAILURE: Represents an exception that occurs during the encoding process of a refresh token.REFRESH_TOKEN_CREATION_FAILURE: Thrown when a generic exception occurred during the creation of an access token.REFRESH_TOKEN_INVALID_PRINCIPAL_DOCUMENT_FAILURE: Indicates that the principal document associated with the access token is invalid.REFRESH_TOKEN_SECRET_FAILURE: Represents an exception that occurs when there is a failure related to the secret required for creating a refresh token.REFRESH_TOKEN_SESSION_UPDATE_FAILURE: Thrown when an exception occurs when updating the user sessions after creating a new refresh token.INVALID_PRINCIPAL_DOCUMENT: A requested principal document was stored in an invalid format.COOKIE_CREATION_FAILURE: Thrown when an exception occurred during the creation of a cookie.