User API

Fields

Field Name Unique? Validation
name   ^[a-zA-Z0-9_. ]+$
email ^[^@ ]+@[^@ ]+\.[^@ ]+$
employee_id    
contact_number    
license_number    
license_expiry_month    
license_expiry_year    
license_type    
license_country    
cost-centre_id    
activated-via-company-id    

Relationships

Resource 1-to-1 1-to-many many-to-1 many-to-many
company      
cost-centre      

Operations

GET /users

Returns a list of users. An accepted query parameter inactive may be set in order to alter the types of users returned.

By default, the returned users are active or pending users from the current company. By including inactive in the query string, returned users changes to inactive, non-pending users for the current company.

The result is returned as a list of { USER HASH } objects.

GET /user/ID

POST /user

Creates a new user resource. This endpoint accepts extra list data for perms, license-types, and branch_ids.

Newly created users are put in a pending state until activated.

Once the user hash is created in the datastore, a unique ticket is generated and saved with an expiry time. An email is sent out with the ticket which can then be submitted back to the API via /activate/TICKET.

PUT /user/ID

Updates a user resource.

Note

If password is a submitted field name, it will be removed before updating the user data.

DELETE /user/ID

GET /user/ID/assets

See also

Assets

GET /user/ID/assets/TAG

See also

Assets

POST /user/ID/assets/TAG

See also

Assets

GET /user/ID/bookings/DATETIMEPATH

See also

Bookings

GET /user/ID/perms

Returns a user’s list of permissions.

PUT /user/ID/perms

Resets a user’s permissions list to the supplied list of permission names.

Only admin and keaz users can add other users to admin and only keaz users can add other users to keaz.

GET /user/ID/license-types

Returns a user’s list of license types.

PUT /user/ID/license-types

Sets a user’s list of license types.

POST /user/ID/resend

Resends a user’s activation email.

GET /user/byemail

Identical to POST /.

POST /import/users

Accepts CSV data and creates users from it.