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.
Name | Type | Description | Example |
---|---|---|---|
admin | boolean | If the user is an admin | true |
avatarUrl | string? | A url to a png or jpeg resource which will render as the user's account photo | "https://coolPics.com/mh.png" |
displayName | string | The user's display name | "Matt Hernandez" |
string | The user's unique email address | "mh@bestsales.com" | |
firstName | string | The user's first name | "Matt" |
id | ID | The unique user ID | "ckmnpybisiy5x08abky4g2d1f" |
lastName | string | The user's last name | "Hernandez" |
phone | string? | The user's phone number | "5131234567" |
role | UserRole | The user's role | "Field" |
UserRole
​
Value | Description |
---|---|
BackOffice | The user will have access to Kojo Office, but is not listed as a Purchasing Agent in various places |
Field | The user will have access to Kojo Jobsite |
FieldOrdering | The user will have access to Kojo Jobsite and may send Orders directly to vendors |
Procurement | The user will have access to Kojo Office |
Warehouse | The 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​
Name | Description | Example |
---|---|---|
id | The ID of the user to fetch | "cklbccanw0jgg0808mtwgry8w" |
The 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​
Name | Type | Default | Description | Example |
---|---|---|---|---|
admin | boolean? | false | If the user is an admin | true |
avatarUrl | string? | null | A url to a png or jpeg resource which will render as the user's account photo | "https://coolPics.com/mh.png" |
string | The user's unique email address | "mh@bestsales.com" | ||
firstName | string | The user's first name | "Matt" | |
lastName | string | The user's last name | "Hernandez" | |
phone | string? | null | The user's phone number | "5131234567" |
role | UserRole | The user's role | Field |
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"
}