Employees
Manage employee records, including their codes and pins for device access.
List Employees
Retrieve a list of employees.
Endpoint: GET /public/v2/employees
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/employees" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/employees", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Get Employee
Retrieve a specific employee by ID.
Endpoint: GET /public/v2/employees/:id
- cURL
- JavaScript
curl -X GET "https://api.biosensei.io/public/v2/employees/12" \
-H "Authorization: Bearer <token>"
const response = await fetch("https://api.biosensei.io/public/v2/employees/12", {
method: "GET",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);
Create Employee
Register a new employee.
Endpoint: POST /public/v2/employees
- cURL
- JavaScript
curl -X POST "https://api.biosensei.io/public/v2/employees" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "John",
"lastname": "Doe",
"code": "EMP001",
"pin": "1234",
"email": "john.doe@example.com",
"company_id": 9
}'
const response = await fetch("https://api.biosensei.io/public/v2/employees", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "John",
lastname: "Doe",
code: "EMP001",
pin: "1234",
email: "john.doe@example.com",
company_id: 9
})
});
const data = await response.json();
console.log(data);
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | First name. |
lastname | string | Yes | Last name. |
code | string | Yes | Employee code (must be unique). |
pin | string | No | PIN for device access. |
email | string | No | Email address. |
company_id | integer | Yes | ID of the company. |
Update Employee
Update an existing employee's details.
Endpoint: PUT /public/v2/employees/:id
- cURL
- JavaScript
curl -X PUT "https://api.biosensei.io/public/v2/employees/14" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "John",
"lastname": "Doe Updated",
"code": "EMP001",
"pin": "5678",
"email": "john.doe@example.com",
"is_active": true
}'
const response = await fetch("https://api.biosensei.io/public/v2/employees/14", {
method: "PUT",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "John",
lastname: "Doe Updated",
code: "EMP001",
pin: "5678",
email: "john.doe@example.com",
is_active: true
})
});
const data = await response.json();
console.log(data);