ETK PulseETK Pulsev1.0.0

ETK Pulse API

REST API for ETK Pulse - multi-tenant HR, payroll, attendance & double-entry finance. All tenant data is isolated by Postgres Row-Level Security; authentication is a NextAuth session cookie set by signing in. Money is always `Decimal` (string) - never float.

Base URL
https://your-host
Auth
NextAuth session cookie (sign in at /login)
Endpoints
110 operations across 19 groups

Auth

Sign-in and password management.

get/api/auth/{nextauth}Public

NextAuth handler

Catch-all NextAuth route: session, CSRF, callbacks, sign-out.

Responses
200OK
Example request
bash
curl -X GET 'https://your-host/api/auth/{nextauth}'
post/api/auth/{nextauth}Public

NextAuth handler (credentials sign-in, sign-out)

Responses
200OK
Example request
bash
curl -X POST 'https://your-host/api/auth/{nextauth}'
post/api/auth/change-passwordAuthenticated

Change your password

Request body
FieldTypeReqNotes
currentPasswordstringyes-
newPasswordstringyesmin len 8
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X POST 'https://your-host/api/auth/change-password' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"currentPassword":"oldpass123","newPassword":"n3w-strong-pass"}'
Request payload
request.json
{
  "currentPassword": "oldpass123",
  "newPassword": "n3w-strong-pass"
}
Example response · 200
200.json
{
  "ok": true
}

Attendance

Employee clock in/out, breaks, and self-service edits.

post/api/attendance/clock-inAuthenticated

Clock in

Starts a work session. Idempotent via `clientEventId` (offline replay-safe). Location captured only if the workspace enables it.

Request body
FieldTypeReqNotes
latnumber--
lngnumber--
clientEventIdstring-min len 8
clientTimestring-format date-time
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X POST 'https://your-host/api/attendance/clock-in' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"clientEventId":"evt_3f9ab1c2d4","clientTime":"2026-06-09T08:30:00.000Z"}'
Request payload
request.json
{
  "clientEventId": "evt_3f9ab1c2d4",
  "clientTime": "2026-06-09T08:30:00.000Z"
}
Example response · 200
200.json
{
  "session": {
    "id": "ckxyz",
    "clockInAt": "2026-06-09T08:30:00.000Z",
    "clockOutAt": null
  }
}
post/api/attendance/clock-outAuthenticated

Clock out

Request body
FieldTypeReqNotes
latnumber--
lngnumber--
clientEventIdstring-min len 8
clientTimestring-format date-time
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X POST 'https://your-host/api/attendance/clock-out' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"clientEventId":"evt_9c1b7a","clientTime":"2026-06-09T17:00:00.000Z"}'
Request payload
request.json
{
  "clientEventId": "evt_9c1b7a",
  "clientTime": "2026-06-09T17:00:00.000Z"
}
post/api/attendance/start-breakAuthenticated

Start a break

Request body
FieldTypeReqNotes
clientEventIdstring-min len 8
clientTimestring-format date-time
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X POST 'https://your-host/api/attendance/start-break' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/attendance/end-breakAuthenticated

End a break

Request body
FieldTypeReqNotes
breakIdstringyes-
clientEventIdstring-min len 8
clientTimestring-format date-time
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X POST 'https://your-host/api/attendance/end-break' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"breakId":"brk_123"}'
Request payload
request.json
{
  "breakId": "brk_123"
}
patch/api/attendance/sessions/{sessionId}Authenticated

Edit your own attendance session

Self-edit of clock in/out + note. Allowed **only** when the workspace has enabled “Allow manual time edits”; otherwise returns 403. Worked/overtime are recomputed server-side.

Parameters
ParameterInReqDescription
sessionIdpathyes-
Request body
FieldTypeReqNotes
clockInAtstring-format date-time
clockOutAtstring | null-format date-time
notestring | null--
Responses
200OK
400Invalid request body
401Not authenticated
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/attendance/sessions/{sessionId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"clockInAt":"2026-06-09T08:45:00.000Z","note":"Adjusted - badge reader was down"}'
Request payload
request.json
{
  "clockInAt": "2026-06-09T08:45:00.000Z",
  "note": "Adjusted - badge reader was down"
}
get/api/attendance/exportAuthenticated

Export your attendance (CSV)

Parameters
ParameterInReqDescription
startquery-YYYY-MM-DD
endquery-YYYY-MM-DD
Responses
200OK· CSV download
401Not authenticated
Example request
bash
curl -X GET 'https://your-host/api/attendance/export' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Admin · Attendance

Workspace-admin attendance management, import & export.

post/api/admin/attendance/sessionsAdmin

Create an attendance session

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
employeeIdstringyes-
clockInAtstringyesformat date-time
clockOutAtstring | null-format date-time
timezonestring--
notestring | null--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/admin/attendance/sessions' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"employeeId":"emp_123","clockInAt":"2026-06-09T08:30:00.000Z","clockOutAt":"2026-06-09T17:00:00.000Z"}'
Request payload
request.json
{
  "employeeId": "emp_123",
  "clockInAt": "2026-06-09T08:30:00.000Z",
  "clockOutAt": "2026-06-09T17:00:00.000Z"
}
patch/api/admin/attendance/sessions/{sessionId}Admin

Update an attendance session

Parameters
ParameterInReqDescription
sessionIdpathyes-
Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
clockInAtstring-format date-time
clockOutAtstring | null-format date-time
timezonestring--
notestring | null--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/admin/attendance/sessions/{sessionId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/admin/attendance/sessions/{sessionId}Admin

Delete an attendance session

Parameters
ParameterInReqDescription
sessionIdpathyes-
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/admin/attendance/sessions/{sessionId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/admin/attendance/importAdmin

Bulk-import attendance rows

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
rowsarray<object>yes-
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/admin/attendance/import' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"rows":[{"employeeEmail":"jane@acme.com","clockInAt":"2026-06-09T08:30:00Z","clockOutAt":"2026-06-09T17:00:00Z"}]}'
Request payload
request.json
{
  "rows": [
    {
      "employeeEmail": "jane@acme.com",
      "clockInAt": "2026-06-09T08:30:00Z",
      "clockOutAt": "2026-06-09T17:00:00Z"
    }
  ]
}
get/api/admin/attendance/exportAdmin

Export company attendance (CSV)

Parameters
ParameterInReqDescription
orgIdquery--
teamIdquery--
employeeIdquery--
startquery-YYYY-MM-DD
endquery-YYYY-MM-DD
exceptionsquery-1 = only exceptions
includeBreaksquery-0 to exclude
Responses
200OK· CSV download
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/attendance/export' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Admin · People

Employees, teams, and positions.

get/api/admin/employeesAdmin

List employees

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/employees' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
Example response · 200
200.json
{
  "employees": [
    {
      "id": "emp_123",
      "fullName": "Jane Doe",
      "teamId": "team_1"
    }
  ]
}
patch/api/admin/employees/{employeeId}Admin

Update an employee

Parameters
ParameterInReqDescription
employeeIdpathyes-
Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
fullNamestring-min len 1
emailstring-format email
teamIdstring | null--
positionIdstring | null--
baseSalaryCurrencystring-USD · EGP
baseSalaryAmountnumber-≥ 0
overtimeRateUsdPerHournumber-≥ 0
expectedHoursPerDaynumber-> 0
expectedDaysPerWeekinteger-≥ 1 · ≤ 7
timezonestring--
isActiveboolean--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/admin/employees/{employeeId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/admin/teamsAdmin

List teams

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/teams' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/admin/teamsAdmin

Create a team

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
namestringyesmin len 1
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/admin/teams' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Engineering"}'
Request payload
request.json
{
  "name": "Engineering"
}
patch/api/admin/teams/{teamId}Admin

Rename a team

Parameters
ParameterInReqDescription
teamIdpathyes-
Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
namestring-min len 1
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/admin/teams/{teamId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/admin/teams/{teamId}Admin

Delete a team

Parameters
ParameterInReqDescription
teamIdpathyes-
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/admin/teams/{teamId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/admin/positionsAdmin

List positions

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/positions' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/admin/positionsAdmin

Create a position

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
titlestringyesmin len 1
defaultOvertimeRateUsdnumber-≥ 0
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/admin/positions' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"title":"Senior Engineer","defaultOvertimeRateUsd":25}'
Request payload
request.json
{
  "title": "Senior Engineer",
  "defaultOvertimeRateUsd": 25
}
patch/api/admin/positions/{positionId}Admin

Update a position

Parameters
ParameterInReqDescription
positionIdpathyes-
Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
titlestring-min len 1
defaultOvertimeRateUsdnumber | null-≥ 0
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/admin/positions/{positionId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/admin/positions/{positionId}Admin

Delete a position

Parameters
ParameterInReqDescription
positionIdpathyes-
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/admin/positions/{positionId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Admin · Shifts

Shift definitions and per-employee assignments.

get/api/admin/shiftsAdmin

List shifts (with teams)

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/shifts' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/admin/shiftsAdmin

Create a shift

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
titlestringyesmin len 1
teamIdstring | null--
typestring-FIXED · FLEXIBLE · ON_CALL
visibilitystring-ALL · TEAM · PRIVATE
daysOfWeekarray<integer>-0=Sun … 6=Sat. Empty = every day.
startTimeLocalstring | null-e.g. "09:00"
endTimeLocalstring | null-e.g. "17:00"
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/admin/shifts' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"title":"Morning Shift","visibility":"TEAM","daysOfWeek":[1,2,3,4,5],"startTimeLocal":"09:00","endTimeLocal":"17:00"}'
Request payload
request.json
{
  "title": "Morning Shift",
  "visibility": "TEAM",
  "daysOfWeek": [
    1,
    2,
    3,
    4,
    5
  ],
  "startTimeLocal": "09:00",
  "endTimeLocal": "17:00"
}
patch/api/admin/shifts/{shiftId}Admin

Update a shift

Parameters
ParameterInReqDescription
shiftIdpathyes-
Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
titlestring-min len 1
teamIdstring | null--
typestring-FIXED · FLEXIBLE · ON_CALL
visibilitystring-ALL · TEAM · PRIVATE
daysOfWeekarray<integer>--
startTimeLocalstring | null--
endTimeLocalstring | null--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/admin/shifts/{shiftId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/admin/shifts/{shiftId}Admin

Delete a shift

Parameters
ParameterInReqDescription
shiftIdpathyes-
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/admin/shifts/{shiftId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/admin/shifts/{shiftId}/assignmentsAdmin

List assigned employees

Parameters
ParameterInReqDescription
shiftIdpathyes-
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X GET 'https://your-host/api/admin/shifts/{shiftId}/assignments' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
Example response · 200
200.json
{
  "employeeIds": [
    "emp_123",
    "emp_456"
  ]
}
post/api/admin/shifts/{shiftId}/assignmentsAdmin

Assign an employee to a shift

Parameters
ParameterInReqDescription
shiftIdpathyes-
Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
employeeIdstringyes-
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/admin/shifts/{shiftId}/assignments' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"employeeId":"emp_123"}'
Request payload
request.json
{
  "employeeId": "emp_123"
}
delete/api/admin/shifts/{shiftId}/assignmentsAdmin

Unassign an employee

Parameters
ParameterInReqDescription
shiftIdpathyes-
employeeIdqueryyesEmployee to unassign
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/admin/shifts/{shiftId}/assignments' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Admin · Time Off

Leave types and request approvals.

get/api/admin/timeoff/requestsAdmin

List time-off requests

Parameters
ParameterInReqDescription
statusquery-PENDING | APPROVED | DENIED | …
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/timeoff/requests' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
patch/api/admin/timeoff/requestsAdmin

Approve / deny / postpone a request

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
requestIdstringyes-
actionstringyesAPPROVE · DENY · POSTPONE
adminNotestring--
postponedUntilstring-format date
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X PATCH 'https://your-host/api/admin/timeoff/requests' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"requestId":"to_1","action":"APPROVE"}'
Request payload
request.json
{
  "requestId": "to_1",
  "action": "APPROVE"
}
get/api/admin/timeoff/typesAdmin

List leave types

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/timeoff/types' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/admin/timeoff/typesAdmin

Create a leave type

Request body
FieldTypeReqNotes
namestringyesmin len 1
isPaidboolean--
requiresApprovalboolean--
maxPerYearDaysnumber-> 0
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/admin/timeoff/types' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Vacation","isPaid":true,"requiresApproval":true}'
Request payload
request.json
{
  "name": "Vacation",
  "isPaid": true,
  "requiresApproval": true
}
put/api/admin/timeoff/typesAdmin

Update a leave type

Request body
FieldTypeReqNotes
idstringyes-
namestring-min len 1
isPaidboolean--
requiresApprovalboolean--
maxPerYearDaysnumber-> 0
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X PUT 'https://your-host/api/admin/timeoff/types' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/admin/timeoff/typesAdmin

Delete a leave type

Request body
FieldTypeReqNotes
idstringyes-
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X DELETE 'https://your-host/api/admin/timeoff/types' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Admin · Settings

Workspace policy and finance settings.

get/api/admin/settingsAdmin

Get workspace settings

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/settings' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
patch/api/admin/settingsAdmin

Update workspace settings

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
firstDayOfWeekstring-MONDAY · SUNDAY
defaultTimezonestring--
allowedCurrenciesarray<string>--
allowPickOpenShiftsboolean--
allowDropShiftsboolean--
recordClockLocationboolean--
allowManualTimeEditsboolean--
enableFinanceboolean--
defaultExpectedHoursPerDaynumber-≤ 24 · > 0
overtimeGraceMinutesinteger-≥ 0 · ≤ 240
overtimeMultipliernumber-≥ 0.25 · ≤ 5
payrollRoundingstring-NONE · NEAREST_1 · NEAREST_5 · NEAREST_10
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X PATCH 'https://your-host/api/admin/settings' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"recordClockLocation":true,"allowManualTimeEdits":false}'
Request payload
request.json
{
  "recordClockLocation": true,
  "allowManualTimeEdits": false
}
get/api/admin/settings/financeAdmin

Get finance settings

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/admin/settings/finance' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
patch/api/admin/settings/financeAdmin

Update finance settings

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
baseCurrencystring-USD · EGP
fiscalYearStartMonthinteger-≥ 1 · ≤ 12
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X PATCH 'https://your-host/api/admin/settings/finance' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Me

Employee self-service (profile, time off, payslips).

patch/api/me/profileAuthenticated

Update your profile

Request body
FieldTypeReqNotes
timezonestring--
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X PATCH 'https://your-host/api/me/profile' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"timezone":"Africa/Cairo"}'
Request payload
request.json
{
  "timezone": "Africa/Cairo"
}
get/api/me/timeoff/requestsAuthenticated

List your time-off requests

Responses
200OK
401Not authenticated
Example request
bash
curl -X GET 'https://your-host/api/me/timeoff/requests' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/me/timeoff/requestsAuthenticated

Request time off

Request body
FieldTypeReqNotes
typeIdstringyes-
startDatestringyesformat date
endDatestringyesformat date
durationHoursnumber-> 0
reasonstring-max len 500
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X POST 'https://your-host/api/me/timeoff/requests' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"typeId":"tot_1","startDate":"2026-07-01","endDate":"2026-07-05","reason":"Family trip"}'
Request payload
request.json
{
  "typeId": "tot_1",
  "startDate": "2026-07-01",
  "endDate": "2026-07-05",
  "reason": "Family trip"
}
delete/api/me/timeoff/requests/{requestId}Authenticated

Cancel a pending request

Parameters
ParameterInReqDescription
requestIdpathyes-
Responses
200OK
401Not authenticated
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/me/timeoff/requests/{requestId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/me/timeoff/typesAuthenticated

List leave types available to you

Responses
200OK
401Not authenticated
Example request
bash
curl -X GET 'https://your-host/api/me/timeoff/types' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/me/payslips/{payslipId}/exportAuthenticated

Download your payslip (PDF)

Parameters
ParameterInReqDescription
payslipIdpathyes-
Responses
200OK· PDF download
401Not authenticated
404Not found
Example request
bash
curl -X GET 'https://your-host/api/me/payslips/{payslipId}/export' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Payroll

Payroll runs, line items, and posting to the ledger.

get/api/payroll/runsAdmin

List payroll runs

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/payroll/runs' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/payroll/runsAdmin

Create a payroll run

Request body
FieldTypeReqNotes
periodStartstringyesformat date
periodEndstringyesformat date
defaultUsdToEgpRatenumberyes> 0
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/payroll/runs' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"periodStart":"2026-06-01","periodEnd":"2026-06-30","defaultUsdToEgpRate":48.5}'
Request payload
request.json
{
  "periodStart": "2026-06-01",
  "periodEnd": "2026-06-30",
  "defaultUsdToEgpRate": 48.5
}
get/api/payroll/runs/{runId}Admin

Get a payroll run

Parameters
ParameterInReqDescription
runIdpathyes-
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X GET 'https://your-host/api/payroll/runs/{runId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/payroll/runs/{runId}Admin

Recalculate a payroll run

Parameters
ParameterInReqDescription
runIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/payroll/runs/{runId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
put/api/payroll/runs/{runId}/line-itemsAdmin

Override a run line item

Parameters
ParameterInReqDescription
runIdpathyes-
Request body
FieldTypeReqNotes
employeeIdstringyes-
usdToEgpRateUsednumber-> 0
overtimeRateUsdPerHournumber-≥ 0
baseSalaryAmountnumber-≥ 0
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PUT 'https://your-host/api/payroll/runs/{runId}/line-items' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/payroll/runs/{runId}/post-to-ledgerAdmin

Post a payroll run to the ledger

Emits balanced double-entry journal entries tagged with the payroll source.

Parameters
ParameterInReqDescription
runIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/payroll/runs/{runId}/post-to-ledger' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Payslips

Payslip records and PDF export.

get/api/payslips/{payslipId}Admin

Get a payslip

Parameters
ParameterInReqDescription
payslipIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X GET 'https://your-host/api/payslips/{payslipId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/payslips/{payslipId}/exportAdmin

Download a payslip (PDF)

Parameters
ParameterInReqDescription
payslipIdpathyes-
Responses
200OK· PDF download
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X GET 'https://your-host/api/payslips/{payslipId}/export' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Finance

Double-entry ledger: accounts, journals, periods, expenses, recurring items, banking.

get/api/finance/accountsAdmin

List chart of accounts

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/finance/accounts' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/accountsAdmin

Create an account

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
codestringyesmin len 1 · max len 32
namestringyesmin len 1 · max len 200
typestringyesASSET · LIABILITY · EQUITY · INCOME · EXPENSE
parentAccountIdstring--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/finance/accounts' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"code":"6000","name":"Office Supplies","type":"EXPENSE"}'
Request payload
request.json
{
  "code": "6000",
  "name": "Office Supplies",
  "type": "EXPENSE"
}
get/api/finance/journalsAdmin

List journal entries

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/finance/journals' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/journalsAdmin

Create a journal entry (draft)

Lines must balance (Σ debit = Σ credit). At least two lines.

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
entryDatestringyesformat date
memostring-max len 2000
linesarray<object>yes-
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/finance/journals' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"entryDate":"2026-06-09","memo":"Office supplies","lines":[{"accountId":"acc_exp","debit":100},{"accountId":"acc_cash","credit":100}]}'
Request payload
request.json
{
  "entryDate": "2026-06-09",
  "memo": "Office supplies",
  "lines": [
    {
      "accountId": "acc_exp",
      "debit": 100
    },
    {
      "accountId": "acc_cash",
      "credit": 100
    }
  ]
}
post/api/finance/journals/{journalEntryId}/postAdmin

Post a draft journal entry

Parameters
ParameterInReqDescription
journalEntryIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/finance/journals/{journalEntryId}/post' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/journals/{journalEntryId}/reverseAdmin

Reverse a posted journal entry

Parameters
ParameterInReqDescription
journalEntryIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/finance/journals/{journalEntryId}/reverse' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/finance/periodsAdmin

List finance periods

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/finance/periods' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/periodsAdmin

Open a finance period

Request body
FieldTypeReqNotes
yearintegeryes≥ 2000 · ≤ 2100
monthintegeryes≥ 1 · ≤ 12
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/finance/periods' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"year":2026,"month":6}'
Request payload
request.json
{
  "year": 2026,
  "month": 6
}
delete/api/finance/periodsAdmin

Close / delete a period

Request body
FieldTypeReqNotes
yearintegeryes-
monthintegeryes-
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X DELETE 'https://your-host/api/finance/periods' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/expenseAdmin

Record an expense

Convenience endpoint that books a balanced expense entry.

Request body
FieldTypeReqNotes
entryDatestringyesformat date
amountnumberyes> 0
expenseAccountIdstringyes-
paymentAccountIdstringyes-
memostring-max len 2000
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/finance/expense' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"entryDate":"2026-06-09","amount":250,"expenseAccountId":"acc_exp","paymentAccountId":"acc_bank"}'
Request payload
request.json
{
  "entryDate": "2026-06-09",
  "amount": 250,
  "expenseAccountId": "acc_exp",
  "paymentAccountId": "acc_bank"
}
get/api/finance/recurringAdmin

List recurring items

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/finance/recurring' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/recurringAdmin

Create a recurring item

Request body
FieldTypeReqNotes
namestringyesmin len 1 · max len 120
kindstringyesINCOME · EXPENSE
amountnumberyes> 0
cadencestringyesMONTHLY · YEARLY
accountIdstringyes-
counterAccountIdstringyes-
nextRunOnstringyesformat date
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/finance/recurring' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Office rent","kind":"EXPENSE","amount":1200,"cadence":"MONTHLY","accountId":"acc_rent","counterAccountId":"acc_bank","nextRunOn":"2026-07-01"}'
Request payload
request.json
{
  "name": "Office rent",
  "kind": "EXPENSE",
  "amount": 1200,
  "cadence": "MONTHLY",
  "accountId": "acc_rent",
  "counterAccountId": "acc_bank",
  "nextRunOn": "2026-07-01"
}
patch/api/finance/recurring/{itemId}Admin

Update a recurring item

Parameters
ParameterInReqDescription
itemIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/finance/recurring/{itemId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/finance/recurring/{itemId}Admin

Delete a recurring item

Parameters
ParameterInReqDescription
itemIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/finance/recurring/{itemId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/recurring/{itemId}/bookAdmin

Book a recurring item now

Parameters
ParameterInReqDescription
itemIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/finance/recurring/{itemId}/book' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/finance/bank-accountsAdmin

List bank accounts

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/finance/bank-accounts' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/bank-accountsAdmin

Create a bank account

Request body
FieldTypeReqNotes
namestringyesmin len 1 · max len 120
institutionstring-max len 120
currencystring-USD · EGP
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/finance/bank-accounts' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Operating - CIB","currency":"EGP"}'
Request payload
request.json
{
  "name": "Operating - CIB",
  "currency": "EGP"
}
post/api/finance/bank-accounts/{bankAccountId}/importAdmin

Import bank transactions

Parameters
ParameterInReqDescription
bankAccountIdpathyes-
Request body
FieldTypeReqNotes
sourcestring-max len 120
rowsarray<object>yes-
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/finance/bank-accounts/{bankAccountId}/import' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
patch/api/finance/bank-transactions/{transactionId}Admin

Match / unmatch / ignore a transaction

Parameters
ParameterInReqDescription
transactionIdpathyes-
Request body
FieldTypeReqNotes
actionstringyesMATCH · UNMATCH · IGNORE
journalEntryIdstring--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/finance/bank-transactions/{transactionId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"action":"MATCH","journalEntryId":"je_1"}'
Request payload
request.json
{
  "action": "MATCH",
  "journalEntryId": "je_1"
}
get/api/finance/reports/exportAdmin

Export a finance report (CSV)

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK· CSV download
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/finance/reports/export' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/finance/seedAdmin

Seed a default chart of accounts

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/finance/seed' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Contracts

Contract templates, generation, and e-signature.

get/api/contracts/templatesAdmin

List contract templates

Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/contracts/templates' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/contracts/templatesAdmin

Create a template

Request body
FieldTypeReqNotes
titlestringyesmin len 1
languagestring-EN · AR · BOTH
directionstring-LTR · RTL
contentHtmlstringyesmin len 1
fieldsSchemaobject--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/contracts/templates' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/contracts/templates/{templateId}Admin

Get a template

Parameters
ParameterInReqDescription
templateIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X GET 'https://your-host/api/contracts/templates/{templateId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
put/api/contracts/templates/{templateId}Admin

Update a template

Parameters
ParameterInReqDescription
templateIdpathyes-
Request body
FieldTypeReqNotes
titlestring--
languagestring-EN · AR · BOTH
directionstring-LTR · RTL
contentHtmlstring--
fieldsSchemaobject--
overlaySchemaobject--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X PUT 'https://your-host/api/contracts/templates/{templateId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/contracts/templates/{templateId}Admin

Delete a template

Parameters
ParameterInReqDescription
templateIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X DELETE 'https://your-host/api/contracts/templates/{templateId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/contracts/templates/{templateId}/uploadAdmin

Upload a DOCX template

multipart/form-data DOCX, converted to HTML via mammoth.

Parameters
ParameterInReqDescription
templateIdpathyes-
Responses
200OK
401Not authenticated
403Insufficient role
404Not found
Example request
bash
curl -X POST 'https://your-host/api/contracts/templates/{templateId}/upload' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/contracts/createAdmin

Generate a contract from a template

Request body
FieldTypeReqNotes
templateIdstringyes-
employeeIdstringyes-
allowEmployeeEditsboolean--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/contracts/create' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"templateId":"tpl_1","employeeId":"emp_123"}'
Request payload
request.json
{
  "templateId": "tpl_1",
  "employeeId": "emp_123"
}
get/api/contracts/{contractId}Authenticated

Get a contract

Parameters
ParameterInReqDescription
contractIdpathyes-
Responses
200OK
401Not authenticated
404Not found
Example request
bash
curl -X GET 'https://your-host/api/contracts/{contractId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
put/api/contracts/{contractId}Authenticated

Update field values

Parameters
ParameterInReqDescription
contractIdpathyes-
Request body
FieldTypeReqNotes
fieldValuesobjectyes-
Responses
200OK
400Invalid request body
401Not authenticated
404Not found
Example request
bash
curl -X PUT 'https://your-host/api/contracts/{contractId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
patch/api/contracts/{contractId}Authenticated

Change contract status

Parameters
ParameterInReqDescription
contractIdpathyes-
Request body
FieldTypeReqNotes
statusstringyesSENT · VOID
Responses
200OK
400Invalid request body
401Not authenticated
404Not found
Example request
bash
curl -X PATCH 'https://your-host/api/contracts/{contractId}' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"status":"SENT"}'
Request payload
request.json
{
  "status": "SENT"
}
post/api/contracts/{contractId}/signAuthenticated

Sign a contract

Parameters
ParameterInReqDescription
contractIdpathyes-
Request body
FieldTypeReqNotes
signatureTypestringyesDRAWN · TYPED · UPLOADED
typedNamestring--
signatureImageDataUrlstring--
consentboolean--
Responses
200OK
400Invalid request body
401Not authenticated
404Not found
Example request
bash
curl -X POST 'https://your-host/api/contracts/{contractId}/sign' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"signatureType":"TYPED","typedName":"Jane Doe","consent":true}'
Request payload
request.json
{
  "signatureType": "TYPED",
  "typedName": "Jane Doe",
  "consent": true
}
get/api/contracts/{contractId}/exportAuthenticated

Download a contract (PDF)

Parameters
ParameterInReqDescription
contractIdpathyes-
Responses
200OK· PDF download
401Not authenticated
404Not found
Example request
bash
curl -X GET 'https://your-host/api/contracts/{contractId}/export' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Notifications

In-app notification inbox.

get/api/notificationsAuthenticated

List your notifications

Responses
200OK
401Not authenticated
Example request
bash
curl -X GET 'https://your-host/api/notifications' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
patch/api/notificationsAuthenticated

Mark read / archive / delete

Request body
FieldTypeReqNotes
actionstringyesMARK_ALL_READ · MARK_READ · ARCHIVE · DELETE
idsarray<string>--
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X PATCH 'https://your-host/api/notifications' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"action":"MARK_READ","ids":["ntf_1"]}'
Request payload
request.json
{
  "action": "MARK_READ",
  "ids": [
    "ntf_1"
  ]
}

Status

User presence (online/offline).

get/api/statusAuthenticated

Get your presence

Responses
200OK
401Not authenticated
Example request
bash
curl -X GET 'https://your-host/api/status' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
Example response · 200
200.json
{
  "status": "ONLINE"
}
put/api/statusAuthenticated

Set your presence

Request body
FieldTypeReqNotes
statusstringyesONLINE · OFFLINE
Responses
200OK
400Invalid request body
401Not authenticated
Example request
bash
curl -X PUT 'https://your-host/api/status' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"status":"ONLINE"}'
Request payload
request.json
{
  "status": "ONLINE"
}

Billing

Stripe-ready billing (dark until keys exist).

post/api/billing/checkoutAdmin

Start a checkout session

Stripe-ready; returns a checkout URL once billing is enabled (otherwise dark).

Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/billing/checkout' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/billing/webhookPublic

Stripe webhook

Verified by Stripe signature header (no session).

Responses
200OK
Example request
bash
curl -X POST 'https://your-host/api/billing/webhook'

Integrations

Third-party connectors and inbound webhooks.

get/api/integrations/providersSuper Admin

List integration providers

Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/integrations/providers' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/integrations/providersSuper Admin

Register a provider

Request body
FieldTypeReqNotes
keystringyesmin len 2 · max len 64
namestringyesmin len 2 · max len 200
categorystring-max len 64
capabilitiesobject--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/integrations/providers' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"key":"slack","name":"Slack"}'
Request payload
request.json
{
  "key": "slack",
  "name": "Slack"
}
get/api/integrations/webhook-endpointsAdmin

List webhook endpoints

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/integrations/webhook-endpoints' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/integrations/webhook-endpointsAdmin

Create a webhook endpoint

Request body
FieldTypeReqNotes
orgIdstring-Super-admin only: act within this workspace.
providerKeystringyesmin len 2 · max len 64
signingSecretstringyesmin len 8 · max len 500
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/integrations/webhook-endpoints' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/integrations/webhooks/{providerKey}Public

Inbound provider webhook

Verified by the provider's signing secret (no session).

Parameters
ParameterInReqDescription
providerKeypathyes-
Responses
200OK
404Not found
Example request
bash
curl -X POST 'https://your-host/api/integrations/webhooks/{providerKey}'

Super Admin

Platform operations: workspaces, users, audit.

get/api/super/orgsSuper Admin

List workspaces

Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/super/orgs' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/super/orgsSuper Admin

Create a workspace

Request body
FieldTypeReqNotes
namestring-min len 1
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/super/orgs' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Acme Inc."}'
Request payload
request.json
{
  "name": "Acme Inc."
}
put/api/super/orgsSuper Admin

Update a workspace

Request body
FieldTypeReqNotes
idstring--
namestring--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X PUT 'https://your-host/api/super/orgs' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
delete/api/super/orgsSuper Admin

Delete a workspace

Request body
FieldTypeReqNotes
idstringyes-
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X DELETE 'https://your-host/api/super/orgs' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/super/usersSuper Admin

List users across workspaces

Parameters
ParameterInReqDescription
orgIdquery--
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/super/users' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
post/api/super/usersSuper Admin

Create a user

Request body
FieldTypeReqNotes
emailstringyesformat email
namestring--
rolestringyesSUPER_ADMIN · ADMIN · EMPLOYEE
organizationIdstringyes-
tempPasswordstringyesmin len 8
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X POST 'https://your-host/api/super/users' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE' \
  -H 'Content-Type: application/json' \
  -d '{"email":"new@acme.com","role":"ADMIN","organizationId":"org_1","tempPassword":"temp-pass-123"}'
Request payload
request.json
{
  "email": "new@acme.com",
  "role": "ADMIN",
  "organizationId": "org_1",
  "tempPassword": "temp-pass-123"
}
patch/api/super/usersSuper Admin

Update a user

Request body
FieldTypeReqNotes
userIdstringyes-
rolestring-SUPER_ADMIN · ADMIN · EMPLOYEE
organizationIdstring--
namestring--
tempPasswordstring-min len 8
attendanceboolean--
payrollboolean--
contractsboolean--
notificationsboolean--
timeOffboolean--
Responses
200OK
400Invalid request body
401Not authenticated
403Insufficient role
Example request
bash
curl -X PATCH 'https://your-host/api/super/users' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'
get/api/super/auditSuper Admin

Query the audit log

Parameters
ParameterInReqDescription
actorEmailquery--
targetEmailquery--
actionquery--
takequery-Max rows
Responses
200OK
401Not authenticated
403Insufficient role
Example request
bash
curl -X GET 'https://your-host/api/super/audit' \
  -b 'next-auth.session-token=YOUR_SESSION_COOKIE'

Support

Support tickets.

post/api/support/ticketsPublic

Submit a support ticket

Request body
FieldTypeReqNotes
subjectstringyesmin len 4 · max len 200
bodyMarkdownstringyesmin len 10 · max len 10000
categorystring-max len 64
prioritystring-max len 16
Responses
200OK
400Invalid request body
Example request
bash
curl -X POST 'https://your-host/api/support/tickets' \
  -H 'Content-Type: application/json' \
  -d '{"subject":"Cannot clock in","bodyMarkdown":"The clock-in button is greyed out on iOS."}'
Request payload
request.json
{
  "subject": "Cannot clock in",
  "bodyMarkdown": "The clock-in button is greyed out on iOS."
}

Help

Public knowledge-base search.

get/api/help/quickPublic

Quick help suggestions

Parameters
ParameterInReqDescription
qquery-Search query
Responses
200OK
Example request
bash
curl -X GET 'https://your-host/api/help/quick'