Skip to main content
POST
Create a stat view

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

Saved stat and employee selection. The request must fit within 32 KiB of JSON.

name
string
required

Name of the saved view, from 1 to 120 characters after trimming whitespace.

Required string length: 1 - 120
Example:

"Engineering activity"

statMetadataIds
string<uuid>[]
required

Ordered selection of 1 to 50 unique stat definition UUIDs from POST /c/{companyId}/stats/metadata/search. Definitions must be global or belong to this workspace and must not be archived.

Required array length: 1 - 50 elements
Example:
employeeFilter
Saved employee filter · object
required

Employee selection to save. An empty object selects all employees allowed by the filter defaults. Each viewer's analytics access still limits the data they can read. Filters support at most 5 nesting levels, including the root, 50 filter objects, and 500 values per filter array.

Example:

Response

Created stat view identity and version

view
Stat view · object
required

Saved view identity and current version. Fetch the view for its full configuration.