Skip to main content
POST
Search employee 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:
sort
Sort order · object

Sort order. Employees with equal values stay in name order. Defaults to name ascending.

Example:
page
integer
default:1

1-indexed page number

Required range: x >= 1
Example:

1

pageSize
integer
default:20

Page size

Required range: 1 <= x <= 100
Example:

20

include
Additional response details · object

Additional results to calculate alongside the page. Omit to skip this work.

Example:

Response

One page of employees with their stat totals

results
Employee stat totals row · object[]
required

One row per employee, including employees with no data in the range. Only employees whose analytics the caller can read are included.

pagination
Pagination · object
required

Returned page and page size, plus hasMore. Total is omitted unless include.total was requested.

aggregates
Stat totals across employees · object[]

Present when include.aggregates is true. In the order of statTypes.

rank
Employee rank · object | null

Present when include.rankOf is set. Null when that employee does not match the filter or the caller cannot access them.

Example: