Foxtconone API
API v1 — Reference

API reference

All endpoints available in this service. Use the table below to integrate with the frontend.

API nameMethodEndpointDescriptionHow to use in frontend
Health checkGET/api/healthReturns API health status.fetch('/api/health') or use for uptime checks.
Auth configGET/api/v1/auth/configPublic auth configuration (portal, loginIdentifier, tenantSlug).getAuthConfig() before login to decide email vs phone UI.
Check emailPOST/api/v1/auth/check-emailCheck if email exists (super-admin portal).POST body: { email }. Use before sending OTP.
LoginPOST/api/v1/auth/loginAuthenticate and get session/token.POST body: credentials. Store token; set cookie or Authorization header.
OTP startPOST/api/v1/auth/otp/startRequest OTP (phone/email) for org portal.POST body: { phone } or { email }. Then call OTP verify.
OTP verifyPOST/api/v1/auth/otp/verifyVerify OTP code and complete login.POST body: { id, code }. Returns token/session.
LogoutPOST/api/v1/auth/logoutInvalidate current session.POST with credentials. Clear token and redirect to login.
Current user (Me)GET/api/v1/meGet current authenticated user, tenant, roles, scopes.getCurrentUser() after login. Use for layout, role, tenantId.
List organizationsGET/api/v1/organizationsList organizations (super-admin or tenant-scoped).getOrganizations() or similar. Include Authorization header.
Get organizationGET/api/v1/organizations/[id]Get single organization by ID.getOrganization(orgId). Returns name, logoUrl, etc.
Update organizationPATCH/api/v1/organizations/[id]Update organization details.PATCH with body. Require admin/owner role.
List organization membersGET/api/v1/organizations/[id]/membersList members (users) of an organization.getOrganizationMembers(orgId). Use for schedules, job list, dropdowns.
Get/Update memberGETPATCHDELETE/api/v1/organizations/[id]/members/[userId]Get, update, or remove a member.Request with orgId and userId. Use for user detail/edit.
List locationsGET/api/v1/organizations/[id]/locationsList locations (properties) for an organization.getOrganizationLocations(orgId). Use for property switcher.
Get/Update locationGETPATCHDELETE/api/v1/organizations/[id]/locations/[locationId]Get or update a location.CRUD with orgId and locationId.
List schedulesGET/api/v1/schedulesList schedules (access-filtered: only assigned or creator).getSchedules(). Returns items[]. Use for Schedule Lobby.
Create schedulePOST/api/v1/schedulesCreate a new schedule.createSchedule({ name, assigneeGroupIds, assigneeUserIds, assigneeUserIdsExpanded, detailsConfig }).
Get scheduleGET/api/v1/schedules/[id]Get a schedule by ID (403 if no access).getSchedule(scheduleId). Use on Schedule Detail page.
Update schedulePATCH/api/v1/schedules/[id]Update schedule (name, assignees, detailsConfig).updateSchedule(scheduleId, body).
Delete scheduleDELETE/api/v1/schedules/[id]Delete a schedule and its shifts.deleteSchedule(scheduleId).
List shiftsGET/api/v1/schedules/[id]/shiftsList shifts for a schedule (same access as schedule).getShifts(scheduleId). Returns items[] with employee_id, shift_date, etc.
Create shiftPOST/api/v1/schedules/[id]/shiftsCreate a shift (one per user or open shift).createShift(scheduleId, { assignedUserId, jobId, shiftDate, startTime, endTime, title, instructions, status, isOpenShift }).
Get shiftGET/api/v1/schedules/[id]/shifts/[shiftId]Get a single shift.GET with scheduleId and shiftId.
Update shiftPATCH/api/v1/schedules/[id]/shifts/[shiftId]Update shift (assignee, times, title, status, etc.).updateShift(scheduleId, shiftId, body).
Delete shiftDELETE/api/v1/schedules/[id]/shifts/[shiftId]Delete a shift.deleteShift(scheduleId, shiftId).
List jobsGET/api/v1/job-listList jobs for the current tenant.getJobs(). Returns items with job_name, code, color, etc. Use in shift form and Job List page.
Create jobPOST/api/v1/job-listCreate a new job.createJob({ name, code, description, color, ... }).
Get jobGET/api/v1/job-list/[id]Get a job by ID.GET /api/v1/job-list/{id}.
Update jobPATCH/api/v1/job-list/[id]Update a job.updateJob(id, body).
Delete jobDELETE/api/v1/job-list/[id]Delete a job.deleteJob(id).
Bulk delete jobsPOST/api/v1/job-list/bulkDelete multiple jobs by IDs.POST body: { ids: string[] }.
List segments (with groups)GET/api/v1/smart-groupsList segments and their smart groups for the tenant.getSegments(). Use for Schedule assignees and Smart Groups page.
List segments (flat)GET/api/v1/smart-groups/segmentsList segments.GET /api/v1/smart-groups/segments.
Create segmentPOST/api/v1/smart-groups/segmentsCreate a segment.POST with name, etc.
Get/Update/Delete segmentGETPATCHDELETE/api/v1/smart-groups/segments/[id]Segment CRUD.Use segment id in schedule assignees and group rules.
Get/Update/Delete smart groupGETPATCHDELETE/api/v1/smart-groups/[id]Smart group CRUD (rules, logic).Use with filterEmployeesBySmartGroup() for member list.
Clock in/outPOST/api/v1/clockTime clock punch (in/out).POST with jobId, clockId, etc. Use from Time Clock UI.
Presign uploadPOST/api/v1/files/presignGet presigned URL for file upload (e.g. S3).POST body: { key, contentType }. Upload file to returned URL.
Super admin usersGET/api/v1/super-admin/usersList users (super-admin only).Only when portal === 'super-admin'. Include auth.
TicketsGETPOST/api/v1/ticketsSupport or internal tickets.Use from support/chat UI if integrated.