A member is any principal with at least one role assignment in your organization. You add people by email with an invite, which grants them one role org-wide. To change the roles of an existing member, assign and revoke roles.
Before you begin
Invite a member
-
Find the URN of the role the new member should get with
list-roles. See Built-in roles. -
Send the invite:
terminal origin iam invite-member --org-id <org-id> \ --email jane@example.com \ --role-urn urn:origin:cloud:iam::::tc/role/roles/viewer- Account exists: the role is granted org-wide immediately. There’s no separate step to accept.
- No account yet: the invite is stored as pending. It’s applied the first time that address signs up and signs in to the console, or reads its own identity with
origin iam current-user. If by then you can no longer assign the role yourself, the invite is dropped instead.
-
Verify the invite. An existing account appears in the member list; a pending invite appears in the invite list.
terminal origin iam list-members --org-id <org-id> origin iam list-invites --org-id <org-id>
Invites are org-wide only. To give someone access to a single project, ask them to sign up and send you the userId that origin iam current-user shows them. Then assign a project-scoped role to user:<user-id>.
List members and invites
list-membersshows every principal with an active role assignment, at any scope, with all of its role URNs. For users, it includes the name and email address where the platform can resolve them. Service accounts with roles appear here too.principal-grantsshows one principal’s role assignments, each with its project scope.list-invitesshows pending invites: the ID, email address, role URN, who invited them and when. An invite disappears from the list once it’s applied or canceled.
Remove a member
Removing a member revokes every role the principal holds in the organization, org-wide and in every project. To take away a single role, revoke the role instead.
-
Find the member’s principal in the output of
list-members. -
Remove the member.
terminal origin iam remove-member --org-id <org-id> --principal user:<user-id> -
Run
list-membersagain and check that the principal is gone.
Removing a principal that holds no roles succeeds and changes nothing. If the member is the organization’s last org-wide owner, the platform refuses with CONFLICT and removes nothing. See The last owner is protected. If the member holds a role you couldn’t revoke yourself, such as a billing role when you hold none, the platform refuses with FORBIDDEN and removes nothing.
Cancel a pending invite
remove-member acts only on role assignments, so it doesn’t cancel a pending invite.
-
Find the invite’s ID with
list-invites. -
Cancel the invite.
terminal origin iam revoke-invite --org-id <org-id> --invite-id <invite-id> -
Run
list-invitesagain and check that the invite is gone.
Using the API
The mutations are inviteMember, removeMember and revokeInvite; the queries are orgMembers and orgInvites, all in the iam namespace. orgRoleAssignments returns the same data as orgMembers with one entry per assignment, including its project scope and when it was created. For the full list, see the IAM reference.
mutation {
iam {
inviteMember(input: {
orgId: "<org-id>"
email: "jane@example.com"
roleUrn: "urn:origin:cloud:iam::::tc/role/roles/viewer"
})
}
}Related
- Assign and revoke roles
- Access model
- Organizations
- Audit log – invites, cancellations and removals are recorded