curl --request GET \
--url http://localhost:3500/v1/invoices/export \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3500/v1/invoices/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)"<string>"{
"error": {
"code": "validation_error",
"message": "Invalid request format, parameters, or body. Details contain up to 20 actionable field errors; the complete encoded request body must be at most 2 MiB (2,097,152 bytes).",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "Missing or invalid bearer credential.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied: forbidden, token_disabled, organization_required, insufficient_role, or mfa_required. Check the error code and effective permissions.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "One or more selected teams have invalid saved filter rules. Update the team filters before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The IP or authenticated credential exceeded its request limit.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Authentication infrastructure is unavailable or rate limited. Honor Retry-After when provided.",
"request_id": "req_example"
}
}Export selected invoices as CSV
Streams the complete selection using the same filters as list/metrics. Summary rows traverse invoice UUID ascending; line rows traverse invoice UUID, line number and line UUID. Does not accept list cursors or sorting. Live traversal reapplies filters and team definitions per batch: concurrent changes may move records into or out of later batches, and the export is not a snapshot. Invoice-items emits one row per stored line (invoices without lines contribute no rows). Exact decimals, blank nulls, JSON arrays, UTF-8 BOM, CRLF and formula-safe text. Empty selections contain the header. Failures after streaming starts terminate the download; retry starts a fresh export. No saved file or byte-range resume. Use parseAs: stream with the generated client.
curl --request GET \
--url http://localhost:3500/v1/invoices/export \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3500/v1/invoices/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices/export"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)"<string>"{
"error": {
"code": "validation_error",
"message": "Invalid request format, parameters, or body. Details contain up to 20 actionable field errors; the complete encoded request body must be at most 2 MiB (2,097,152 bytes).",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "Missing or invalid bearer credential.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied: forbidden, token_disabled, organization_required, insufficient_role, or mfa_required. Check the error code and effective permissions.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "One or more selected teams have invalid saved filter rules. Update the team filters before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The IP or authenticated credential exceeded its request limit.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Authentication infrastructure is unavailable or rate limited. Honor Retry-After when provided.",
"request_id": "req_example"
}
}Authorizations
Personal API key. Send X-Organization-Id. The required cumulative level is listed in x-watchdog-permission.
Headers
Required for personal API keys. Target one organization you have access to. Migrated keys may omit it to use their original organization. For Clerk sessions, it must match the active organization.
Query Parameters
Match the shared teams the authenticated user belongs to in this organization. Teams combine with OR; other filters combine with AND. No memberships or saved rules means no matches. Cannot be combined with team_ids when true.
true, false Shared team IDs (maximum 50; comma-separated in a query string, a JSON array in a command body). Teams combine with OR. Missing, foreign, or personal teams return 404; invalid saved rules return 409.
Case-insensitive substring match on invoice number or title.
1 - 200Match any canonical supplier UUID or literal null for no supplier. Maximum 50 comma-separated values; omit for all suppliers. Empty entries are invalid.
Match any canonical recipient UUID or literal null for no recipient. Maximum 50 comma-separated values; omit for all recipients. Empty entries are invalid.
Match any listed category: invoice, credit_note, self_billed_invoice. Maximum 50 comma-separated values; omit for all categories.
Match any three-letter currency code (case-insensitive), or literal null for unknown currency. Maximum 50 comma-separated values; omit for all currencies. Example: NOK,EUR,null.
and requires every supplied column filter; or requires at least one. Both bounds within each date range must match, and that range is one group member. Organization, published/deleted state, search, agreement_ids and mine/team scope are always required outside the group. No column filters means no group restriction.
and, or Apply to supplier_ids: is matches any selected value; is_not excludes all selected values. Omitted selections add no restriction. is_not requires a selection. For nullable fields, exclusion includes null unless null is explicitly excluded.
is, is_not Apply to recipient_ids: is matches any selected value; is_not excludes all selected values. Omitted selections add no restriction. is_not requires a selection. For nullable fields, exclusion includes null unless null is explicitly excluded.
is, is_not Apply to categories: is matches any selected value; is_not excludes all selected values. Omitted selections add no restriction. is_not requires a selection. For nullable fields, exclusion includes null unless null is explicitly excluded.
is, is_not Apply to currency_codes: is matches any selected value; is_not excludes all selected values. Omitted selections add no restriction. is_not requires a selection. For nullable fields, exclusion includes null unless null is explicitly excluded.
is, is_not Apply to confidence_levels: is matches any selected value; is_not excludes all selected values. Omitted selections add no restriction. is_not requires a selection. For nullable fields, exclusion includes null unless null is explicitly excluded.
is, is_not Apply to check_statuses: is matches any selected value; is_not excludes all selected values. Omitted selections add no restriction. is_not requires a selection. For nullable fields, exclusion includes null unless null is explicitly excluded.
is, is_not Apply to alert_statuses: is matches any selected value; is_not excludes all selected values. Omitted selections add no restriction. is_not requires a selection. For nullable fields, exclusion includes null unless null is explicitly excluded.
is, is_not Combined alert status, in precedence order: credited (fully financially covered by credit notes), checking (active checks), has_issues (pending or claimed alerts), clean (completed coverage without open alerts), not_checked (all remaining coverage). Uses alert_scope. Comma-separated, maximum 50; omit for all states.
Original extraction confidence: high, mid, low or unknown. Both successful creating-import stages must retain confidence assessments and stage fingerprints; publication validates their respective cache keys. The lower level wins. Structured/XML creation and unavailable history are unknown. Comma-separated, maximum 50; omit for all levels.
Canonical check coverage in alert_scope: not_checkable (credit note or recorded credit-note match), checking (active work), not_checked (no check recorded), completed (all current matches checked), incomplete (missing, failed, cancelled, outdated or unknown coverage). Comma-separated, maximum 50; omit for all states.
true requires at least one recorded credit-note relationship; false selects zero. For invoice/self_billed_invoice this means linked credit notes; for credit_note this means matched invoices. Includes retained links to soft-deleted counterparts. Does not establish financial resolution. Omit for either.
true, false Selected scope requires agreement_ids and evaluates only currently matched selected agreements. Applies to checks, alert counts, filters and metrics.
invoice, selected_agreements Earliest issue date (YYYY-MM-DD), inclusive. Unknown dates do not match this range. Omit for no bound.
^\d{4}-\d{2}-\d{2}$Latest issue date (YYYY-MM-DD), inclusive. Unknown dates do not match this range. Omit for no bound.
^\d{4}-\d{2}-\d{2}$Earliest due date (YYYY-MM-DD), inclusive. Unknown dates do not match this range. Omit for no bound.
^\d{4}-\d{2}-\d{2}$Latest due date (YYYY-MM-DD), inclusive. Unknown dates do not match this range. Omit for no bound.
^\d{4}-\d{2}-\d{2}$Filter by deterministic financial validation, independent of extraction confidence or human approval.
true, false Filter by explicit human extraction confirmation. Does not change confidence or financial validity.
true, false true selects unconfirmed low/mid extraction confidence, unmatched credit notes, or financially invalid invoices. false selects the exact complement. Always combines with the other selection using AND. Unknown confidence alone does not recommend review.
true, false Comma-separated agreement IDs (maximum 50). Select invoices matched to any listed agreement in the target organization, regardless of agreement status. Unknown, deleted, or foreign agreements contribute no matches. Combines with other filters using AND; invoices are returned and counted once even if matched to several selected agreements.
true requires at least one current organization-owned, nondeleted agreement match; false requires none. Omit for either. Independent of credit-note matching and completed checks.
true, false true is equivalent to check_statuses=completed in alert_scope; false includes every other state. Omit for either.
true, false true excludes credit notes and invoices with recorded credit-note matches; false selects those excluded resources. Eligibility is invoice-wide even in selected-agreement scope. Omit for either.
true, false true requires retained pending or claimed alerts in alert_scope (including outdated findings); false requires none. No open alerts does not prove completed checks. Omit for either.
true, false false selects active invoices; true selects only soft-deleted invoices.
true, false invoice emits one row per selected invoice; invoice-items emits one row per stored line with invoice columns repeated. Invoices without lines contribute no invoice-items rows.
invoice, invoice-items Response
Streaming CSV download. Success requires reading the entire body; HTTP 200 alone does not establish completion.
The response is of type file.