curl --request PATCH \
--url https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedVersion": 1,
"name": "Weekly engineering activity"
}
'import requests
url = "https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}"
payload = {
"expectedVersion": 1,
"name": "Weekly engineering activity"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedVersion: 1, name: 'Weekly engineering activity'})
};
fetch('https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}', 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/views/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expectedVersion' => 1,
'name' => 'Weekly engineering activity'
]),
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/views/{id}"
payload := strings.NewReader("{\n \"expectedVersion\": 1,\n \"name\": \"Weekly engineering activity\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedVersion\": 1,\n \"name\": \"Weekly engineering activity\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedVersion\": 1,\n \"name\": \"Weekly engineering activity\"\n}"
response = http.request(request)
puts response.read_body{
"view": {
"id": "22222222-2222-4222-8222-222222222222",
"version": 1
}
}{
"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": "CONFLICT",
"message": "<string>",
"requestId": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"resourceId": "<string>"
}
]
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "<string>",
"requestId": "<string>"
}
}Update a stat view
Updates a saved view owned by the caller. Supply expectedVersion from the latest view response and at least one of name, statMetadataIds, or employeeFilter. Omitted fields are preserved; supplied arrays and filters replace their previous values. A successful update increments the version. A stale version returns 409: reload the view before retrying. Recipients cannot edit a shared view. The same size and filter limits as creation apply. Requires access to Analytics in the workspace. Sharing a view shares its saved selections; each viewer can still read only the employee stats their own permissions allow.
curl --request PATCH \
--url https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedVersion": 1,
"name": "Weekly engineering activity"
}
'import requests
url = "https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}"
payload = {
"expectedVersion": 1,
"name": "Weekly engineering activity"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedVersion: 1, name: 'Weekly engineering activity'})
};
fetch('https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}', 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/views/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expectedVersion' => 1,
'name' => 'Weekly engineering activity'
]),
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/views/{id}"
payload := strings.NewReader("{\n \"expectedVersion\": 1,\n \"name\": \"Weekly engineering activity\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedVersion\": 1,\n \"name\": \"Weekly engineering activity\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gowindmill.com/api/v2/c/{companyId}/stats/views/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedVersion\": 1,\n \"name\": \"Weekly engineering activity\"\n}"
response = http.request(request)
puts response.read_body{
"view": {
"id": "22222222-2222-4222-8222-222222222222",
"version": 1
}
}{
"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": "CONFLICT",
"message": "<string>",
"requestId": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"resourceId": "<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
Supply expectedVersion and at least one saved view field. Omitted fields are preserved. Supplied arrays and filters replace their previous values. Maximum JSON size is 32 KiB.
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.
1 - 50 elements["11111111-1111-4111-8111-111111111111"]
Was this page helpful?