Skip to content

Employee

The employee resource.

Base/employee
GET/employee

List employees

Retrieve a paginated list of employees. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GET/employee
curl --request GET \
  --url '<your-host>/employee?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "companyId": "xyz789",
    "employeeTypeId": "xyz789",
    "active": true,
    "pin": "string",
    "readableId": "xyz789"
  }
]
GET/employee

Retrieve a employee

Fetch a single employee by filtering on `id`.

Query parameters

idstring

Match on the employee's `id`, e.g. `eq.{id}`.

GET/employee
curl --request GET \
  --url '<your-host>/employee?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "employeeTypeId": "xyz789",
  "active": true,
  "pin": "string",
  "readableId": "xyz789"
}
POST/employee

Create a employee

Create a new employee.

Body parameters

employeeTypeIdstringrequired
activebooleanrequired
pinstring
readableIdstring
POST/employee
curl --request POST \
  --url <your-host>/employee \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"employeeTypeId":"xyz789","active":true}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "employeeTypeId": "xyz789",
  "active": true,
  "pin": "string",
  "readableId": "xyz789"
}
PATCH/employee

Update a employee

Update an existing employee, matched on `id`.

Body parameters

employeeTypeIdstringrequired
activebooleanrequired
pinstring
readableIdstring
PATCH/employee
curl --request PATCH \
  --url '<your-host>/employee?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"employeeTypeId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "employeeTypeId": "xyz789",
  "active": true,
  "pin": "string",
  "readableId": "xyz789"
}
DELETE/employee

Delete a employee

Delete a employee, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the employee to delete, e.g. `eq.{id}`.

DELETE/employee
curl --request DELETE \
  --url '<your-host>/employee?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content