/v1/workspaces/{workspace_slug}/members/{account_id}/roleAuthUpdate a member's role. Body: { roleId } or { role: "owner"|"admin"|"member" }.
Path parameters
workspace_slug*stringSlug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve("acme")`); the product APIs bind `workspace_id` instead.
account_id*stringId of the account.
Request body
role_idstringUUID of the role to assign. Use this to target custom roles.
Example: "11111111-1111-4111-8111-111111111111"
roleenum (3)System role shortcut: 'owner' | 'admin' | 'member'. Either `roleId` or `role` must be supplied.
Response · 200
id*string · uuidId of the membership.
workspace_id*string · uuidId of the workspace.
account_id*string · uuidId of the member's account.
role_id*string · uuidId of the member's new role.
invited_by*string · uuidAccount id of the member who invited them, when they joined by invite.
joined_at*string · date-timeWhen the member joined the workspace.
Example
Request
PATCH https://api.platform-auth.productcraft.co/v1/workspaces/{workspace_slug}/members/{account_id}/role
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"role_id": "11111111-1111-4111-8111-111111111111",
"role": "owner"
}import { PlatformAuth } from "@productcraft/platform-auth";
// Reads PRODUCTCRAFT_API_KEY from the environment; administration
// calls take a person's session: { auth: { type: "bearer", token } }
const platform = new PlatformAuth();
const updateMemberRole = await platform.workspaces.members.updateRole("acme", "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { role: "owner" });platform.workspaces.members.updateRole(workspaceSlug, accountId, params?, options?): PlatformAuth.UpdateMemberRole
Response
{
"id": "00000000-0000-0000-0000-000000000000",
"workspace_id": "00000000-0000-0000-0000-000000000000",
"account_id": "00000000-0000-0000-0000-000000000000",
"role_id": "00000000-0000-0000-0000-000000000000",
"invited_by": "00000000-0000-0000-0000-000000000000",
"joined_at": "2026-01-01T00:00:00.000Z"
}