multiRole

Update role configuration

Update an app role — same fields as **Add custom role** (partial). `defaultPermissions` / `collectionPermissions` use the same normalization as on create. **featurePermissions:** see schema `AppRoleFeaturePermissions`.

PATCH/api/projects/{projectId}/multi-role/roles/{roleSlug}

Authentication

Requires JWT
Note
Include your JWT in the Authorization: Bearer YOUR_TOKEN header (user-facing apps, RBAC). View authentication guide →

Path Parameters

NameTypeRequiredDescription
projectIdstringYesProject ID.
roleSlugstringYesRole slug to update (e.g. starter `customer` or a role you added).

Request Body

Same fields as **Add custom role** — send only fields you want to change. `defaultPermissions` / `collectionPermissions` are normalized the same way as on create.

json
{
  "name": "App user",
  "description": "End users of the app",
  "signupEndpoint": "customer",
  "requiresApproval": false,
  "requiresPayment": false,
  "requiresKYC": false,
  "defaultPermissions": [
    {}
  ],
  "collectionPermissions": {},
  "metadata": {},
  "featurePermissions": {
    "messaging": {
      "email": true,
      "sms": true,
      "push": false
    },
    "integration": {
      "read": true,
      "execute": true
    }
  }
}
{
  "name": "App user",
  "description": "End users of the app",
  "signupEndpoint": "customer",
  "requiresApproval": false,
  "requiresPayment": false,
  "requiresKYC": false,
  "defaultPermissions": [
    {}
  ],
  "collectionPermissions": {},
  "metadata": {},
  "featurePermissions": {
    "messaging": {
      "email": true,
      "sms": true,
      "push": false
    },
    "integration": {
      "read": true,
      "execute": true
    }
  }
}

SDK setup

Create a client and set credentials (JWT and/or API key) before calling the API. Match the authentication type shown above.

import { MudbaseClient } from "mudbase";

const client = new MudbaseClient();
client.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig");
import { MudbaseClient } from "mudbase";

const client = new MudbaseClient();
client.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig");

Example request

Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.

const result = await client.multiRole.updateRole({
  projectId: "proj_6ECFS62B7bHj",
  roleSlug: "unused-calculus-zgwi",
  name: "Lee Lemke-Zieme V",
  description: "Savor the smoky essence in our Pants, designed for fair culinary adventures",
  signupEndpoint: "sensor back up",
  requiresApproval: true,
  requiresPayment: true,
  requiresKYC: false,
  defaultPermissions: "sensor quantify",
  collectionPermissions: "protocol override",
  metadata: "protocol connect",
  featurePermissions: "port bypass"
});
const result = await client.multiRole.updateRole({
  projectId: "proj_6ECFS62B7bHj",
  roleSlug: "unused-calculus-zgwi",
  name: "Lee Lemke-Zieme V",
  description: "Savor the smoky essence in our Pants, designed for fair culinary adventures",
  signupEndpoint: "sensor back up",
  requiresApproval: true,
  requiresPayment: true,
  requiresKYC: false,
  defaultPermissions: "sensor quantify",
  collectionPermissions: "protocol override",
  metadata: "protocol connect",
  featurePermissions: "port bypass"
});

Try It Live

Test 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

Responses

200Role updated
json
{
  "success": true,
  "message": "Role updated",
  "data": {
    "slug": "customer",
    "name": "App user",
    "description": "End users of the app",
    "isEnabled": true,
    "isCustom": true,
    "signupEndpoint": "customer",
    "requiresApproval": false,
    "requiresPayment": false,
    "requiresKYC": false,
    "defaultPermissions": [],
    "collectionPermissions": [],
    "featurePermissions": {
      "messaging": {
        "email": true,
        "sms": false
      },
      "integration": {
        "read": true,
        "execute": true
      }
    }
  }
}
{
  "success": true,
  "message": "Role updated",
  "data": {
    "slug": "customer",
    "name": "App user",
    "description": "End users of the app",
    "isEnabled": true,
    "isCustom": true,
    "signupEndpoint": "customer",
    "requiresApproval": false,
    "requiresPayment": false,
    "requiresKYC": false,
    "defaultPermissions": [],
    "collectionPermissions": [],
    "featurePermissions": {
      "messaging": {
        "email": true,
        "sms": false
      },
      "integration": {
        "read": true,
        "execute": true
      }
    }
  }
}
400Bad request or validation error.
401Authentication required or invalid token.
403Access denied or insufficient permissions.

Errors

CodeMeaning
400Bad request or validation error.
401Authentication required or invalid token.
403Access denied or insufficient permissions.
Edit this page on GitHub