Multi-Role Feature
Apply Admin / User / Viewer feature permission preset
Sets `featurePermissions` on the role from a bundled preset (`admin`, `user`, `viewer`). Does not change collection CRUD or `dataScope`; use collection permission APIs for those.
POST
/api/projects/{projectId}/multi-role/roles/{roleSlug}/apply-presetSDK setup
Create a client and set credentials (JWT and/or API key) before calling the API. Match the authentication type shown above.
import { Configuration, MultiRoleFeatureApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
const multirolefeature = new MultiRoleFeatureApi(configuration);import { Configuration, MultiRoleFeatureApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
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.applyRoleFeaturePreset(
"proj_AQqJEUe1wGAt",
"filthy-sprinkles-j8tx",
{
preset: "monitor index"
}
);const { data: result } = await multirolefeature.applyRoleFeaturePreset(
"proj_AQqJEUe1wGAt",
"filthy-sprinkles-j8tx",
{
preset: "monitor index"
}
);Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
Use the auth endpoints to obtain a JWT.
No Request Yet
Send a request to see the full inspector
Authentication
Requires JWT
Note
Include your JWT in the
Authorization: Bearer YOUR_TOKEN header (user-facing apps, RBAC). View authentication guide →Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | — |
roleSlug | string | Yes | — |
Request Body
json
{
"preset": "viewer"
}{
"preset": "viewer"
}Responses
200Preset applied
json
{
"success": true,
"message": "Stylish Keyboard designed to make you stand out with lively looks",
"data": {}
}{
"success": true,
"message": "Stylish Keyboard designed to make you stand out with lively looks",
"data": {}
}400—
Errors
| Code | Meaning |
|---|---|
400 | — |