> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bindbee.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Identify a Employee Termination

> React to an employee leaving by revoking access, ending coverage, and notifying downstream vendors.

When someone leaves, you need to revoke access, end coverage, and tell downstream vendors - each on its own date.

## What you'll use

**Models** - [employee](/hris/employee/get-employees), [employment](/hris/employments/get-employments), [benefit](/hris/benefits/get-benefits), [dependent benefit](/hris/dependent-benefits/get-dependent-benefits)

**Events** - `employee_data_changed`, `connector_synced`, `connector_sync_error`

<Info>
  **Before you start**

  * A webhook is registered for the environment - see [Create a Webhook](/guides/reading-writing/webhooks).
  * You can schedule work for a future date. Every action here is gated on a date, not on arrival.
</Info>

## Steps

<Steps>
  <Step title="Subscribe to employee changes">
    Subscribe to `employee_data_changed`. Add `connector_sync_error` too - a connector that stops syncing stops reporting terminations, and silence is the failure mode here.

    **Result:** IDs of employees whose records changed.
  </Step>

  <Step title="Fetch the changed employees">
    ```bash theme={null}
    curl --request GET \
      --url 'https://api.bindbee.dev/api/hris/v1/employees?ids=<ID_1>,<ID_2>' \
      --header 'Authorization: Bearer <BINDBEE_API_KEY>' \
      --header 'X-Connector-Token: <CONNECTOR_TOKEN>'
    ```

    `employment_status`, `termination_date` and `termination_reason` all sit on the employee, so one call carries everything the decision needs.

    **Result:** Status and termination details in one response.
  </Step>

  <Step title="Match every terminal status">
    Four statuses are departures, and one that looks like a departure isn't.

    ```python theme={null}
    TERMINAL = {"INACTIVE", "RETIRED", "DECEASED", "INACTIVE_EXTERNAL"}
    # LEAVE is NOT a termination - revoking access for parental leave is an escalation

    if emp["employment_status"] in TERMINAL:
        handle_departure(emp)
    ```

    `INACTIVE_EXTERNAL` is a contractor ending an engagement. Matching only on `INACTIVE` silently misses them - see [Filtering](/guides/reading-writing/reading-data/filters) for the full enum.

    **Result:** Every real departure, and no false ones.
  </Step>

  <Step title="Schedule on the termination date">
    Terminations are recorded when they're entered, often weeks before they take effect. Act on the date, not on the event.

    ```python theme={null}
    termination_date = emp["termination_date"]
    if termination_date > today:
        schedule_offboarding(emp, at=termination_date)   # reversible until then
    else:
        offboard(emp)
    ```

    Keep the scheduled action cancellable. Rescinded resignations, entry errors and quick rehires are common enough that destructive-on-arrival costs more than it saves - see [Unexpected records](/guides/troubleshooting/missing-records).

    **Result:** Access ends on the last day, not the day HR typed it in.
  </Step>

  <Step title="Read coverage end dates separately">
    Employment ending does not end coverage. Read the benefit records to find when it actually stops.

    ```bash theme={null}
    curl --request GET \
      --url 'https://api.bindbee.dev/api/hris/v1/benefits?employee_id=<EMPLOYEE_ID>&page_size=200' \
      --header 'Authorization: Bearer <BINDBEE_API_KEY>' \
      --header 'X-Connector-Token: <CONNECTOR_TOKEN>'
    ```

    Use the benefit's own end date, which is often the end of the month. Expect a window where someone is terminated with coverage still active - see [Reading benefits](/guides/data-models/benefits).

    **Result:** The real loss-of-coverage date, per plan.
  </Step>

  <Step title="Reconcile on a schedule">
    Terminations are low-volume, so a lost webhook leaves no visible gap - and exhausted deliveries are never redelivered. Run this pass independently of events.

    ```bash theme={null}
    curl --request GET \
      --url 'https://api.bindbee.dev/api/hris/v1/employees?modified_after=2026-08-17T00:00:00Z&page_size=200' \
      --header 'Authorization: Bearer <BINDBEE_API_KEY>' \
      --header 'X-Connector-Token: <CONNECTOR_TOKEN>'
    ```

    Compare terminal-status employees against those you've offboarded - see [Recover a Missed Webhook Delivery](/guides/reading-writing/webhooks).

    **Result:** A backstop that closes what events dropped.
  </Step>
</Steps>

## Related

* [Reading employees](/guides/data-models/employee-data) - where `employment_status` and `termination_date` live
* [Recover a Missed Webhook Delivery](/guides/reading-writing/webhooks) - what to do when an event never arrived
