List the organizations a user belongs to and manage the membership of the organization the token was issued for, including invitations and each member’s roles.
Returns an organization by ID within the token’s environment.
| query Organization($id: ID!) { | |
| organization(id: $id) { | |
| allowProfilesOutsideOrganization | |
| createdAt | |
| id | |
| name | |
| updatedAt | |
| } | |
| } |
| { | |
| "data": { | |
| "organization": { | |
| "allowProfilesOutsideOrganization": true, | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "name": "name_example", | |
| "updatedAt": "2024-01-01T00:00:00.000Z" | |
| } | |
| } | |
| } |
organization
Parameters
id: ID!
Returns Organization!
createdAt: DateTime!
id: ID!
name: String!
updatedAt: DateTime!
List organizations the authenticated user belongs to.
| query Organizations { | |
| organizations { | |
| id | |
| isCurrent | |
| name | |
| } | |
| } |
| { | |
| "data": { | |
| "organizations": [ | |
| { | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "isCurrent": true, | |
| "name": "name_example" | |
| } | |
| ] | |
| } | |
| } |
organizations
Returns [UserOrganization!]!
id: ID!
name: String!
List members of the organization the token was issued for, with their roles.
| query OrganizationMemberships($after: String, $before: String, $limit: Int, $order: PaginationOrder, $roleSlug: String, $search: String) { | |
| organizationMemberships(after: $after, before: $before, limit: $limit, order: $order, roleSlug: $roleSlug, search: $search) { | |
| data { | |
| actions | |
| createdAt | |
| emailVerified | |
| firstName | |
| id | |
| isCurrentUser | |
| isDirectoryManaged | |
| lastActivityAt | |
| lastName | |
| profilePictureUrl | |
| roles { | |
| name | |
| slug | |
| } | |
| status | |
| } | |
| listMetadata { | |
| after | |
| before | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "organizationMemberships": { | |
| "data": [ | |
| { | |
| "actions": [ | |
| "EditRole" | |
| ], | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "email": "email_example", | |
| "emailVerified": true, | |
| "firstName": "firstName_example", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "isCurrentUser": true, | |
| "isDirectoryManaged": true, | |
| "lastActivityAt": "2024-01-01T00:00:00.000Z", | |
| "lastName": "lastName_example", | |
| "profilePictureUrl": "profilePictureUrl_example", | |
| "roles": [ | |
| { | |
| "name": "name_example", | |
| "slug": "slug_example" | |
| } | |
| ], | |
| "status": "Active" | |
| } | |
| ], | |
| "listMetadata": { | |
| "after": "after_example", | |
| "before": "before_example" | |
| } | |
| } | |
| } | |
| } |
organizationMemberships
Parameters
after: String
before: String
limit: Int
Returns OrganizationMemberList!
Invite a user to the organization the token was issued for, assigning a role and sending the invitation email.
| mutation InviteUser($input: InviteUserInput!) { | |
| inviteUser(input: $input) { | |
| __typename | |
| ... on InvalidInviteeEmail { | |
| } | |
| ... on InvalidInviteeRole { | |
| roleSlug | |
| } | |
| ... on InviteeAlreadyInvited { | |
| } | |
| ... on InviteeAlreadyMember { | |
| } | |
| ... on InviteeEmailNotDeliverable { | |
| } | |
| ... on UserInvited { | |
| invitation { | |
| createdAt | |
| expiresAt | |
| id | |
| roleSlug | |
| status | |
| } | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "inviteUser": { | |
| "__typename": "InvalidInvitationExpiry" | |
| } | |
| } | |
| } |
inviteUser
Parameters InviteUserInput!
Returns InviteUserResult!
Resend a pending, expired, or revoked invitation for the organization the token was issued for. If the original invitation has expired or been revoked, a new invitation is created with the same role.
| mutation ResendInvitation($input: ResendInvitationInput!) { | |
| resendInvitation(input: $input) { | |
| __typename | |
| ... on InvitationResent { | |
| invitation { | |
| createdAt | |
| expiresAt | |
| id | |
| roleSlug | |
| status | |
| } | |
| } | |
| ... on InviteeAlreadyAccepted { | |
| userId | |
| } | |
| ... on InviteeEmailNotDeliverable { | |
| } | |
| ... on ResendInvitationNotFound { | |
| userId | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "resendInvitation": { | |
| "__typename": "InvitationResent", | |
| "invitation": { | |
| "createdAt": "2024-01-01T00:00:00.000Z", | |
| "email": "email_example", | |
| "expiresAt": "2024-01-01T00:00:00.000Z", | |
| "id": "id_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "roleSlug": "roleSlug_example", | |
| "status": "Pending" | |
| } | |
| } | |
| } | |
| } |
resendInvitation
Parameters ResendInvitationInput!
Returns ResendInvitationResult!
Revoke a pending invitation for the organization the token was issued for.
| mutation RevokeInvitation($input: RevokeInvitationInput!) { | |
| revokeInvitation(input: $input) { | |
| __typename | |
| ... on InvitationNotFound { | |
| userId | |
| } | |
| ... on InvitationNotPending { | |
| userId | |
| } | |
| ... on InvitationRevoked { | |
| invitation { | |
| createdAt | |
| expiresAt | |
| id | |
| roleSlug | |
| status | |
| } | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "revokeInvitation": { | |
| "__typename": "InvitationNotFound", | |
| "userId": "userId_01EHWNCE74X7JSDV0X3SZ3KJNY" | |
| } | |
| } | |
| } |
revokeInvitation
Parameters RevokeInvitationInput!
Returns RevokeInvitationResult!
Remove a member from the organization the token was issued for.
| mutation RemoveMember($input: RemoveMemberInput!) { | |
| removeMember(input: $input) { | |
| __typename | |
| ... on MemberIsManagedByDirectory { | |
| userId | |
| } | |
| ... on MemberNotFound { | |
| userId | |
| } | |
| ... on MemberRemoved { | |
| userId | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "removeMember": { | |
| "__typename": "MemberIsManagedByDirectory", | |
| "userId": "userId_01EHWNCE74X7JSDV0X3SZ3KJNY" | |
| } | |
| } | |
| } |
removeMember
Parameters RemoveMemberInput!
Returns RemoveMemberResult!
Update an organization member’s roles within the organization the token was issued for. When multiple roles are enabled, all provided role slugs are assigned; otherwise only the first is used.
| mutation UpdateMemberRole($input: UpdateMemberRoleInput!) { | |
| updateMemberRole(input: $input) { | |
| __typename | |
| ... on MemberNotFound { | |
| userId | |
| } | |
| ... on MemberRoleUpdated { | |
| member { | |
| actions | |
| createdAt | |
| emailVerified | |
| firstName | |
| id | |
| isCurrentUser | |
| isDirectoryManaged | |
| lastActivityAt | |
| lastName | |
| profilePictureUrl | |
| status | |
| } | |
| } | |
| ... on RoleNotFound { | |
| roleSlugs | |
| } | |
| } | |
| } |
| { | |
| "data": { | |
| "updateMemberRole": { | |
| "__typename": "MemberNotFound", | |
| "userId": "userId_01EHWNCE74X7JSDV0X3SZ3KJNY" | |
| } | |
| } | |
| } |