curl --request POST \
--url https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dateRange": {
"from": "2026-01-01",
"to": "2026-01-31"
},
"timezone": "UTC",
"statTypes": [
"code-prs-merged"
],
"periodLength": "week",
"include": {
"data": true
}
}
'import requests
url = "https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv"
payload = {
"dateRange": {
"from": "2026-01-01",
"to": "2026-01-31"
},
"timezone": "UTC",
"statTypes": ["code-prs-merged"],
"periodLength": "week",
"include": { "data": True }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dateRange: {from: '2026-01-01', to: '2026-01-31'},
timezone: 'UTC',
statTypes: ['code-prs-merged'],
periodLength: 'week',
include: {data: true}
})
};
fetch('https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dateRange' => [
'from' => '2026-01-01',
'to' => '2026-01-31'
],
'timezone' => 'UTC',
'statTypes' => [
'code-prs-merged'
],
'periodLength' => 'week',
'include' => [
'data' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv"
payload := strings.NewReader("{\n \"dateRange\": {\n \"from\": \"2026-01-01\",\n \"to\": \"2026-01-31\"\n },\n \"timezone\": \"UTC\",\n \"statTypes\": [\n \"code-prs-merged\"\n ],\n \"periodLength\": \"week\",\n \"include\": {\n \"data\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dateRange\": {\n \"from\": \"2026-01-01\",\n \"to\": \"2026-01-31\"\n },\n \"timezone\": \"UTC\",\n \"statTypes\": [\n \"code-prs-merged\"\n ],\n \"periodLength\": \"week\",\n \"include\": {\n \"data\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dateRange\": {\n \"from\": \"2026-01-01\",\n \"to\": \"2026-01-31\"\n },\n \"timezone\": \"UTC\",\n \"statTypes\": [\n \"code-prs-merged\"\n ],\n \"periodLength\": \"week\",\n \"include\": {\n \"data\": true\n }\n}"
response = http.request(request)
puts response.read_bodyID,Name,Job Title,Stat,Date,Value
employee-avery,Avery Chen,Engineer,Pull requests merged,2026-01-05,2{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "<string>",
"requestId": "<string>"
}
}Export employee stats as CSV
Streams stats-export.csv as a downloadable attachment with columns ID, Name, Job Title, Stat, Date, and Value. Disabled and archived definitions are excluded. Select data by date range, stat identifiers or definition IDs, employee filter, and period length. Each row represents an employee, stat, and period; Stat contains the definition’s display label. Includes matching employees without data and fills missing values with 0 for periods present in the selected data. With no selected data, the file contains only the header. include.data does not change the CSV output. Viewing stats for all employees requires workspace-wide analytics access. Other callers can read their own stats and those of their direct and indirect reports, plus employees covered by delegated reporting access. Employee filters only narrow that access.
curl --request POST \
--url https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dateRange": {
"from": "2026-01-01",
"to": "2026-01-31"
},
"timezone": "UTC",
"statTypes": [
"code-prs-merged"
],
"periodLength": "week",
"include": {
"data": true
}
}
'import requests
url = "https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv"
payload = {
"dateRange": {
"from": "2026-01-01",
"to": "2026-01-31"
},
"timezone": "UTC",
"statTypes": ["code-prs-merged"],
"periodLength": "week",
"include": { "data": True }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dateRange: {from: '2026-01-01', to: '2026-01-31'},
timezone: 'UTC',
statTypes: ['code-prs-merged'],
periodLength: 'week',
include: {data: true}
})
};
fetch('https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dateRange' => [
'from' => '2026-01-01',
'to' => '2026-01-31'
],
'timezone' => 'UTC',
'statTypes' => [
'code-prs-merged'
],
'periodLength' => 'week',
'include' => [
'data' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv"
payload := strings.NewReader("{\n \"dateRange\": {\n \"from\": \"2026-01-01\",\n \"to\": \"2026-01-31\"\n },\n \"timezone\": \"UTC\",\n \"statTypes\": [\n \"code-prs-merged\"\n ],\n \"periodLength\": \"week\",\n \"include\": {\n \"data\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dateRange\": {\n \"from\": \"2026-01-01\",\n \"to\": \"2026-01-31\"\n },\n \"timezone\": \"UTC\",\n \"statTypes\": [\n \"code-prs-merged\"\n ],\n \"periodLength\": \"week\",\n \"include\": {\n \"data\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gowindmill.com/api/v2/c/{companyId}/stats/export/csv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dateRange\": {\n \"from\": \"2026-01-01\",\n \"to\": \"2026-01-31\"\n },\n \"timezone\": \"UTC\",\n \"statTypes\": [\n \"code-prs-merged\"\n ],\n \"periodLength\": \"week\",\n \"include\": {\n \"data\": true\n }\n}"
response = http.request(request)
puts response.read_bodyID,Name,Job Title,Stat,Date,Value
employee-avery,Avery Chen,Engineer,Pull requests merged,2026-01-05,2{
"error": {
"code": "BAD_REQUEST",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "<string>",
"requestId": "<string>"
}
}Authorizations
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.
Authorization: Bearer wm_api_example
OAuth access tokens are issued for connected Windmill applications.
Authorization: Bearer <OAUTH_ACCESS_TOKEN>
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
Body
Date range, stat selection, and employee filter for series or CSV output.
Response
CSV containing the selected stat series.
CSV file with one row per employee, stat, and period. Periods without a stored value for an employee are exported as 0.
Was this page helpful?