Skip to main content

Users

Kojo's Users endpoint helps provision and administer who is allowed access to the system, and what they're allowed to do.

Schema​

User​

important

Admins may perform any operation within Kojo, including modifying any entity such as jobs, orders, and users.

NameTypeDescriptionExample
adminbooleanIf the user is an admintrue
avatarUrlstring?A url to a png or jpeg resource which will render as the user's account photo"https://coolPics.com/mh.png"
displayNamestringThe user's display name"Matt Hernandez"
emailstringThe user's unique email address"mh@bestsales.com"
firstNamestringThe user's first name"Matt"
idIDThe unique user ID"ckmnpybisiy5x08abky4g2d1f"
jobsJob[]The list of jobs the user is assigned toSee the Jobs docs
lastNamestringThe user's last name"Hernandez"
phonestring?The user's phone number"5131234567"
roleUserRoleThe user's roleField

UserRole​

ValueDescription
BackOfficeThe user will have access to Kojo Office, but is not listed as a Purchasing Agent in various places
FieldThe user will have access to Kojo Jobsite
FieldOrderingThe user will have access to Kojo Jobsite and may send Orders directly to vendors
ProcurementThe user will have access to Kojo Office
WarehouseThe user will have access to the warehouse module in Kojo

Queries​

user​

Used to read a single user.

Parameters​

NameDescriptionExample
idThe ID of the user to fetch"ckmnpybisiy5x08abky4g2d1f"

Response​

A single User object.

Example Query​

query {
user(id: "ckmnpybisiy5x08abky4g2d1f") {
displayName
id
}
}

Example Response​

{
"displayName": "Matt Hernandez",
"id": "ckmnpybisiy5x08abky4g2d1f"
}

users​

Read all users, with pagination.

Parameters​

Accepts all standard pagination parameters.

Allowed orderBy fields: createdAt, displayName, email, id, updatedAt.

Allowed filter fields: admin, createdAt, displayName, email, id, phone, updatedAt.

Response​

A list of User objects.

Example Query​

query {
users(limit: 10, orderBy: displayName) {
displayName
id
}
}

Example Response​

[
{
"displayName": "Benji Orlansky",
"id": "ckmnpybisiy5x08abky4g2f1d"
},
{
"displayName": "Matt Hernandez",
"id": "ckmnpybisiy5x08abky4g2d1f"
}
]

Mutations​

addUserToJob​

See this mutation documented in Jobs.

removeUserFromJob​

See this mutation documented in Jobs.

inviteUser​

Creates a new user and sends them a registration email.

Parameters​

NameTypeDefaultDescriptionExample
adminboolean?falseIf the user is an admintrue
avatarUrlstring?nullA url to a png or jpeg resource which will render as the user's account photo"https://coolPics.com/mh.png"
emailstringThe user's unique email address"mh@bestsales.com"
firstNamestringThe user's first name"Matt"
lastNamestringThe user's last name"Hernandez"
phonestring?nullThe user's phone number"5131234567"
roleUserRoleThe user's roleField

Response​

The created User.

Example Mutation​

mutation {
inviteUser(
admin: true
email: "mh@bestsales.com"
firstName: "Matt"
lastName: "Hernandez"
role: BackOffice
) {
displayName
id
}
}

Example Response​

{
"displayName": "Matt Hernandez",
"id": "ckmnpybisiy5x08abky4g2d1f"
}