Users & Companies

The Ecosystem module is the foundation of Kanvas. It manages identity, tenancy, and access — users, companies, branches, roles, and permissions. Every other module is scoped to a company.

User

Users are people who access the system — team members, agents, or admins.

FieldTypeDescription
idID!Unique identifier
uuidString!Universal unique identifier
firstnameStringFirst name
lastnameStringLast name
displaynameStringDisplay name
emailEmail!Email address
is_activeBoolean!Whether the user is active
default_companyIntID of the user's primary company
default_company_branchIntID of the user's primary branch
roles[Role!]Assigned roles
companies[Company!]Companies the user belongs to
branches[CompanyBranch!]Branches the user has access to
photoFilesystemProfile photo
files[Filesystem!]Attached files
custom_fields[CustomField!]Custom key-value data
created_atDateTimeCreation timestamp

Company

Companies are the primary tenant boundary. All data is scoped to a company.

FieldTypeDescription
idID!Unique identifier
uuidString!Universal unique identifier
nameString!Company name
websiteStringWebsite URL
addressStringAddress
emailStringContact email
phoneStringPhone number
country_codeStringCountry code
is_activeBoolean!Whether the company is active
users[User!]Team members
branches[CompanyBranch!]Company branches / locations
total_usersIntTotal user count
total_branchesIntTotal branch count
custom_fields[CustomField!]Custom key-value data

Queries

# List users
query {
  users(first: 20, where: { column: IS_ACTIVE, operator: EQ, value: true }) {
    data {
      id displayname email
      roles { name }
      default_company
    }
    paginatorInfo { total hasMorePages }
  }
}

# List companies
query {
  companies(first: 20) {
    data {
      id uuid name website
      total_users total_branches
      branches { id name }
    }
  }
}

Mutations

# Update a user
mutation {
  updateUser(id: 1, data: { firstname: "Jane", lastname: "Smith" }) {
    id displayname
  }
}

# Create a company
mutation {
  createCompany(input: { name: "New Corp", website: "https://newcorp.com" }) {
    id uuid name
  }
}

# Create a branch
mutation {
  createCompanyBranch(company_id: 1, input: { name: "West Coast Office" }) {
    id uuid name
  }
}

# Add user to company
mutation {
  addUserToCompany(user_id: 5, company_id: 1) { id }
}

Roles & Permissions

# List roles
query {
  roles(first: 50) {
    data { id name abilities { name } }
  }
}

# Check permission
query {
  can(check: "create-leads")
}