Skip to main content
POST
Bulk Delete Workforce Employees by Filters
← Own Workforce API Delete every employee matching a filter set, without collecting their ids first. The filters go in the query string — the same ones List Workforce Employees accepts — and the body carries the filter_hash that list returned.
Irreversible, and it cascades to contracts, remunerations, trainings and absence records. Always run the equivalent list call first and read total before deleting.

The filter_hash guard

filter_hash fingerprints the filters that produced a page — including consolidate_group, organization_id[] and the project scope. Send it back and the server recomputes the fingerprint from the filters on this request:
  • they match → the delete proceeds over exactly the set you listed;
  • they differ → 409 Conflict, and nothing is deleted.
That is what stops a client from listing one subsidiary, then widening the perimeter and deleting the whole group by accident. It guards against that drift, not against a caller who deliberately sends different filters — the tenant boundary is the organization scoping, not the hash. Take the hash verbatim from the list response. At least one real filter is required. consolidate_group and organization_id[] do not count: they change the perimeter rather than select rows, so on their own they answer 422. Note what this does and does not buy you — it blocks a filterless call, not a broad one. A single wide created_at_from satisfies the rule and can still match every row in the organization, so read total from the list before you delete.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Query Parameters

The same filters as the list endpoint. At least one of the first four is required.
string
Search by the employee identifier your HR system uses
array[string]
Filter by source upload file. The nil UUID matches rows with no file.
datetime
Only rows created at or after this instant
datetime
Only rows created at or before this instant
boolean
default:"false"
Widen the perimeter to the accepted business family. Part of the hash; does not satisfy the “at least one filter” rule on its own.
array[string]
Narrow a group-view delete to these organizations. Part of the hash; does not satisfy the “at least one filter” rule on its own.

Body

string
required
The filter_hash from the list response that showed you these rows

Response

Same shape as Bulk Delete Workforce Employees: success_count, success_ids, failed_count, failed_ids and message.

Example

Successful Response

Common Errors

401 Unauthorized

Cause: the key is invalid, or it does not belong to the organization in x-organization-id — the two are looked up as a pair. A request carrying no credentials at all answers AUTH_REQUIRED instead.

403 Forbidden

Cause: the key’s owner is not an enabled member of the organization, or their role cannot write.

409 Conflict

Cause: filter_hash does not match the filters on this request. Nothing was deleted. Re-list with the filters you intend, then retry with the fresh hash.

422 Unprocessable Entity

Cause: no real filter was supplied — only consolidate_group and/or organization_id[], or nothing at all.

List employees

Where filter_hash comes from

Bulk delete by ids

When you already hold the ids