Skip to main content
POST
Count employees matching stat totals

Authorizations

Authorization
string
header
required

Use an API key or OAuth access token. Enter only the token in the authorization dialog; requests send it as Authorization: Bearer <TOKEN>.

Create an API key in your workspace's Settings → API keys. Keys start with wm_api_ and only work in the workspace where they were created. Read-only keys can read data; creating, updating, or deleting data requires a read-write key.

OAuth access tokens are issued for connected Windmill applications.

Both token types use the authenticated user's workspace permissions. Each endpoint's permission requirements and the sharing settings of the requested items still apply.

Path Parameters

companyId
string
required

Company ID. A URL slug is also accepted. The caller must have access to this company.

Required string length: 1 - 128
Example:

"company-acme"

Body

application/json
dateRange
object
required
statTypes
string[]
required

Stat identifiers to total, global or workspace custom. Each row returns its stats in this order. Unknown identifiers total 0.

Required array length: 1 - 50 elements

Kebab-case identifier of a global Windmill stat or a workspace custom stat. Discover identifiers with POST /c/{companyId}/stats/metadata/search.

Required string length: 1 - 100
Pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
Example:
timezone
string

IANA timezone used to resolve the date range (e.g. "America/New_York"). Defaults to UTC.

Example:

"America/New_York"

employee
Employee filter · object

Limits which employees are returned within the set the caller can access. This filter never grants access to more employees.

Example:

Text that matches the employee name, preferred name, or email username.

Maximum string length: 200
Example:

"Avery"

where
Stat total conditions · object[]

Conditions on stat totals. An employee matches only when every condition is true. Each condition compares the value that a row returns: the weighted average for AVERAGE stats, and 0 for an employee with no data.

Maximum array length: 10
Example:

Response

Number of matching employees

total
integer
required

Total matching items, independent of pagination. The route determines the item type.

Required range: x >= 0
Example:

1