curl --request GET \
--url https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by"
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>', 'OW-KEY': '<api-key>'}};
fetch('https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by', 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.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"OW-KEY: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": 123,
"status": "ok"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Count work orders
Count of work orders matching the given filters. The count runs the same search-index query as the list endpoint, so it always agrees with the list results. It accepts the same filters (listed as parameters below), ignores the same unsupported parameters, and has the same brief lag before a just-created work order is counted. Filters are combined with the tenant-security filters derived from the API key.
curl --request GET \
--url https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by"
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>', 'OW-KEY': '<api-key>'}};
fetch('https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by', 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.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"OW-KEY: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/buyer/work_order/work_orders/count_by")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": 123,
"status": "ok"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Authorizations
Query Parameters
Full-text search. Matches words (with prefix and stem matching) across the title, description, location name, notes, service call check-in/check-out notes, problem type name, and reference numbers (work order number, PO number, asset serial number). Wrap the value in double quotes to require the exact phrase.
The detailed workflow status, for example statuses=WaitingForReview to find work ready for your review. Values are listed in the status model. One value. To match several, use the plural key.
The detailed workflow status, for example statuses=WaitingForReview to find work ready for your review. Values are listed in the status model. Comma-separated list; matches any value listed.
The detailed workflow status, for example statuses=WaitingForReview to find work ready for your review. Values are listed in the status model. Comma-separated list; excludes every value listed.
true returns work still in progress (display status Pending, Open, InProgress, or OnHold). false returns closed work (Completed or Cancelled). Deferred work orders match neither value. Archived work orders are included either way; add hasBuyerArchived=false to leave them out.
true, false Work at these locations. Get location ids from GET /v1/buyer/location/locations. One value. To match several, use the plural key.
Work at these locations. Get location ids from GET /v1/buyer/location/locations. Comma-separated list; matches any value listed.
Work on these assets, whether as the main asset or a sub-asset. Get asset ids from GET /v1/buyer/asset/assets. One value. To match several, use the plural key.
Work on these assets, whether as the main asset or a sub-asset. Get asset ids from GET /v1/buyer/asset/assets. Comma-separated list; matches any value listed.
Work of these problem types. Get ids from GET /v1/buyer/work_order/problem_types. One value. To match several, use the plural key.
Work of these problem types. Get ids from GET /v1/buyer/work_order/problem_types. Comma-separated list; matches any value listed.
Work carrying at least one of these labels. Get label ids from the label catalog. Comma-separated list; matches any value listed.
true returns only preventive maintenance work generated from a PM schedule; false leaves it out.
true, false Earliest creation time to include. Format MM/dd/yyyy HH:mm:ss, for example 08/01/2026 00:00:00: a local wall-clock time read in timezone, or UTC when timezone is omitted. Don't include an offset in the value: it is ignored. The bound is inclusive. Send either end on its own for an open-ended range. A non-empty value that doesn't parse, such as an ISO 8601 value or a date without a time, is rejected with 400. An empty value is read as 1 January 1970.
Latest creation time to include. Format MM/dd/yyyy HH:mm:ss, for example 08/01/2026 00:00:00: a local wall-clock time read in timezone, or UTC when timezone is omitted. Don't include an offset in the value: it is ignored. The bound is inclusive and exact, so send 23:59:59 to include the whole end day. Send either end on its own for an open-ended range. A non-empty value that doesn't parse, such as an ISO 8601 value or a date without a time, is rejected with 400. An empty value is read as 1 January 1970.
Earliest completion time to include. Format MM/dd/yyyy HH:mm:ss, for example 08/01/2026 00:00:00: a local wall-clock time read in timezone, or UTC when timezone is omitted. Don't include an offset in the value: it is ignored. The bound is inclusive. Send either end on its own for an open-ended range. A non-empty value that doesn't parse, such as an ISO 8601 value or a date without a time, is rejected with 400. An empty value is read as 1 January 1970.
Latest completion time to include. Format MM/dd/yyyy HH:mm:ss, for example 08/01/2026 00:00:00: a local wall-clock time read in timezone, or UTC when timezone is omitted. Don't include an offset in the value: it is ignored. The bound is inclusive and exact, so send 23:59:59 to include the whole end day. Send either end on its own for an open-ended range. A non-empty value that doesn't parse, such as an ISO 8601 value or a date without a time, is rejected with 400. An empty value is read as 1 January 1970.
Earliest scheduled time of the most recent visit to include. Format MM/dd/yyyy HH:mm:ss, for example 08/01/2026 00:00:00: a local wall-clock time read in timezone, or UTC when timezone is omitted. Don't include an offset in the value: it is ignored. The bound is inclusive. Send either end on its own for an open-ended range. A non-empty value that doesn't parse, such as an ISO 8601 value or a date without a time, is rejected with 400. An empty value is read as 1 January 1970.
Latest scheduled time of the most recent visit to include. Format MM/dd/yyyy HH:mm:ss, for example 08/01/2026 00:00:00: a local wall-clock time read in timezone, or UTC when timezone is omitted. Don't include an offset in the value: it is ignored. The bound is inclusive and exact, so send 23:59:59 to include the whole end day. Send either end on its own for an open-ended range. A non-empty value that doesn't parse, such as an ISO 8601 value or a date without a time, is rejected with 400. An empty value is read as 1 January 1970.
Follow-up work created from one walkthrough task: the siteSurveyTaskTitleId you sent when creating the work order. One value.
Work assigned to these suppliers. Get supplier facility ids from GET /v1/buyer/supplier_facilities. One value. To match several, use the plural key.
Work assigned to these suppliers. Get supplier facility ids from GET /v1/buyer/supplier_facilities. Comma-separated list; matches any value listed.
true returns open work that has stayed overdue for a set period without supplier progress, and that your team hasn't archived. The period is set for your company (14 days by default). Supplier activity on overdue work, such as accepting it or submitting it for review, restarts the period. If your company has turned stale tracking off, new work orders are not marked stale. If your company excludes self-managed suppliers from stale tracking, work orders assigned to a self-managed supplier are never marked stale. Moving work to or from a self-managed supplier clears or restarts its stale tracking.
true, false Optional IANA time zone name, such as America/Chicago or UTC, that this route's date filters are read in. Each date filter value is a local wall-clock time in this zone. When omitted, date filters are read in UTC. Names are case-sensitive. Fixed offsets (-05:00, GMT-5, Z, Etc/GMT+5), abbreviations (CST), and unknown names are rejected with 400. On a daylight saving change day, a time in the skipped hour moves forward by the length of the gap, and a time in the repeated hour means the standard-time (second) occurrence.
"America/Chicago"