...
This query can be used to find a user(s) based on their email address. Multiple users can be returned if the email address is similar. Additional input arguments can be included to make selection more specific.
Example 1:
This query “digs” through the viewer’s current organization and returns the members.
Variables
Code Block |
---|
{
"first": 1,
"fullText": "luke@jedi.org"
} |
Query
Code Block |
---|
query FetchUsers($fullText: String, $first: Int!) {
viewer {
currentOrganization {
members(fullText: $fullText, first: $first)
{
nodes {
firstName
lastName
username
email
}
}
}
}
} |
Example 2:
This query uses the users
query field, which is available on v2.28.1
and above.
Query
Code Block |
---|
{ users( fullText: "luke@jedi.org" first: 1 ) { errors { fullMessage } nodes { id firstName lastName username email } totalCount } } |
...
When updating a user, the ID retrieved earlier is required. The groups, and origin group use the group name. The licenses need a value from the LicenseTypeEnum.
Variables
Code Block |
---|
{ "input": { "id": <STRING>, "requestedGroups": Array<STRING>, "requestedLicenses": Array<STRING>, "requestedOriginGroup": <STRING>, "user": { "email": <STRING>, "firstName": <STRING>, "lastName": <STRING>, "phone": <STRING>, "jobTitle": <STRING> } } } |
Query
Code Block |
---|
mutation updateUser($input: UpdateUserMutationInput!) { updateUser(input: $input) { user { id email firstName lastName phone jobTitle licenses { nodes { licenseType } } groups { nodes { name } } } errors { fullMessage } success } } |
...
A user cannot remove themselves
Invalid IDs will be skipped and valid IDs will be used to delete users. Errors of these invalid IDs will be returned.
It does not delete the last company admin. A single company admin must remain in the system.
It does not delete Scope/Support admin users. This will allow the support team to assist.
Variables
Code Block | ||
---|---|---|
| ||
{"input": {"ids": Array<String> } } |
Query
Code Block |
---|
mutation deleteUsers($input: DeleteUsersMutationInput!) { deleteUsers(input: $input) { errors { fullMessage } success undeletedItems { id name } } } |
...