Retrieves a single specific user via id
, ref
or email
. Useful for displaying user profiles or checking permissions.
query {
user(id: "uuid-hier") {
id
name
email
isActive
}
}
Returns a list of all users. You can optionally filter by active status.
query {
users(active: true) {
id
name
email
}
}
Creates a new user. An invitation is sent by default unless sendInvite: false
is set.
mutation {
createUser(
sendInvite: true
user: {
email: "example@domain.com"
name: "Jane Doe"
roles: [MANAGER]
language: NL
}
) {
user {
id
name
email
}
created
}
}
Modifies an existing user based on id
or ref
. You can adjust properties such as name, roles or language.
mutation {
updateUser(
id: "uuid-hier"
user: {
name: "Updated Name"
roles: [PLANNER, TRAINER]
}
) {
user {
id
name
roles
}
}
}
Looks up a user based on email or ref, and creates one if it doesn't exist. Ideal for integrations where you don't know if the user already exists.
mutation {
updateOrCreateUser(
email: "example@domain.com"
sendInvite: false
user: {
name: "Jane Doe"
isActive: true
roles: [TRAINER]
}
) {
user {
id
name
email
}
created
}
}
Archives one or more users. These users are deactivated without permanently deleting them.
mutation {
archiveUsers(
archive: true
ids: ["uuid-1", "uuid-2"]
) {
response {
succeededIds
failedIds
}
}
}
The User
type describes the structure of a user in the system. Including fields such as email, name, status, language, permissions, additional fields and connections with groups.
type User {
modelId: ID!
email: String
name: String!
archivedAt: DateTime
ref: String
id: ID!
isActive: Boolean
roles: [Role]
profileImage: File!
language: Language!
extraFields: JSONString
extraFieldsProfile: JSONString
hasPassword: Boolean
afasPersonId: String
afasEmployeeId: String
afasContactId: String
afasConnectionId: ID
participantGroups: [Group!]
managerGroups: [Group!]
groupCount: Int
invitedOn: DateTime
lastLogin: DateTime
userVia: [UserVia!]
}
Use user
to retrieve a specific user and users
for lists. paginatedUsers
is available for advanced filtering.
user(id: UUID, ref: String, email: String): User
users(active: Boolean): [User!]!
Mutations for creating, updating or archiving users. Use updateOrCreateUser
where possible to prevent duplicate logic.
createUser(sendInvite: Boolean = true, user: CreateUserInput!): CreateUser
updateUser(ref: String, id: UUID, user: UpdateUserInput!): UpdateUser
updateOrCreateUser(email: String, ref: String, sendInvite: Boolean, user: UpdateOrCreateUserInput!): UpdateOrCreateUser
archiveUsers(archive: Boolean!, ids: [UUID!]!): ArchiveUsers
updateOrCreateUser
as the standard mutation for new or existing users.archiveUsers
is the designated way to deactivate or archive users.deleteUser
mutation — users can only be archived.groups
field is deprecated. Use participantGroups
and managerGroups
.