Important: This part of the GraphQL API is currently in Preview status. For more information, see GraphQL API policy.
The first membership of a given account is created at the time that the account itself is created. You can associate more users with an account by creating new account memberships.
There are two mutations that can be used to create a new account membership. These mutations are equivalent to the REST Create company membership and Create company membership (Add User) commands:
createAccountMembership—Creates a new account membership that links a user (identified by email address) with an existing account (identified by the account uuid). The specified user is assigned membership in the account, and receives an activation notice. If the user does not exist, a new user with the specified email address is created.
With the sendInvitation field, you can specify whether the user is to be sent an invitation, or activated automatically. You can set this field to false if the user does not have login access. If the user is invited, the membership remains in a pending activation state until the user activates their account.
createAccountMembershipWithPassword—Creates a new account membership for a new user, with a specified temporary password. The password is emailed to the recipient specified in the request body. This means that the new user has login access to the marketplace.
The new user is automatically invited to join the marketplace.
When you create an account membership, you identify the user by email address. If no user with that email address exists on the marketplace, a new user is created.
Both of these mutations return the new AccountMembership object as the payload. An account membership does not have an identifier of its own. Mutations and queries that use or refer to an account membership must identify it by using the unique identifiers for both the account and the user.
The user in a new account membership is assigned the USER role by default if no other role is specified. You can modify roles after the user has been created by changing the role, or adding more roles (see Update account memberships).