Important: This part of the GraphQL API is currently in Preview status. For more information, see GraphQL API policy.
You can update account memberships by enabling the membership, disabling the membership, or by changing the roles that the user in the membership holds within that account.
The GraphQL schema includes several APIs you can use to make these updates:
enableAccountMembership—Activates an existing account membership.
This mutation requires the account ID and user ID as input, and returns an AccountMembership in the response.
disableAccountMembership—Deactivates an existing account membership.
This mutation requires the account ID and user ID as input, and returns an AccountMembership in the response.
updateRolesForAccountMembership—Adds or removes roles to a specified user who already has membership in a given account.
In addition to the account ID and user ID, this mutation requires the full list of roles that the user is to have within the account. It adds new roles and/or removes existing ones to match the input, and returns the updated AccountMembership.
updateRolesForAccountMemberships—Adds or removes roles for multiple users within a given account.
This mutation also takes an account ID, user ID, and list of roles as input. However, it can accept multiple user IDs and associated role lists, so you can use it to update several memberships within the same account at a single time. The mutation returns a single boolean to indicate whether all the updates succeeded; if there was a failure, the payload includes error messages to indicate the problems that prevented the operation.
These mutations are equivalent to the REST Enable/Disable company membership, Update company membership, and Update company membership roles (bulk) APIs.