> For the complete documentation index, see [llms.txt](https://knowledgebase.flaik.com/flaik-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/employee-management.md).

# Employee Management

Push employee data into flaik (and, optionally, into the resort's POS) from your HR or payroll system of record. This is the only **write** group in flaik Connect — every other group is read-only — and processing is asynchronous: submit a request, receive a request id, then poll for the result.

A single submit can target up to four destinations in one call (flaik employee record, POS Person, POS Employee, POS Instructor) using the `actionUpsert*` flags. Each destination's success/failure is reported independently in the status response, so partial-success outcomes are first-class.

### Pages in this group

* [**Upsert Employee**](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/employee-management/upsert-employee) — submit a create-or-update request (`POST /api/employee/upsert`). Required scope: `flaik.connect.api.write`.
* [**Upsert Status**](https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/employee-management/upsert-status) — poll for the processing result (`GET /api/employee/upsert/{upsertEmployeeRequestId}`). Returns the four-state lifecycle (`Pending`/`Processing`/`CompletedSuccessfully`/`CompletedWithError`) plus per-destination identifiers and error messages.

### Typical sync pattern

1. **Submit** — `POST` the upsert. Receive `upsertEmployeeRequestId`.
2. **Poll** — every few seconds, `GET` the status endpoint with that id. Most requests reach a terminal state within 30 seconds.
3. **Process result** — read the per-destination `*HasError` flags. Partial success is possible; the flaik write may succeed even if a POS write fails.
4. **Retry** — for failed destinations, fix the cause and submit again with only the failed actions enabled. Do not blindly resubmit the whole payload.

Optionally, supply a `webHookUrl` on the submit and Flaik will POST the result to it when processing completes — letting you skip the polling loop in steady state. Polling remains useful as a safety net.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledgebase.flaik.com/flaik-knowledge-base/for-it-specialists/3.-flaik-connect-api/employee-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
