> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Members and Roles

> Administer who can manage a business account from Unity, and transfer ownership.

> [!NOTE]
>
> Business Accounts are in **early access**. See [Business Accounts](https://www.dynamic.xyz/docs/business-accounts/accounts.md) for the model.

Members control who can administer the account. That is separate from [who can sign](https://www.dynamic.xyz/docs/unity/business-accounts/manage-signers.md). `BusinessAccountMemberRole` has three values:

| Role | Can do |
| - | - |
| `Owner` | Everything, including transferring ownership. Exactly one per account. |
| `Admin` | Add and remove members and signers, and link wallets. |
| `Viewer` | Read-only access. |

> [!NOTE]
>
> Adding someone as a member does not let them sign, and adding a signer does not grant admin rights. Grant each explicitly.

## Who can call what

Every method acts on behalf of the signed-in user. Reads require membership, and modifications such as adding members or signers, linking wallets, and transferring ownership require the owner or admin role. A call made without the required role fails, so check `detail.Members` for the caller's role before you show those actions in your UI.

## Add a member

`AddMember` adds a member as `Admin` or `Viewer` (it defaults to `Viewer`). Identify them with a known `userId`, or with an `identifier` plus `identifierType`, in which case the user is created if they do not exist yet.

```csharp theme={"system"}
using DynamicSDK.Models.BusinessAccounts;
using UnityEngine;

var member = await DynamicSDK.Instance.BusinessAccounts.AddMember(
    businessAccountId: account.Id,
    identifier: "admin@acme.com",
    identifierType: BusinessAccountSignerIdentifierType.Email,
    role: BusinessAccountMemberRole.Admin);

Debug.Log(member.UserId);
```

**businessAccountId** `string` *required*

The account to add the member to.

**userId** `string`

A known Dynamic user ID. Use this instead of `identifier`.

**identifier** `string`

An email, phone number, or other identifier for the user.

**identifierType** `BusinessAccountSignerIdentifierType?`

How to read `identifier`: `Email`, `PhoneNumber`, `ExternalUserId`, `SocialUsername`, `SocialAccountId`, or `Id`.

**role** `BusinessAccountMemberRole?`

`Admin` or `Viewer`. Defaults to `Viewer`.

## List members

`Get` returns the account with its members, including each member's role.

```csharp theme={"system"}
var detail = await DynamicSDK.Instance.BusinessAccounts.Get(account.Id);

foreach (var member in detail.Members)
{
    Debug.Log($"{member.UserId}: {member.Role}");
}
```

## Change a member's role

`UpdateMemberRole` moves a member between `Admin` and `Viewer`. To change who the owner is, transfer ownership instead.

```csharp theme={"system"}
var updated = await DynamicSDK.Instance.BusinessAccounts.UpdateMemberRole(
    account.Id, member.UserId, BusinessAccountMemberRole.Viewer);
```

## Remove a member

```csharp theme={"system"}
var removed = await DynamicSDK.Instance.BusinessAccounts.RemoveMember(
    account.Id, member.UserId);
```

> [!TIP]
>
> Removing a member also tears down any [signer](https://www.dynamic.xyz/docs/unity/business-accounts/manage-signers.md) entries they held on the account's wallets, so they lose signing access too, not just admin rights.

## Transfer ownership

`TransferOwnership` promotes an existing member to owner and demotes the current owner to `Admin` in the same operation. Owner only.

```csharp theme={"system"}
var detail = await DynamicSDK.Instance.BusinessAccounts.TransferOwnership(
    account.Id, newOwnerUserId);
```

> [!WARNING]
>
> Transferring ownership revokes the caller's session server-side, because their scope changed from owner to admin. The previous owner is signed out and must re-authenticate to pick up the new role. The new owner must already be a member.

## Custom roles

A business account can also define custom roles that inherit `Admin` or `Viewer`, such as `cfo` or `treasurer`. Custom roles are defined, assigned, and deleted by name with the [JavaScript SDK](https://www.dynamic.xyz/docs/javascript/reference/business-accounts/custom-roles.md); `BusinessAccountMemberRole` here takes only the built-in values. A member holding a custom role reports its inherited built-in role.

## Next steps

> [card] [Manage signers](https://www.dynamic.xyz/docs/unity/business-accounts/manage-signers.md)
>
> Grant and revoke signing access per wallet.

> [card] [Sign transactions](https://www.dynamic.xyz/docs/unity/business-accounts/signing.md)
>
> Sign with a business-account wallet.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.