Multi-Role Feature
Register user with specific role (Local Auth)
Public endpoint for user registration with a specific role. The path segment must match a role's `signupEndpoint` (default starter is `customer`; add more roles via multi-role API). No authentication required - this is a public signup endpoint.
POST
/api/auth/local/signup/{role}SDK setup
Create a client instance. No authentication is required for this endpoint.
import { Configuration, MultiRoleFeatureApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const multirolefeature = new MultiRoleFeatureApi(configuration);import { Configuration, MultiRoleFeatureApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const multirolefeature = new MultiRoleFeatureApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await multirolefeature.registerWithRole(
"transmitter navigate",
{
email: "ben_gleason@northwind.dev",
password: "Str0ng_Sample_Pass!w0rd",
firstName: "Holly",
lastName: "Erdman",
projectId: "proj_0WJrmmcsVWNV",
agreedToTerms: true
}
);const { data: result } = await multirolefeature.registerWithRole(
"transmitter navigate",
{
email: "ben_gleason@northwind.dev",
password: "Str0ng_Sample_Pass!w0rd",
firstName: "Holly",
lastName: "Erdman",
projectId: "proj_0WJrmmcsVWNV",
agreedToTerms: true
}
);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
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
role | string | Yes | Must match the role's `signupEndpoint` (default `customer`; other values for roles you add). |
Request Body
json
{
"email": "amari_koss69@northwind.dev",
"password": "Str0ng_Sample_Pass!w0rd",
"firstName": "Marjorie",
"lastName": "Wyman",
"projectId": "proj_qh5hFHNT70YZ",
"agreedToTerms": true
}{
"email": "amari_koss69@northwind.dev",
"password": "Str0ng_Sample_Pass!w0rd",
"firstName": "Marjorie",
"lastName": "Wyman",
"projectId": "proj_qh5hFHNT70YZ",
"agreedToTerms": true
}Responses
201Registration successful. Two response shapes depending on the project's `requireEmailVerification` setting - see `requireVerification` to distinguish them; `token`/`refreshToken`/`expiresIn` are only present when a session was issued immediately.
json
{
"message": "Stylish Keyboard designed to make you stand out with lively looks",
"requireVerification": true,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfZGVtbyJ9.sig_sample",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfZGVtbyJ9.sig_sample",
"expiresIn": 65051,
"user": {
"id": "usr_OdrcaBv2c4sxy0",
"email": "buster_pagac@northwind.dev",
"firstName": "Sally",
"lastName": "Beier",
"role": "alarm compress",
"customRole": "bus parse",
"emailVerified": true
},
"role": {
"slug": "grimy-synergy-hfb9",
"name": "Mary Koelpin",
"description": "Our spicy-inspired Cheese brings a taste of luxury to your likable lifestyle"
}
}{
"message": "Stylish Keyboard designed to make you stand out with lively looks",
"requireVerification": true,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfZGVtbyJ9.sig_sample",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfZGVtbyJ9.sig_sample",
"expiresIn": 65051,
"user": {
"id": "usr_OdrcaBv2c4sxy0",
"email": "buster_pagac@northwind.dev",
"firstName": "Sally",
"lastName": "Beier",
"role": "alarm compress",
"customRole": "bus parse",
"emailVerified": true
},
"role": {
"slug": "grimy-synergy-hfb9",
"name": "Mary Koelpin",
"description": "Our spicy-inspired Cheese brings a taste of luxury to your likable lifestyle"
}
}400Validation failed, or a user with this email already exists for the project
403Role requires approval, payment, or KYC before it can be self-assigned
404Role not found or not enabled
Errors
| Code | Meaning |
|---|---|
400 | Validation failed, or a user with this email already exists for the project |
403 | Role requires approval, payment, or KYC before it can be self-assigned |
404 | Role not found or not enabled |