Skip to main content
All technician endpoints are protected. Requests must include a valid JWT and the authenticated user must have the admin role.
Endpoints that accept file uploads (POST /api/admin/technicians and PUT /api/admin/technicians/:id) must use multipart/form-data encoding.

List technicians


GET /api/admin/technicians Returns all technician accounts ordered by creation date (newest first), each including their active vehicle assignment and inspection history.

Response

technicians
object[]

Errors

StatusDescription
401Missing or invalid JWT.
403Authenticated user does not have the admin role.
500Internal server error.
curl --request GET \
  --url https://your-api.example.com/api/admin/technicians \
  --header 'Authorization: Bearer <token>'

Get technician


GET /api/admin/technicians/:id Returns a single technician by ID.

Path parameters

id
number
required
The technician’s user ID.

Response

technician
object
Technician object with the same shape as described in List technicians.

Errors

StatusDescription
401Missing or invalid JWT.
403Authenticated user does not have the admin role.
404Technician not found.
500Internal server error.

Create technician


POST /api/admin/technicians Creates a new technician account. Send the request as multipart/form-data to optionally attach photos.

Request body

name
string
required
Technician’s full name.
email
string
required
Email address. Must be unique across all users.
password
string
Account password. Stored as a bcrypt hash. If omitted, defaults to the value of DEFAULT_LOGIN_PASSWORD (typically changeme123). Minimum 8 characters when provided.
driverLicenseNumber
string
Driver license number.
companyJoinDate
string
Date the technician joined the company in YYYY-MM-DD format.
technician_photo
file
Profile photo file upload (multipart field name: technician_photo).
driver_license_photo
file
Driver license photo file upload (multipart field name: driver_license_photo).

Response

Returns 201 Created with the new technician object (password hash is never returned).
technician
object
The created technician with the same shape as described in List technicians.

Errors

StatusDescription
400Validation failed — required fields missing or invalid.
401Missing or invalid JWT.
403Authenticated user does not have the admin role.
409A user with that email address already exists.
500Internal server error.
curl --request POST \
  --url https://your-api.example.com/api/admin/technicians \
  --header 'Authorization: Bearer <token>' \
  --form 'name=Carlos López' \
  --form '[email protected]' \
  --form 'password=SecurePass123' \
  --form 'driverLicenseNumber=DL-123456' \
  --form 'companyJoinDate=2023-03-01' \
  --form 'technician_photo=@/path/to/photo.jpg' \
  --form 'driver_license_photo=@/path/to/license.jpg'

Update technician


PUT /api/admin/technicians/:id Updates an existing technician. Send as multipart/form-data when uploading new photos. File fields are optional on update. If a file field is omitted, the existing stored URL is preserved. Pass an explicit empty string for driverLicensePhotoUrl or technicianPhotoUrl in the body to clear the stored URL. If password is provided, it is re-hashed and replaces the existing password. If omitted, the existing password is unchanged.

Path parameters

id
number
required
The technician’s user ID.

Request body

Accepts the same fields as Create technician. All fields are optional on update.

Response

Returns 200 OK with the updated technician object.
technician
object
Updated technician object.

Errors

StatusDescription
400Validation failed.
401Missing or invalid JWT.
403Authenticated user does not have the admin role.
404Technician not found.
409A user with that email address already exists.
500Internal server error.

Delete technician


DELETE /api/admin/technicians/:id Permanently deletes a technician account.

Path parameters

id
number
required
The technician’s user ID.

Response

Returns 204 No Content on success with an empty body.

Errors

StatusDescription
401Missing or invalid JWT.
403Authenticated user does not have the admin role.
404Technician not found.
500Internal server error.
curl --request DELETE \
  --url https://your-api.example.com/api/admin/technicians/5 \
  --header 'Authorization: Bearer <token>'

Build docs developers (and LLMs) love