API reference
Every tRPC procedure and HTTP route, generated from the source
Generated by node scripts/generate-api-docs.mjs — do not edit by hand. Run it after changing a router.
Three clients share this API: the console (web), the app (Flutter), and the HTTP routes the
phone calls directly for punches and photos. Nothing here is app-only or web-only — that is
the rule (AGENTS.md, section 六).
| Column | Meaning |
|---|---|
| Procedure | The tRPC path: <router>.<name> |
| Kind | query reads, mutation writes |
| Access | The gate the chain names. — means it decides access some other way: read the source |
| Input | The name of the schema it validates with |
| What it is for | The first sentence of the comment above it |
tRPC procedures
admin.agreement
trpc/routers/admin/admin-agreement-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.agreement.listForJob | query | platform: platform.job.view | jobIdSchema | Every agreement issued for one shift, newest first. |
admin.agreement.listForWorker | query | platform: platform.worker.view | inline zod object | Every agreement issued to one worker, across shifts. |
admin.agreement.preview | query | platform: platform.job.view | bookingIdSchema | What would be sent right now, without sending it. |
admin.agreement.send | mutation | platform: platform.assignment.manage | — | Sends one shift's agreement to one worker: email plus app notification. |
admin.agreement.sendForJob | mutation | platform: platform.assignment.manage | jobIdSchema | Sends to everybody on the shift who has nothing to sign. |
admin.agreement.setRate | mutation | platform: platform.assignment.manage | — | Records the rate agreed for one assignment. |
admin.agreement.cancelForBooking | mutation | platform: platform.assignment.manage | bookingIdSchema | Cancels an open agreement when the assignment behind it goes away. |
admin.application
trpc/routers/admin/admin-application-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.application.list | query | platform: platform.organization.view | listAccountApplicationsSchema | The review queue: one page of applications, with the tab counts. |
admin.application.approve | mutation | platform: platform.organization.view | approveAccountApplicationSchema | Approves one application: the account that already exists becomes usable. |
admin.application.reject | mutation | platform: platform.organization.view | rejectAccountApplicationSchema | Rejects one application, with a reason. |
admin.appRelease
trpc/routers/admin/admin-app-release-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.appRelease.list | query | platform: platform.app_config.manage | — | Every published build, newest first, with whether its package is on disk. |
admin.appRelease.notify | mutation | platform: platform.app_config.manage | inline zod object | Sends "a newer version is ready" again for one build. |
admin.appRelease.withdraw | mutation | platform: platform.app_config.manage | inline zod object | Takes a build out of circulation: the row and its files. |
admin.attachment
trpc/routers/admin/admin-attachment-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.attachment.list | query | — | attachmentEntitySchema | — |
admin.attachment.upload | mutation | — | uploadAttachmentSchema | — |
admin.attachment.delete | mutation | — | deleteAttachmentSchema | — |
admin.audit
trpc/routers/admin/admin-audit-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.audit.list | query | platform: platform.audit.view | listAuditLogSchema | The audit log, newest first, filtered and paged. |
admin.audit.export | mutation | — | exportAuditLogSchema | The same query as a CSV. |
admin.candidate
trpc/routers/admin/admin-candidate-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.candidate.list | query | platform: platform.assignment.view | candidateListInput | The shift and both of its lists. |
admin.candidate.precheck | query | platform: platform.assignment.view | candidatePrecheckInput | Would this invitation be refused? (owner's rule, 2026-10-02). |
admin.candidate.add | mutation | platform: platform.assignment.manage | candidateAddInput | Puts people on one of the lists (idempotent per person). |
admin.candidate.enrollPhoto | mutation | platform: platform.assignment.manage | candidateEnrollPhotoInput | A photo of somebody on one of this shift's lists (SEL-01 follow-up). |
admin.candidate.move | mutation | platform: platform.assignment.manage | candidateMoveInput | Moves entries between the candidate and backup lists. |
admin.candidate.recordAcceptance | mutation | platform: platform.assignment.manage | recordAcceptanceSchema | Records an acceptance that happened outside the app. |
admin.candidate.applyRates | mutation | platform: platform.assignment.manage | applyScheduleRatesSchema | Applies rates to every contractor in the schedule at once. |
admin.candidate.remove | mutation | platform: platform.assignment.manage | candidateIdsInput | Takes people off the lists. |
admin.candidate.setCapacity | mutation | platform: platform.assignment.manage | candidateCapacityInput | The shortlist size the responsible project manager set (null = no cap). |
admin.candidate.offer | mutation | platform: platform.assignment.manage | candidateOfferInput | 待接受 — sends the work agreement. |
admin.candidate.withdraw | mutation | platform: platform.assignment.manage | candidateWithdrawInput | Takes an offer back after it went out. |
admin.dashboard
trpc/routers/admin/admin-dashboard-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.dashboard.summary | query | — | — | — |
admin.developer.bug
trpc/routers/admin/developer/bug-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.developer.bug.list | query | platform owner | bugListInput | — |
admin.developer.bug.get | query | platform owner | bugIdInput | — |
admin.developer.bug.create | mutation | platform owner | bugCreateInput | — |
admin.developer.bug.update | mutation | platform owner | bugUpdateInput | — |
admin.developer.requirement
trpc/routers/admin/developer/requirement-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.developer.requirement.list | query | platform owner | requirementListInput | — |
admin.developer.requirement.get | query | platform owner | requirementIdInput | — |
admin.developer.requirement.create | mutation | platform owner | requirementCreateInput | — |
admin.developer.requirement.update | mutation | platform owner | requirementUpdateInput | — |
admin.developer.requirement.setDeliveryState | mutation | platform owner | requirementDeliveryStateInput | Move one requirement along the delivery axis — the only write here that is |
admin.dispute
trpc/routers/admin/admin-dispute-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.dispute.list | query | platform: platform.payment.view | listAdminDisputesSchema | The queue: every dispute, newest first, with the hotel, the worker and the |
admin.dispute.get | query | platform: platform.payment.view | adminDisputeIdSchema | One dispute, with the shift, the worker, the hotel, and whatever figures |
admin.dispute.resolve | mutation | platform: platform.payment.manage | resolveAdminDisputeSchema | Records CGP's answer. |
admin.faceNode
trpc/routers/admin/admin-face-node-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.faceNode.list | query | platform: platform.face_node.view | — | — |
admin.faceNode.create | mutation | platform: platform.face_node.manage | inline zod object | Issues a machine its own access code. |
admin.faceNode.setEnabled | mutation | platform: platform.face_node.manage | inline zod object | Switches a machine on or off. |
admin.faceNode.remove | mutation | platform: platform.face_node.manage | inline zod object | Removes the credential entirely. |
admin.faceNode.debugEmbed | mutation | platform: platform.face_node.manage | inline zod object | Runs one photo through the pipeline and reports **where it ran and with |
admin.faceScan
trpc/routers/admin/admin-face-scan-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.faceScan.list | query | platform: platform.face_record.view | listFaceScansAdminSchema | — |
admin.holiday
trpc/routers/admin/admin-holiday-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.holiday.list | query | platform: platform.holiday.view | inline zod object | — |
admin.holiday.create | mutation | platform: platform.holiday.manage | inline zod object | — |
admin.holiday.update | mutation | platform: platform.holiday.manage | inline zod object | — |
admin.holiday.remove | mutation | platform: platform.holiday.manage | inline zod object | — |
admin.holiday.years | query | platform: platform.holiday.view | — | The years that have rows, so the console offers them instead of guessing. |
admin.job
trpc/routers/admin/admin-job-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.job.list | query | platform: platform.job.view | listAdminJobsSchema | — |
admin.job.approvalQueue | query | platform: platform.job.view | inline zod object | Shifts a hotel has posted that are waiting for a reviewer. |
admin.job.approve | mutation | platform: platform.job.manage | adminJobIdSchema | Approves a hotel's shift request so it can be staffed. |
admin.job.reject | mutation | platform: platform.job.manage | rejectAdminJobSchema | Rejects a hotel's shift request, with the reason the hotel will see. |
admin.job.agreement | query | platform: platform.job.view | adminJobIdSchema | The work agreement settings for one shift, plus what it composes to. |
admin.job.updateAgreement | mutation | platform: platform.job.manage | inline zod object | — |
admin.job.get | query | platform: platform.job.view | adminJobIdSchema | A single job, used by the job detail screen. |
admin.job.attendance | query | platform: platform.job.view | adminJobIdSchema | Attendance roster for a job: everyone booked onto it, with the punches |
admin.job.create | mutation | platform: platform.job.manage | createAdminJobSchema | — |
admin.job.update | mutation | platform: platform.job.manage | updateAdminJobSchema | — |
admin.job.close | mutation | platform: platform.job.manage | adminJobIdSchema | — |
admin.job.adjustAttendance | mutation | platform: platform.job.manage | adjustAttendanceSchema | Correct one punch (owner, 2026-10-15: "提供修改考勤记录的操作,要保留原始考勤记录并体现是谁 |
admin.job.attendanceHistory | query | platform: platform.job.view | attendanceHistorySchema | What was changed on this shift's attendance, and by whom — the other half of the owner's |
admin.job.updateAttendance | mutation | platform: platform.job.manage | updateJobAttendanceSchema | — |
admin.job.setStatus | mutation | platform: platform.job.manage | setAdminJobStatusSchema | — |
admin.job.duplicate | mutation | platform: platform.job.manage | duplicateAdminJobSchema | — |
admin.job.departmentsByOrganization | query | platform: platform.job.view | listDepartmentsByOrganizationSchema | — |
admin.job.rateMenu | query | platform: platform.job.view | inline zod object | What a new shift's prices should open at (owner's rule, 2026-10-09: |
admin.job.qr | mutation | platform: platform.job.manage | createJobQrSchema | Attendance QR codes a worker scans on site. |
admin.notification
trpc/routers/admin/admin-notification-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.notification.list | query | platform: platform.notification.view | listAdminNotificationsSchema | — |
admin.notification.recipients | query | platform: platform.notification.view | listNotificationRecipientsSchema | — |
admin.notification.create | mutation | platform: platform.notification.manage | createNotificationSchema | — |
admin.notification.bulkDelete | mutation | platform: platform.notification.manage | bulkDeleteNotificationsSchema | — |
admin.organization
trpc/routers/admin/admin-organization-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.organization.list | query | platform: platform.organization.view | listOrganizationsAdminSchema | — |
admin.organization.get | query | platform: platform.organization.view | getOrganizationAdminSchema | One organization in full — what the console's View opens. |
admin.organization.members | query | platform: platform.organization.view | listOrganizationSectionAdminSchema | One page of an organization's members — the Members tab's read. |
admin.organization.invitations | query | platform: platform.organization.view | listOrganizationSectionAdminSchema | One page of an organization's pending invitations. |
admin.organization.jobs | query | platform: platform.organization.view | listOrganizationSectionAdminSchema | One page of an organization's shifts — the Shifts tab's read. |
admin.organization.creditLedger | query | platform: platform.organization.view | listOrganizationSectionAdminSchema | One page of an organization's credit ledger — the Credits tab's read. |
admin.organization.adminCandidates | query | platform: platform.organization.manage | listOrganizationAdminCandidatesSchema | Accounts that may be chosen as an organization's administrator. |
admin.organization.projectManagerCandidates | query | platform: platform.organization.manage | listOrganizationProjectManagerCandidatesSchema | Accounts that may be chosen as a hotel's project manager. |
admin.organization.create | mutation | platform: platform.organization.manage | createOrganizationAdminSchema | — |
admin.organization.update | mutation | platform: platform.organization.manage | updateOrganizationAdminSchema | — |
admin.organization.enterConsole | mutation | — | enterOrganizationConsoleAdminSchema | Opens an organization's console as the signed-in super admin. |
admin.organization.setStatus | mutation | platform: platform.organization.manage | setOrganizationStatusAdminSchema | — |
admin.organization.resendInvite | mutation | platform: platform.organization.manage | resendOrganizationInviteAdminSchema | — |
admin.organization.delete | mutation | platform: platform.organization.manage | deleteOrganizationAdminSchema | — |
admin.organization.exportSelectedToCsv | mutation | platform: platform.organization.view | exportOrganizationsAdminSchema | — |
admin.organization.exportSelectedToExcel | mutation | platform: platform.organization.view | exportOrganizationsAdminSchema | — |
admin.organization.syncFromStripe | mutation | platform: platform.billing.manage | exportOrganizationsAdminSchema | Sync selected organizations' subscriptions from Stripe |
admin.organization.adjustCredits | mutation | platform: platform.billing.manage | adjustCreditsAdminSchema | Adjust organization credits (admin action) |
admin.organization.cancelSubscription | mutation | platform: platform.billing.manage | cancelSubscriptionAdminSchema | Cancel an organization's subscription (admin action) |
admin.permission
trpc/routers/admin/admin-permission-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.permission.list | query | platform: platform.role.manage | — | — |
admin.permission.setPermissions | mutation | platform: platform.role.manage | inline zod object | — |
admin.permission.reset | mutation | platform: platform.role.manage | inline zod object | — |
admin.permission.presets | query | platform: platform.role.manage | — | The presets, for a screen that needs the starting point. |
admin.push
trpc/routers/admin/admin-push-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.push.list | query | platform: platform.notification.view | listPushDevicesSchema | Devices, newest first, with the account they currently point at. |
admin.push.sendTest | mutation | platform: platform.notification.manage | sendTestPushSchema | Sends one notification on purpose. |
admin.push.deliveries | query | platform: platform.notification.view | listPushDevicesSchema | Recent sends, for "did yesterday's reminders go out". |
admin.settings
trpc/routers/admin/admin-settings-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.settings.list | query | platform: platform.app_config.manage | — | — |
admin.settings.update | mutation | platform: platform.app_config.manage | inline zod object | — |
admin.timesheet
trpc/routers/admin/admin-timesheet-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.timesheet.list | query | platform: platform.payment.view | listSchema | The review queue: sheets waiting on the platform, newest first. |
admin.timesheet.get | query | platform: platform.payment.view | timesheetIdSchema | One timesheet with its entries, the punches behind them and any payment. |
admin.timesheet.generate | mutation | platform: platform.job.manage | inline zod object | Builds the hours of one shift from its punches, on the hotel's behalf. |
admin.timesheet.adjust | mutation | platform: platform.job.manage | inline zod object | Adjusts one entry's payable minutes, with a reason. |
admin.timesheet.adjustTimes | mutation | platform: platform.job.manage | adjustTimesSchema | Corrects when somebody actually clocked in and out (owner's rule, |
admin.timesheet.adjustPay | mutation | platform: platform.payment.manage | adjustPaySchema | "多给或者少给" for one line (owner's rule, 2026-10-13: "在approve的时候,可以 |
admin.timesheet.returnToClient | mutation | platform: platform.job.manage | — | Sends a timesheet back to the hotel to correct, with a note. |
admin.timesheet.approve | mutation | platform: platform.payment.manage | — | Approves and locks the version, and creates the payments. |
admin.timesheet.approveMany | mutation | platform: platform.payment.manage | inline zod object | Approving a batch, from the list. |
admin.timesheet.reopen | mutation | platform: platform.payment.manage | — | Reopens an approved timesheet as a new version (PAY-06). |
admin.timesheet.payments | query | platform: platform.payment.view | inline zod object | The payments behind approved hours, for the payout screen (PAY-04). |
admin.timesheet.payrollExport | mutation | platform: platform.payment.manage | inline zod object | The payroll file, bound to the timesheet version behind every line. |
admin.timesheet.markPaid | mutation | platform: platform.payment.manage | inline zod object | Marks a batch of payments as paid (PAY-04). |
admin.user
trpc/routers/admin/admin-user-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.user.list | query | platform: platform.user.view | listUsersAdminSchema | — |
admin.user.create | mutation | platform: platform.user.manage | createUserAdminSchema | — |
admin.user.get | query | platform: platform.user.view | getUserAdminSchema | — |
admin.user.addToOrganization | mutation | platform: platform.user.manage | addUserToOrganizationAdminSchema | — |
admin.user.removeFromOrganization | mutation | platform: platform.user.manage | removeUserFromOrganizationAdminSchema | — |
admin.user.exportSelectedToCsv | mutation | platform: platform.user.view | exportUsersAdminSchema | — |
admin.user.exportSelectedToExcel | mutation | platform: platform.user.view | exportUsersAdminSchema | — |
admin.user.changePlatformRole | mutation | platform: platform.user.manage | changePlatformRoleAdminSchema | Changes an account's platform role. |
admin.user.removeUser | mutation | platform: platform.user.manage | removeUserAdminSchema | Deletes an account from the console. |
admin.user.banUser | mutation | platform: platform.user.manage | banUserAdminSchema | — |
admin.user.unbanUser | mutation | platform: platform.user.manage | unbanUserAdminSchema | — |
admin.user.resendVerificationEmail | mutation | platform: platform.user.manage | resendVerificationEmailAdminSchema | — |
admin.worker
trpc/routers/admin/admin-worker-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
admin.worker.list | query | platform: platform.worker.view | listAdminWorkersSchema | — |
admin.worker.get | query | platform: platform.worker.view | workerIdSchema | — |
admin.worker.agreements | query | platform: platform.worker.view | workerIdSchema | Everything this worker has agreed to, and every shift they hold a work |
admin.worker.contract | query | platform: platform.worker.view | workerContractSchema | One shift's agreement as it would be issued to this worker (AGR-03). |
admin.worker.create | mutation | platform: platform.worker.manage | createWorkerSchema | — |
admin.worker.update | mutation | platform: platform.worker.manage | updateWorkerSchema | — |
admin.worker.resendActivation | mutation | platform: platform.worker.manage | resendActivationSchema | — |
admin.worker.delete | mutation | platform: platform.worker.manage | workerIdSchema | — |
admin.worker.review | mutation | platform: platform.worker.manage | reviewWorkerSchema | — |
admin.worker.ban | mutation | platform: platform.worker.manage | banWorkerSchema | — |
admin.worker.deactivate | mutation | platform: platform.worker.manage | deactivateWorkerSchema | — |
admin.worker.reactivate | mutation | platform: platform.worker.manage | workerIdSchema | — |
admin.worker.assign | mutation | platform: platform.assignment.manage | assignWorkerSchema | — |
admin.worker.unassign | mutation | platform: platform.assignment.manage | unassignWorkerSchema | — |
admin.worker.assignToJob | mutation | platform: platform.assignment.manage | assignWorkersToJobSchema | — |
admin.worker.cancelAssignment | mutation | platform: platform.assignment.manage | cancelAssignmentSchema | — |
admin.worker.listAssignments | query | platform: platform.worker.view | listAdminAssignmentsSchema | — |
admin.worker.enrollFace | mutation | platform: platform.worker.manage | enrollFaceSchema | — |
admin.worker.removeFace | mutation | platform: platform.worker.manage | removeWorkerFaceSchema | — |
admin.worker.setFacePhoto | mutation | platform: platform.worker.manage | setWorkerFacePhotoSchema | — |
application
trpc/routers/application-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
application.availability | query | public | — | Which lines the platform is currently accepting applications on. |
application.submitWorker | mutation | public | submitWorkerApplicationSchema | A worker asking for an account: name, phone, email, and optionally where |
application.submitOrganization | mutation | public | submitOrganizationApplicationSchema | A company asking for an organization account: who they are, and who at the |
contact
trpc/routers/contact/index.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
contact.submit | mutation | public | inline zod object | — |
database
trpc/routers/admin/admin-database-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
database.listTables | query | — | listDatabaseTablesSchema | Every manageable table, with its column count, the planner's row estimate |
database.describeTable | query | — | describeDatabaseTableSchema | One table's columns, as the editor needs them to build its form. |
database.listRows | query | — | listDatabaseRowsSchema | One page of one table, searched, sorted and counted. |
database.insertRow | mutation | — | insertDatabaseRowSchema | Insert one row. |
database.updateRow | mutation | — | updateDatabaseRowSchema | Update one row, addressed by its primary key. |
database.deleteRow | mutation | — | deleteDatabaseRowSchema | Delete one row, addressed by its primary key, and report how many rows went. |
notification
trpc/routers/notification/index.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
notification.list | query | signed in | listNotificationsSchema | — |
notification.unreadCount | query | signed in | — | — |
notification.get | query | signed in | notificationIdSchema | — |
notification.markRead | mutation | signed in | notificationIdSchema | — |
notification.delivered | mutation | signed in | deliveredNotificationSchema | A device saying "I have this one". |
notification.markAllRead | mutation | signed in | — | — |
organization
trpc/routers/organization/index.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.list | query | signed in | — | — |
organization.setActive | mutation | signed in | setActiveOrganizationSchema | Switches the caller's active organization (used by the mobile app). |
organization.get | query | signed in | getOrganizationByIdSchema | — |
organization.create | mutation | signed in | createOrganizationSchema | — |
organization.announcement
trpc/routers/organization/organization-announcement-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.announcement.list | query | organization: org.announcement.view | listAnnouncementsSchema | — |
organization.announcement.get | query | organization: org.announcement.view | announcementIdSchema | — |
organization.announcement.create | mutation | organization: org.announcement.manage | createAnnouncementSchema | — |
organization.announcement.update | mutation | organization: org.announcement.manage | updateAnnouncementSchema | — |
organization.announcement.publish | mutation | organization: org.announcement.manage | announcementIdSchema | — |
organization.announcement.archive | mutation | organization: org.announcement.manage | announcementIdSchema | — |
organization.attachment
trpc/routers/organization/organization-attachment-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.attachment.list | query | — | attachmentEntitySchema | — |
organization.attachment.upload | mutation | — | uploadAttachmentSchema | — |
organization.attachment.delete | mutation | — | deleteAttachmentSchema | — |
organization.client
trpc/routers/organization/organization-client-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.client.list | query | organization: org.client.view | listClientsSchema | — |
organization.client.get | query | organization: org.client.view | clientIdSchema | — |
organization.client.create | mutation | organization: org.client.manage | createClientSchema | — |
organization.client.update | mutation | organization: org.client.manage | updateClientSchema | — |
organization.client.delete | mutation | organization: org.client.manage | clientIdSchema | — |
organization.client.listDepartments | query | organization: org.client.view | listDepartmentsSchema | — |
organization.client.listAllDepartments | query | organization: org.client.view | listAllDepartmentsSchema | — |
organization.client.createDepartment | mutation | organization: org.client.manage | createDepartmentSchema | — |
organization.client.updateDepartment | mutation | organization: org.client.manage | updateDepartmentSchema | — |
organization.client.deleteDepartment | mutation | organization: org.client.manage | deleteDepartmentSchema | — |
organization.credit
trpc/routers/organization/organization-credit-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.credit.getBalance | query | organization: org.billing.view | — | — |
organization.credit.getTransactions | query | organization: org.billing.view | getOrganizationCreditTransactionsSchema | — |
organization.credit.getPackages | query | organization: org.billing.view | — | — |
organization.credit.purchaseCredits | mutation | organization: org.billing.manage | purchaseOrganizationCreditSchema | — |
organization.dashboard
trpc/routers/organization/organization-dashboard-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.dashboard.summary | query | — | — | Everything above the fold: today's shifts, this week and this month at a |
organization.dashboard.trend | query | — | inline zod object | The per-day series behind the trend chart. |
organization.dispute
trpc/routers/organization/organization-dispute-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.dispute.list | query | organization: org.dispute.view | listDisputesSchema | — |
organization.dispute.resolve | mutation | organization: org.dispute.manage | resolveDisputeSchema | — |
organization.job
trpc/routers/organization/organization-job-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.job.list | query | organization: org.job.view | listJobsSchema | — |
organization.job.get | query | organization: org.job.view | jobIdSchema | — |
organization.job.rateMenu | query | organization: org.job.manage | inline zod object | What a new shift's billing should open at (owner's rule, 2026-10-09: |
organization.job.create | mutation | organization: org.job.manage | createJobSchema | — |
organization.job.adjustAttendance | mutation | organization: org.job.manage | adjustAttendanceSchema | Correcting one punch, from the hotel's side (owner, 2026-10-15: "已经打开的,怎么修改?"). |
organization.job.attendanceHistory | query | organization: org.job.view | attendanceHistorySchema | — |
organization.job.updateAttendance | mutation | organization: org.job.manage | updateJobAttendanceSchema | — |
organization.job.update | mutation | organization: org.job.manage | updateJobSchema | — |
organization.job.withdraw | mutation | organization: org.job.manage | jobIdSchema | The hotel takes its own request back, while it is still waiting. |
organization.job.close | mutation | organization: org.job.manage | jobIdSchema | — |
organization.job.setStatus | mutation | organization: org.job.manage | setJobStatusSchema | — |
organization.job.duplicate | mutation | organization: org.job.manage | duplicateJobSchema | — |
organization.job.listBookings | query | organization: org.job.view | listJobBookingsSchema | — |
organization.job.acceptBooking | mutation | organization: org.job.manage | acceptBookingSchema | — |
organization.job.rejectBooking | mutation | organization: org.job.manage | rejectBookingSchema | — |
organization.job.listAssignments | query | organization: org.job.view | listOrgAssignmentsSchema | Assignment records for the whole organization: every worker booked onto |
organization.job.attendance | query | organization: org.job.view | jobIdSchema | Attendance roster for one of this organization's jobs. |
organization.job.qr | mutation | organization: org.job.manage | createJobQrSchema | Attendance QR codes for one of this organization's jobs. |
organization.labour
trpc/routers/organization/organization-labour-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.labour.fillStats | query | organization: org.job.view | fillStatsSchema | — |
organization.payment
trpc/routers/organization/organization-payment-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.payment.list | query | organization: org.payment.view | listPaymentsSchema | — |
organization.role
trpc/routers/organization/organization-role-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.role.mine | query | — | — | The caller's own role and effective permissions, for client components |
organization.role.list | query | organization: org.member.view | — | — |
organization.role.setPermissions | mutation | organization: org.member.manage | inline zod object | — |
organization.role.reset | mutation | organization: org.member.manage | inline zod object | — |
organization.subscription
trpc/routers/organization/organization-subscription-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.subscription.checkoutReturn | query | organization: org.billing.view | checkoutReturnSchema | — |
organization.subscription.getStatus | query | organization: org.billing.view | — | Get the current billing status for the organization |
organization.subscription.listSubscriptions | query | organization: org.billing.view | — | Get all subscriptions (history) for the organization with pagination |
organization.subscription.listOrders | query | organization: org.billing.view | — | Get all one-time orders for the organization with pagination |
organization.subscription.listInvoices | query | organization: org.billing.view | — | Get invoices from Stripe for the organization |
organization.subscription.createCheckout | mutation | organization: org.billing.manage | createCheckoutSchema | Create a checkout session for a subscription or one-time order |
organization.subscription.createPortalSession | mutation | organization: org.billing.manage | — | Create a customer portal session |
organization.subscription.cancelSubscription | mutation | organization: org.billing.manage | — | Cancel the current subscription at the end of the billing period |
organization.subscription.reactivateSubscription | mutation | organization: org.billing.manage | — | Reactivate a subscription that was scheduled for cancellation |
organization.subscription.listPlans | query | organization: org.billing.view | — | Get available plans from config |
organization.subscription.previewPlanChange | query | organization: org.billing.manage | planChangeSchema | Preview subscription change (upgrade/downgrade) |
organization.subscription.changePlan | mutation | organization: org.billing.manage | planChangeSchema | Change subscription to a different plan (upgrade/downgrade) |
organization.subscription.updateSeats | mutation | organization: org.billing.manage | updateSeatsSchema | Update subscription seat count (for per-seat billing) |
organization.subscription.getSeatInfo | query | organization: org.billing.view | — | Get current seat information for the organization |
organization.timesheet
trpc/routers/organization/organization-timesheet-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.timesheet.list | query | organization: org.timesheet.view | listTimesheetsSchema | — |
organization.timesheet.pendingJobs | query | organization: org.timesheet.view | — | The shifts whose hours are still to be submitted. |
organization.timesheet.get | query | organization: org.timesheet.view | timesheetIdSchema | — |
organization.timesheet.generate | mutation | organization: org.timesheet.approve | generateTimesheetSchema | Derives (or re-derives) the hours of one shift from its punches. |
organization.timesheet.adjust | mutation | organization: org.timesheet.approve | adjustTimesheetEntrySchema | The hotel corrects one line's payable time (TIM-02). |
organization.timesheet.adjustTimes | mutation | organization: org.timesheet.approve | adjustTimesheetEntryTimesSchema | The hotel corrects when somebody clocked in and out (owner's rule, |
organization.timesheet.confirm | mutation | organization: org.timesheet.approve | confirmTimesheetSchema | The hotel confirms CGP's adjustment (TIM-04). |
organization.worker
trpc/routers/organization/organization-worker-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
organization.worker.list | query | organization: org.worker.view | listWorkersSchema | — |
organization.worker.get | query | organization: org.worker.view | workerIdSchema | — |
push/push-router
trpc/routers/push/push-router.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
push/push-router.register | mutation | signed in | registerPushDeviceSchema | Registers (or refreshes) this install for the signed-in account. |
push/push-router.unregister | mutation | signed in | unregisterPushDeviceSchema | Forgets this install. |
push/push-router.myDevices | query | signed in | — | Whether this account can be reached right now. |
storage
trpc/routers/storage/index.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
storage.userAvatarUploadUrl | mutation | signed in | — | — |
storage.organizationLogoUploadUrl | mutation | organization: org.settings.manage | — | — |
user
trpc/routers/user/index.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
user.getSession | query | public | — | — |
user.getActiveSessions | query | signed in | — | — |
user.getAccounts | query | signed in | — | — |
user.completeOnboarding | mutation | signed in | — | — |
worker
trpc/routers/worker/index.ts
| Procedure | Kind | Access | Input | What it is for |
|---|---|---|---|---|
worker.agreements | mutation | signed in | — | The platform terms this worker has to accept, and whether they have. |
worker.bandChoices | mutation | signed in | inline zod object | Shifts that let the candidate choose their own time bands (owner's |
worker.dispute | mutation | signed in | raiseDisputeSchema | Disputes about this worker's own shifts. |
worker.assignments | query | signed in | — | The caller's profile plus their assignments across every organization, |
worker.payments | query | signed in | — | The worker's own pay: the shifts behind it, the hours that were approved |
worker.announcements | query | signed in | — | Published announcements from the organizations this worker works for — |
worker.faces | mutation | signed in | inline zod object | The caller's own face photos, and which one is the avatar. |
worker.enrollFace | mutation | signed in | enrollFaceSchema | Enrols the caller's own face, so they can check in by face. |
worker.uploadPhoto | mutation | signed in | uploadWorkerPhotoSchema | A photo the worker picks out of their own album. |
HTTP routes
The app calls these directly. They are authenticated by the session cookie the app holds.
| Route | Methods | Access | What it is for |
|---|---|---|---|
/api/agreement/:token | POST | — | The worker's answer, posted from the page the email links to (SEL-02). |
/api/app/android/download/:id | GET | — | — |
/api/app/android/latest | GET | — | — |
/api/attendance/check-in | POST | signed in | Step 2 of a QR punch: matches the captured face against the faces enrolled |
/api/attendance/face-verify | POST | signed in | POST /api/attendance/face-verify, with the server's own share of the time |
/api/attendance/location | POST | signed in | A position that arrived after the punch was already recorded. |
/api/attendance/qr/verify | POST | signed in | Step 1 of a QR punch: checks the scanned code, then records a |
/api/auth/set-password | POST | — | — |
/api/cron/push-reminders | GET, POST | — | — |
/api/events | GET | signed in | — |
/api/face-nodes/heartbeat | POST | — | Liveness, sent between polls while a node is busy computing. |
/api/face-nodes/jobs | GET | — | A node asking for work. |
/api/face-nodes/register | POST | — | A node announcing itself, on boot and after every reconnect. |
/api/face-nodes/results | POST | — | A node handing back an answer. |
/api/face-nodes/stream | GET | — | Legacy: a node asking for work over a streaming response. |
/api/face/identify | POST | signed in | 1:N face identification. |
/api/me | GET | signed in | The signed-in user, as the mobile app needs them. |
/api/version | GET | — | — |
/api/webhooks/stripe | POST | — | Stripe webhook handler |
/api/worker-activation | GET, POST | — | The activation link's public half (?token=). |
Regenerating
cd server && node scripts/generate-api-docs.mjsThe page is written to content/docs/api-reference.mdx; meta.json lists it in the sidebar.