Employee Export API
Employee data for import and bulk operations
Returns employee data for import operations, bulk invitations, and employee directory features.
The live API returns up to 50 flat employee rows for authenticated administrative search. Use the optional q query parameter to search by name, email, or employeeKey; short queries under two characters return no rows.
q?|Search term — fuzzy matches against full_name, source_name, and employee_key prefix
location_slug?|Filter to employees who work at this location slug (e.g., cobbsmchenry)
is_active?|Filter by active status. Defaults to active only. Pass null for all.
trueemployee_type?|Filter by type: 'employee' or 'virtual'
limit?LimitMaximum results to return
1 <= value <= 50050offset?OffsetNumber of results to skip for pagination
0 <= value0Successful Response
application/json- response
Response wrapper for employee search.
employees*array<>total*Totalquery?|The search term used, if any. Null means list-all mode.
note?|User-facing message (e.g., 'No matches — try partial name or check unmapped')
curl -X GET "https://example.com/api/analytics/employees"{
"employees": [
{
"employee_key": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"full_name": "Jane Doe",
"first_name": "Jane",
"last_name": "Doe",
"employee_type": "employee",
"primary_location_slug": "cobbsmchenry",
"is_active": true,
"active": true,
"email": "jane.doe@example.com",
"phone": "555-123-4567",
"locations": [
{
"location_slug": "cobbsmchenry",
"is_primary": true
}
],
"jobs": []
}
],
"total": 5,
"query": "jane",
"note": "5 employees found"
}Related Files
| File | Purpose |
|---|---|
apps/app/src/app/api/analytics/employees/route.ts | Authenticated employee search and flat response mapping |
packages/database/src/schema/ | Employee-related database tables |