Users
Manage organization users and team members
Overview
Users represent team members in your organization. Each user has a role that determines their access level and permissions. Users can be assigned to appointments, services, and other organizational tasks.
User Roles
| Role | Description |
|---|---|
ADMIN | Full access to all features including organization settings, billing, and user management |
USER | Standard access for technicians and team members |
User Scopes
Scopes provide fine-grained access control for users. Each user can have multiple scopes assigned that determine what actions they can perform within the application.
Appointment Scopes
| Scope | Description |
|---|---|
read:own:appointment | View appointments assigned to the user |
read:all:appointment | View all appointments in the organization |
write:appointment | Create and update appointments |
delete:appointment | Delete appointments |
communication:appointment | Send communications related to appointments |
Customer Scopes
| Scope | Description |
|---|---|
read:customer | View customer information |
read:customer-details | View detailed customer information |
read:customer:telephone-number | View customer phone numbers |
write:customer | Create and update customers |
delete:customer | Delete customers |
Service Scopes
| Scope | Description |
|---|---|
read:service | View service records |
read:pricing:service | View service pricing information |
write:service | Create and update services |
delete:service | Delete services |
communication:service | Send communications related to services |
upload-from-gallery:service | Upload photos from device gallery for services |
Invoice Scopes
| Scope | Description |
|---|---|
read:invoice | View invoices |
read:pricing:invoice | View invoice pricing details |
write:invoice | Create and update invoices |
delete:invoice | Delete invoices |
Inventory Scopes
| Scope | Description |
|---|---|
read:inventory | View inventory items and stock levels |
write:inventory | Create and update inventory items |
delete:inventory | Delete inventory items |
Organization Scopes
| Scope | Description |
|---|---|
update:organization | Update organization settings |
write:reports | Generate and export reports |
List Users
Retrieve a list of users in the organization.
query InfiniteUsers($first: Int!, $after: String, $filter: UserFilter) {
infiniteUsers(first: $first, after: $after, filter: $filter) {
edges {
node {
id
email
firstName
lastName
role
status
lastLoginAt
}
cursor
}
pageInfo {
hasNextPage
endCursor
}
}
}
# Variables
{
"first": 20,
"filter": {
"role": "USER",
"status": "ACTIVE"
}
}Response:
{
"data": {
"infiniteUsers": {
"edges": [
{
"node": {
"id": "user_789",
"email": "mike@example.com",
"firstName": "Mike",
"lastName": "Johnson",
"role": "USER",
"status": "ACTIVE",
"lastLoginAt": "2024-01-20T08:00:00Z"
},
"cursor": "eyJpZCI6InVzZXJfNzg5In0="
}
],
"pageInfo": {
"hasNextPage": true,
"endCursor": "eyJpZCI6InVzZXJfNzg5In0="
}
}
}
}Get Current User
Retrieve the currently authenticated user.
query Me {
me {
id
email
firstName
lastName
phone
role
status
avatar
timezone
organization {
id
name
}
lastLoginAt
createdAt
}
}Response:
{
"data": {
"me": {
"id": "user_001",
"email": "admin@example.com",
"firstName": "Admin",
"lastName": "User",
"phone": "555-0100",
"role": "ADMIN",
"status": "ACTIVE",
"avatar": "https://storage.example.com/avatars/user_001.jpg",
"timezone": "America/Chicago",
"organization": {
"id": "org_001",
"name": "Austin Pool Services"
},
"lastLoginAt": "2024-01-20T09:00:00Z",
"createdAt": "2023-01-15T10:00:00Z"
}
}
}Create User
Invite a new user to the organization.
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
email
firstName
lastName
role
status
createdAt
}
}
# Variables
{
"input": {
"email": "newtech@example.com",
"firstName": "Sarah",
"lastName": "Williams",
"phone": "555-0201",
"role": "USER"
}
}Response:
{
"data": {
"createUser": {
"id": "user_010",
"email": "newtech@example.com",
"firstName": "Sarah",
"lastName": "Williams",
"role": "USER",
"status": "PENDING",
"createdAt": "2024-01-20T14:00:00Z"
}
}
}Update User
Update user information or role.
mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {
updateUser(id: $id, input: $input) {
id
firstName
lastName
role
status
updatedAt
}
}
# Variables
{
"id": "user_010",
"input": {
"role": "ADMIN",
"phone": "555-0202"
}
}Response:
{
"data": {
"updateUser": {
"id": "user_010",
"firstName": "Sarah",
"lastName": "Williams",
"role": "ADMIN",
"status": "ACTIVE",
"updatedAt": "2024-01-25T10:00:00Z"
}
}
}Delete User
Deactivate a user (soft delete).
mutation DeleteUser($id: ID!) {
deleteUser(id: $id) {
success
message
}
}
# Variables
{
"id": "user_010"
}Response:
{
"data": {
"deleteUser": {
"success": true,
"message": "User deactivated successfully"
}
}
}Field Reference
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier |
email | String! | Email address (unique) |
firstName | String! | First name |
lastName | String! | Last name |
phone | String(nullable) | Phone number |
role | UserRole! | Role (ADMIN, USER) |
status | UserStatus! | Status (ACTIVE, INACTIVE, PENDING) |
avatar | String(nullable) | Profile picture URL |
timezone | String(nullable) | User's timezone |
lastLoginAt | DateTime(nullable) | Last login timestamp |
organization | Organization! | Associated organization |
createdAt | DateTime! | Creation timestamp |
updatedAt | DateTime! | Last update timestamp |