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"
lastNamestringThe user's last name"Hernandez"
phonestring?The user's phone number"5131234567"
roleUserRoleThe user's role"Field"

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

REST Endpoints​

GET /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 Request​

GET https://api.kojo.tech/users?limit=10&offset=20

Example Response​

[
{
"id": "cklbccanw0jgg0808mtwgry8w",
"admin": true,
"avatarUrl": null,
"displayName": "Procurement Agent",
"createdAt": "2021-02-18T20:52:47.996Z",
"email": "procurement@usekojo.com",
"firstName": "Procurement",
"lastName": "Agent",
"phone": "650-382-9051",
"role": "Procurement",
"updatedAt": "2021-02-18T20:52:47.996Z"
}
]

GET /users/:idOrEmail​

Read a single user by ID or email.

Parameters​

NameDescriptionExample
idThe ID of the user to fetch"cklbccanw0jgg0808mtwgry8w"
emailThe user code of the user to fetch"procurement@usekojo.com"

Response​

A single User object.

Example Request​

GET https://api.kojo.tech/users/procurement2@usekojo.com

Example Response​

{
"id": "cklbccanw0jgg0808mtwgry8w",
"admin": true,
"avatarUrl": null,
"displayName": "Procurement Agent",
"createdAt": "2021-02-18T20:52:47.996Z",
"email": "procurement@usekojo.com",
"firstName": "Procurement",
"lastName": "Agent",
"phone": "650-382-9051",
"role": "Procurement",
"updatedAt": "2021-02-18T20:52:47.996Z"
}

POST /users​

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 Request​

POST https://api.kojo.tech/users
{
"admin": true,
"email": "jackblack+2@usekojo.com",
"firstName": "Jack",
"lastName": "Black",
"role": "Field"
}

Example Response​

{
"id": "cklbccao70jgl0808zaugwi52",
"admin": true,
"avatarUrl": null,
"displayName": "Procurement Agent2",
"createdAt": "2021-02-18T20:52:48.007Z",
"email": "procurement2@usekojo.com",
"firstName": "Procurement",
"lastName": "Agent2",
"phone": "650-382-9051",
"role": "Procurement",
"updatedAt": "2021-02-18T20:52:48.007Z"
}