POST
/api/public/v1/time-off-requests

Request time off

Files a request for the employee the token acts as — never for somebody else, which is why there is no `employeeId` here. The request goes to that employee’s assigned manager and to nobody else — the managers above that one can see it and may decide it, but only the direct manager is notified about it. Someone with no manager has nobody to wait on, so their request is approved on the spot rather than sitting PENDING forever; the response says which happened via `autoApproved`. Either way, whoever needs to know is notified in-app and by SMS.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.

hr:write

Request Body

PropertyTypeDescription
typestringKind of leave.
startDatestring`YYYY-MM-DD`.
endDatestring`YYYY-MM-DD`, on or after `startDate`.
startTimestring`HH:mm` (24-hour), for time off that covers part of a day. Send it with `endTime` or not at all — leave both out for whole days. Read in the employee’s own timezone; the response carries the resulting `startsAt`, `endsAt` and `timezone`.
endTimestring`HH:mm` (24-hour), on `endDate`. Must fall after `startDate` at `startTime`. Required whenever `startTime` is sent.
notestringContext for whoever reviews it.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/time-off-requests" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "VACATION",
    "startDate": "2026-09-14",
    "endDate": "2026-09-18",
    "note": "Family trip."
  }'
200Example response
json
{
  "message": "Time-off request submitted.",
  "content": {
    "request": {
      "id": "tor_31aa",
      "employeeId": "emp_44f1",
      "type": "VACATION",
      "status": "PENDING",
      "startDate": "2026-09-14",
      "endDate": "2026-09-18",
      "startsAt": null,
      "endsAt": null,
      "timezone": null,
      "note": "Family trip.",
      "reviewedById": null,
      "reviewedAt": null,
      "reviewNote": null,
      "createdAt": "2026-08-20T09:00:00.000Z",
      "updatedAt": "2026-08-20T09:00:00.000Z"
    },
    "autoApproved": false
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Employees → Time off
/employee/timeoff
  1. Open Time off.
  2. Request time off.
  3. Pick the dates and a reason.