Authentication
Register new user (project-based)
When the project has **requireEmailVerification** enabled (default), the response is 201 with **requireVerification: true** and **no token**; the user must verify their email then sign in via login. When email verification is disabled, a token and refreshToken are returned.
POST
/api/auth/local/registerSDK setup
Create a client instance. No authentication is required for this endpoint.
import { Configuration, AuthenticationApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const authentication = new AuthenticationApi(configuration);import { Configuration, AuthenticationApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const authentication = new AuthenticationApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await authentication.registerLocalUser(
{
email: "christine.marks@northwind.dev",
password: "Str0ng_Sample_Pass!w0rd",
firstName: "Zetta",
lastName: "Sauer",
projectId: "usr_nohj3jrNtyw6C6"
}
);const { data: result } = await authentication.registerLocalUser(
{
email: "christine.marks@northwind.dev",
password: "Str0ng_Sample_Pass!w0rd",
firstName: "Zetta",
lastName: "Sauer",
projectId: "usr_nohj3jrNtyw6C6"
}
);Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
No Request Yet
Send a request to see the full inspector
Authentication
Public — No Auth Required
Request Body
json
{
"email": "amari_koss69@northwind.dev",
"password": "Str0ng_Sample_Pass!w0rd",
"firstName": "Marjorie",
"lastName": "Wyman",
"projectId": "proj_qh5hFHNT70YZ"
}{
"email": "amari_koss69@northwind.dev",
"password": "Str0ng_Sample_Pass!w0rd",
"firstName": "Marjorie",
"lastName": "Wyman",
"projectId": "proj_qh5hFHNT70YZ"
}Responses
201When project.requireEmailVerification is on (default): no token returned; use requireVerification and message to prompt email verification, then user signs in via login. When off: token and refreshToken returned.
Email verification required (default)
json
{
"message": "Please verify your email to sign in. Check your inbox for the verification link.",
"requireVerification": true,
"user": {
"id": "685acbe0e129932fbb7a0fc2",
"email": "john.doe@mudbase.dev",
"firstName": "John",
"lastName": "Doe",
"emailVerified": false,
"customRole": null
}
}{
"message": "Please verify your email to sign in. Check your inbox for the verification link.",
"requireVerification": true,
"user": {
"id": "685acbe0e129932fbb7a0fc2",
"email": "john.doe@mudbase.dev",
"firstName": "John",
"lastName": "Doe",
"emailVerified": false,
"customRole": null
}
}Token returned (when requireEmailVerification is false)
json
{
"message": "Registration successful. Please check your email for verification.",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "...",
"expiresIn": 86400,
"user": {
"id": "685acbe0e129932fbb7a0fc2",
"email": "john.doe@mudbase.dev",
"firstName": "John",
"lastName": "Doe",
"emailVerified": false,
"customRole": null
}
}{
"message": "Registration successful. Please check your email for verification.",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "...",
"expiresIn": 86400,
"user": {
"id": "685acbe0e129932fbb7a0fc2",
"email": "john.doe@mudbase.dev",
"firstName": "John",
"lastName": "Doe",
"emailVerified": false,
"customRole": null
}
}400—
404—
429—
500—
Errors
| Code | Meaning |
|---|---|
400 | — |
404 | — |
429 | — |
500 | — |