/v1/apps/{app_id}/tenants/{tenant_id}/members/{account_id}AuthChange a member's role inside a tenant.
Path parameters
app_id*stringId of the app.
tenant_id*stringId of the tenant.
account_id*stringId of the account.
Request body
role_name*stringNew role name from the app's `role` table.
Example: "admin"
Response · 200
id*stringUnique identifier of the tenant membership.
tenant_id*stringThe tenant the tenant membership belongs to.
account_id*stringThe end user (account) the tenant membership belongs to.
role_id*stringId of the role.
role_name*stringName of the role.
joined_at*string · date-timeWhen the member joined the tenant (ISO 8601).
invited_by*stringThe account that created the invite, or `null` when an API key did.
Example
Request
PATCH https://api.auth.productcraft.co/v1/apps/{app_id}/tenants/{tenant_id}/members/{account_id}
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"role_name": "admin"
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const tenantMembership = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").tenants.members.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role_name: "admin" });auth.admin.app(…).tenants.members.update(tenantId, accountId, params, options?): Auth.TenantMembership
Response
{
"id": "string",
"tenant_id": "string",
"account_id": "string",
"role_id": "string",
"role_name": "string",
"joined_at": "2026-01-01T00:00:00.000Z",
"invited_by": "string"
}