{
  "openapi": "3.1.1",
  "info": {
    "title": "Eternify Ledger API: Settings",
    "version": "v1",
    "x-wire-version": "2026-08-31",
    "description": "Workspace and ledger settings. The same operations the Eternify Ledger app and its connected AI tools use, over HTTPS and JSON. Send a key or an access token as a bearer token. Each operation is stable or beta: a stable operation changes only with 365 days' notice, a beta one with 30. Changes are listed in the changelog at https://www.eternifylabs.com/resources/developers/changelog.",
    "contact": {
      "name": "Eternify Labs developer resources",
      "url": "https://www.eternifylabs.com/resources/developers"
    }
  },
  "servers": [
    {
      "url": "https://api.eternifylabs.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "oauth": []
    }
  ],
  "tags": [
    {
      "name": "settings",
      "description": "Workspace and ledger settings.",
      "x-display-name": "Settings"
    }
  ],
  "paths": {
    "/v1/api-keys": {
      "get": {
        "operationId": "listApiKeys",
        "summary": "Lists the API keys of the ledger, with their scopes and status.",
        "description": "Lists the API keys of the ledger, with their scopes and status. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "active",
              "type": "string",
              "enum": [
                "active",
                "all"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListApiKeysResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "active": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "all": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "active",
                        "all"
                      ],
                      "additionalProperties": false
                    },
                    "access": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "open": {
                              "type": "boolean",
                              "const": true
                            }
                          },
                          "required": [
                            "open"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "open": {
                              "type": "boolean",
                              "const": false
                            },
                            "code": {
                              "type": "string",
                              "enum": [
                                "api_access_not_enabled",
                                "api_access_ledger_closed"
                              ]
                            },
                            "detail": {
                              "type": "string",
                              "minLength": 1
                            },
                            "remedy": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "open",
                            "code",
                            "detail",
                            "remedy"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts",
                    "access"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/api-keys/deprecated-calls": {
      "get": {
        "operationId": "listApiKeyDeprecatedCalls",
        "summary": "Lists the days on which API keys called operations that are being retired, with the number of calls.",
        "description": "Lists the days on which API keys called operations that are being retired, with the number of calls. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "apiKeyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "operation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "apiKeyId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "keyPrefix": {
                            "type": "string",
                            "minLength": 1
                          },
                          "operation": {
                            "type": "string",
                            "minLength": 1
                          },
                          "day": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "calls": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "apiKeyId",
                          "keyPrefix",
                          "operation",
                          "day",
                          "calls"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/api-keys/{apiKeyId}/activity": {
      "get": {
        "operationId": "listApiKeyActivity",
        "summary": "Lists the requests made with an API key, newest first.",
        "description": "Lists the requests made with an API key, newest first. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "apiKeyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "default": 30,
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/History"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/api-keys/{apiKeyId}/revoke": {
      "post": {
        "operationId": "revokeApiKey",
        "summary": "Revokes an API key so it can no longer be used.",
        "description": "Revokes an API key so it can no longer be used. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "apiKeyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListApiKeysResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/approval-authorities": {
      "get": {
        "operationId": "listApprovalAuthorities",
        "summary": "Lists the approval authorities the ledger has granted, with their limits.",
        "description": "Lists the approval authorities the ledger has granted, with their limits. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "subjectKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILL",
                "ORDER",
                "RUN"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "default": "IN_FORCE",
              "type": "string",
              "enum": [
                "IN_FORCE",
                "ENDING",
                "EXPIRED",
                "CLOSED",
                "CARRIED_OVER",
                "ALL"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 80
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListApprovalAuthoritiesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/approval-authorities/as-at/export": {
      "get": {
        "operationId": "approvalAuthoritiesAsAt",
        "summary": "Returns the approval authorities as they stood on a given date.",
        "description": "Returns the approval authorities as they stood on a given date. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "default": "PDF",
              "type": "string",
              "enum": [
                "PDF",
                "XLSX",
                "CSV"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "filename": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string"
                    },
                    "encoding": {
                      "type": "string",
                      "enum": [
                        "utf-8",
                        "base64"
                      ]
                    },
                    "rowCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "filename",
                    "contentType",
                    "content",
                    "encoding",
                    "rowCount"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/approval-authorities/preview": {
      "get": {
        "operationId": "previewApprovalAuthority",
        "summary": "Previews an approval authority before it is granted.",
        "description": "Previews an approval authority before it is granted. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "subjectKind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "BILL",
                "ORDER",
                "RUN"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "scopeKind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ANY",
                "ACCOUNT",
                "DIMENSION_VALUE",
                "VENDOR"
              ]
            }
          },
          {
            "name": "scopeRefId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "capMinor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          {
            "name": "ownWorkCapMinor",
            "in": "query",
            "required": false,
            "schema": {
              "default": "0",
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "to": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "considered": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "covered": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "wouldAllow": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "wouldRefuseOverCap": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "wouldRefuseOwnWork": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "largestCoveredMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "currency": {
                      "type": "string"
                    },
                    "refused": {
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "approvedByName": {
                            "type": "string"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "why": {
                            "type": "string",
                            "enum": [
                              "OVER_CAP",
                              "OWN_WORK"
                            ]
                          }
                        },
                        "required": [
                          "billId",
                          "number",
                          "supplierName",
                          "approvedByName",
                          "totalMinor",
                          "why"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "from",
                    "to",
                    "entityTimeZone",
                    "considered",
                    "covered",
                    "wouldAllow",
                    "wouldRefuseOverCap",
                    "wouldRefuseOwnWork",
                    "largestCoveredMinor",
                    "currency",
                    "refused"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/approval-authorities/{authorityId}": {
      "get": {
        "operationId": "getApprovalAuthority",
        "summary": "Returns one approval authority and its history.",
        "description": "Returns one approval authority and its history. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "authorityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListApprovalAuthoritiesResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/approval-authorities/{authorityId}/withdraw": {
      "post": {
        "operationId": "withdrawApprovalAuthority",
        "summary": "Withdraws an approval authority from a person.",
        "description": "Withdraws an approval authority from a person. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "authorityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListApprovalAuthoritiesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/approval-substitutes": {
      "get": {
        "operationId": "listApprovalSubstitutes",
        "summary": "Lists the people covering approvals for someone away.",
        "description": "Lists the people covering approvals for someone away. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "current",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListApprovalSubstitutesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/approval-substitutes/{substituteId}/end": {
      "post": {
        "operationId": "endApprovalSubstitute",
        "summary": "Ends a substitute's cover for an approver.",
        "description": "Ends a substitute's cover for an approver. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "substituteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListApprovalSubstitutesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/company-scope/impact": {
      "get": {
        "operationId": "getCompanyScopeImpact",
        "summary": "Returns what narrowing a person's companies would change.",
        "description": "Returns what narrowing a person's companies would change. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "ledgerId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "userId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "SOME"
              ]
            }
          },
          {
            "name": "keep",
            "in": "query",
            "required": false,
            "description": "Company ids, separated by commas, at most 100.",
            "schema": {
              "type": "string",
              "description": "Company ids, separated by commas, at most 100."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "lostCompanies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "shortName": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "deskBills": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "authorityRows": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "inboxAddresses": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "computedAt": {
                      "type": "string",
                      "minLength": 20
                    }
                  },
                  "required": [
                    "userId",
                    "lostCompanies",
                    "deskBills",
                    "authorityRows",
                    "inboxAddresses",
                    "computedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/company-scope/suggestions": {
      "get": {
        "operationId": "listCompanyScopeSuggestions",
        "summary": "Lists the company scope changes the ledger suggests.",
        "description": "Lists the company scope changes the ledger suggests. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "userId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "windowDays": {
                            "type": "number",
                            "const": 90
                          },
                          "actions": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "byCompany": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "entityId": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "actions": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "entityId",
                                "name",
                                "actions"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "suggest": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "shortName": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "companiesOnBooks": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "userId",
                          "name",
                          "role",
                          "windowDays",
                          "actions",
                          "byCompany",
                          "suggest",
                          "companiesOnBooks"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/controls/auto-approvals": {
      "get": {
        "operationId": "listControlAutoApprovals",
        "summary": "Lists the approvals the ledger's controls made without a person.",
        "description": "Lists the approvals the ledger's controls made without a person. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "ENTRY",
                              "MATCH"
                            ]
                          },
                          "ruleId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ruleSourceText": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ruleVersion": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "authorName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entryId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entryRef": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entryDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amountMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "firedAt": {
                            "type": "string",
                            "minLength": 20
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "ruleId",
                          "ruleSourceText",
                          "ruleVersion",
                          "authorName",
                          "entryId",
                          "entryRef",
                          "entryDate",
                          "amountMinor",
                          "currency",
                          "reason",
                          "firedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/controls/changes": {
      "get": {
        "operationId": "listControlChanges",
        "summary": "Lists the changes made to the ledger's controls.",
        "description": "Lists the changes made to the ledger's controls. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "APPROVAL_CEILING",
                              "RULE_THRESHOLD",
                              "PERIOD_LOCK",
                              "APPROVAL_AUTHORITY",
                              "APPROVAL_ROUTING"
                            ]
                          },
                          "action": {
                            "type": "string"
                          },
                          "at": {
                            "type": "string",
                            "minLength": 20
                          },
                          "attribution": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "beforeMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "afterMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "detail": {
                            "type": "string"
                          },
                          "targetType": {
                            "type": "string"
                          },
                          "targetId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "action",
                          "at",
                          "attribution",
                          "subject",
                          "beforeMinor",
                          "afterMinor",
                          "currency",
                          "detail",
                          "targetType",
                          "targetId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/controls/framework": {
      "get": {
        "operationId": "getControlsFramework",
        "summary": "Returns the controls framework the ledger is run against.",
        "description": "Returns the controls framework the ledger is run against. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "area",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "INVOICES"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "COVERED",
                "PARTIAL",
                "MISSING"
              ]
            }
          },
          {
            "name": "component",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "CONTROL_ENVIRONMENT",
                "RISK_ASSESSMENT",
                "CONTROL_ACTIVITIES",
                "INFORMATION_AND_COMMUNICATION",
                "MONITORING_ACTIVITIES"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "pattern": "^[a-z]+\\.[a-z0-9-]+$"
                          },
                          "area": {
                            "type": "string",
                            "enum": [
                              "INVOICES"
                            ]
                          },
                          "control": {
                            "type": "string",
                            "minLength": 1
                          },
                          "component": {
                            "type": "string",
                            "enum": [
                              "CONTROL_ENVIRONMENT",
                              "RISK_ASSESSMENT",
                              "CONTROL_ACTIVITIES",
                              "INFORMATION_AND_COMMUNICATION",
                              "MONITORING_ACTIVITIES"
                            ]
                          },
                          "principle": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 17
                          },
                          "principleName": {
                            "type": "string",
                            "minLength": 1
                          },
                          "enforcement": {
                            "type": "string",
                            "minLength": 1
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "COVERED",
                              "PARTIAL",
                              "MISSING"
                            ]
                          },
                          "statusReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "evidenceHref": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "evidenceLabel": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "key",
                          "area",
                          "control",
                          "component",
                          "principle",
                          "principleName",
                          "enforcement",
                          "status",
                          "statusReason",
                          "evidenceHref",
                          "evidenceLabel"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "covered": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "partial": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "missing": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "covered",
                        "partial",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "computedAt": {
                      "type": "string",
                      "minLength": 20
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts",
                    "computedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/controls/overrides": {
      "get": {
        "operationId": "listControlOverrides",
        "summary": "Lists the times a person overrode a control, with the reason given.",
        "description": "Lists the times a person overrode a control, with the reason given. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "TAX",
                              "FX"
                            ]
                          },
                          "on": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "entryId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "determined": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "chosen": {
                            "type": "string"
                          },
                          "amountMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "byName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "at": {
                            "type": "string",
                            "minLength": 20
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "on",
                          "subject",
                          "entryId",
                          "determined",
                          "chosen",
                          "amountMinor",
                          "currency",
                          "reason",
                          "byName",
                          "at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-field-values/{recordKind}/{recordId}": {
      "put": {
        "operationId": "setCustomFieldValues",
        "summary": "Sets custom field values on a customer, invoice, credit note, product or contract. Send only changed fields: null clears one, one left out is kept.",
        "description": "Sets custom field values on a customer, invoice, credit note, product or contract. Send only changed fields: null clears one, one left out is kept. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "recordKind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetCustomFieldValuesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recordKind": {
                      "type": "string",
                      "enum": [
                        "CUSTOMER",
                        "INVOICE",
                        "CREDIT_MEMO",
                        "PRODUCT",
                        "CONTRACT"
                      ]
                    },
                    "recordId": {
                      "type": "string"
                    },
                    "customFields": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "recordKind",
                    "recordId",
                    "customFields"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-fields": {
      "get": {
        "operationId": "listCustomFieldDefinitions",
        "summary": "Lists the custom fields the ledger defines for its records.",
        "description": "Lists the custom fields the ledger defines for its records. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "recordKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "CUSTOMER",
                "INVOICE",
                "CREDIT_MEMO",
                "PRODUCT",
                "CONTRACT",
                "VENDOR",
                "BILL",
                "PURCHASE_ORDER",
                "JOURNAL_ENTRY",
                "CUSTOM_OBJECT",
                "LINE"
              ]
            }
          },
          {
            "name": "objectKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CreateCustomFieldDefinitionResponse"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createCustomFieldDefinition",
        "summary": "Defines a custom field for a kind of record.",
        "description": "Defines a custom field for a kind of record. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recordKind": {
                    "type": "string",
                    "enum": [
                      "CUSTOMER",
                      "INVOICE",
                      "CREDIT_MEMO",
                      "PRODUCT",
                      "CONTRACT",
                      "VENDOR",
                      "BILL",
                      "PURCHASE_ORDER",
                      "JOURNAL_ENTRY",
                      "CUSTOM_OBJECT",
                      "LINE"
                    ]
                  },
                  "key": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "TEXT",
                      "NUMBER",
                      "DATE",
                      "CHOICE",
                      "CHECKBOX",
                      "MONEY",
                      "MULTI_CHOICE",
                      "REFERENCE"
                    ]
                  },
                  "choices": {
                    "$ref": "#/components/schemas/Choices2"
                  },
                  "required": {
                    "default": false,
                    "type": "boolean"
                  },
                  "showOnDocument": {
                    "default": false,
                    "type": "boolean"
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "appliesTo": {
                    "$ref": "#/components/schemas/AppliesTo2"
                  },
                  "objectKey": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "reference": {
                    "type": "object",
                    "properties": {
                      "target": {
                        "type": "string",
                        "enum": [
                          "CUSTOMER",
                          "VENDOR",
                          "PRODUCT",
                          "CONTRACT",
                          "ACCOUNT",
                          "ENTITY",
                          "PERSON",
                          "DIMENSION_VALUE",
                          "CUSTOM_RECORD"
                        ]
                      },
                      "objectKey": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,39}$"
                      },
                      "dimensionCode": {
                        "type": "string",
                        "pattern": "^[A-Z][A-Z0-9_]{1,29}$"
                      }
                    },
                    "required": [
                      "target"
                    ],
                    "additionalProperties": false
                  },
                  "indexed": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "recordKind",
                  "key",
                  "label",
                  "type"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCustomFieldDefinitionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-fields/{definitionId}": {
      "patch": {
        "operationId": "updateCustomFieldDefinition",
        "summary": "Changes the definition of a custom field.",
        "description": "Changes the definition of a custom field. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "definitionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "choices": {
                    "$ref": "#/components/schemas/Choices2"
                  },
                  "required": {
                    "type": "boolean"
                  },
                  "showOnDocument": {
                    "type": "boolean"
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  },
                  "indexed": {
                    "type": "boolean"
                  },
                  "appliesTo": {
                    "$ref": "#/components/schemas/AppliesTo2"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCustomFieldDefinitionResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UndoAgentBatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-fields/{definitionId}/archive": {
      "post": {
        "operationId": "archiveCustomFieldDefinition",
        "summary": "Archives a custom field so it is no longer offered on records.",
        "description": "Archives a custom field so it is no longer offered on records. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "definitionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "recordKind": {
                      "type": "string",
                      "enum": [
                        "CUSTOMER",
                        "INVOICE",
                        "CREDIT_MEMO",
                        "PRODUCT",
                        "CONTRACT",
                        "VENDOR",
                        "BILL",
                        "PURCHASE_ORDER",
                        "JOURNAL_ENTRY",
                        "CUSTOM_OBJECT",
                        "LINE"
                      ]
                    },
                    "objectKey": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "key": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEXT",
                        "NUMBER",
                        "DATE",
                        "CHOICE",
                        "CHECKBOX",
                        "MONEY",
                        "MULTI_CHOICE",
                        "REFERENCE"
                      ]
                    },
                    "choices": {
                      "$ref": "#/components/schemas/Choices"
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reference": {
                      "$ref": "#/components/schemas/Reference"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "showOnDocument": {
                      "type": "boolean"
                    },
                    "indexed": {
                      "type": "boolean"
                    },
                    "indexState": {
                      "type": "string",
                      "enum": [
                        "OFF",
                        "BUILDING",
                        "READY"
                      ]
                    },
                    "indexJobId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "appliesTo": {
                      "$ref": "#/components/schemas/AppliesTo"
                    },
                    "position": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "archivedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "archivedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "updatedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "affectedRules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "recordKind",
                    "objectKey",
                    "key",
                    "label",
                    "description",
                    "type",
                    "choices",
                    "currency",
                    "reference",
                    "required",
                    "showOnDocument",
                    "indexed",
                    "appliesTo",
                    "position",
                    "archivedAt",
                    "archivedBy",
                    "createdBy",
                    "createdAt",
                    "updatedBy",
                    "updatedAt",
                    "affectedRules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-fields/{definitionId}/restore": {
      "post": {
        "operationId": "restoreCustomFieldDefinition",
        "summary": "Restores an archived custom field.",
        "description": "Restores an archived custom field. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "definitionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCustomFieldDefinitionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects": {
      "get": {
        "operationId": "listCustomObjectTypes",
        "summary": "Lists the custom objects the ledger defines, such as projects, with how many fields and records each has.",
        "description": "Lists the custom objects the ledger defines, such as projects, with how many fields and records each has. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListCustomObjectTypesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createCustomObjectType",
        "summary": "Defines a custom object for the ledger, such as a project, with a key that never changes.",
        "description": "Defines a custom object for the ledger, such as a project, with a key that never changes. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "singularLabel": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "pluralLabel": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "numberPrefix": {
                    "type": "string",
                    "pattern": "^[A-Z][A-Z0-9-]{0,9}$"
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "required": [
                  "key",
                  "singularLabel",
                  "pluralLabel"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomObjectTypesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects/{objectKey}": {
      "get": {
        "operationId": "getCustomObjectType",
        "summary": "Returns one custom object the ledger defines, by its key.",
        "description": "Returns one custom object the ledger defines, by its key. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomObjectTypesResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "patch": {
        "operationId": "updateCustomObjectType",
        "summary": "Changes the labels, description, number prefix or position of a custom object.",
        "description": "Changes the labels, description, number prefix or position of a custom object. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "singularLabel": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "pluralLabel": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "numberPrefix": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z][A-Z0-9-]{0,9}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomObjectTypesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects/{objectKey}/archive": {
      "post": {
        "operationId": "archiveCustomObjectType",
        "summary": "Archives a custom object so no record of it can be added, keeping its records.",
        "description": "Archives a custom object so no record of it can be added, keeping its records. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomObjectTypesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects/{objectKey}/records": {
      "get": {
        "operationId": "listCustomRecords",
        "summary": "Lists the records of one custom object, filtered on its fields and sorted on an indexed field.",
        "description": "Lists the records of one custom object, filtered on its fields and sorted on an indexed field. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "cf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(name|number|createdAt|cf\\.[a-z][a-z0-9_]{0,39})$"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "include",
                "only"
              ]
            }
          },
          {
            "name": "linkedTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z_]+(:[a-z][a-z0-9_]{0,39})?:[^:\\s]{1,100}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListCustomRecordsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createCustomRecord",
        "summary": "Creates a record of a custom object, such as a project.",
        "description": "Creates a record of a custom object, such as a project. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "values": {
                    "$ref": "#/components/schemas/CustomFields"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomRecordsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects/{objectKey}/records/{recordId}": {
      "get": {
        "operationId": "getCustomRecord",
        "summary": "Returns one record of a custom object.",
        "description": "Returns one record of a custom object. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomRecordsResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "patch": {
        "operationId": "updateCustomRecord",
        "summary": "Changes a custom object record's name or values. Send only changed values: null clears one, one left out is kept.",
        "description": "Changes a custom object record's name or values. Send only changed values: null clears one, one left out is kept. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "values": {
                    "$ref": "#/components/schemas/CustomFields6"
                  },
                  "ifRevision": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomRecordsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects/{objectKey}/records/{recordId}/archive": {
      "post": {
        "operationId": "archiveCustomRecord",
        "summary": "Archives a custom object record, keeping it so it can be restored.",
        "description": "Archives a custom object record, keeping it so it can be restored. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomRecordsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects/{objectKey}/records/{recordId}/restore": {
      "post": {
        "operationId": "restoreCustomRecord",
        "summary": "Restores an archived custom object record.",
        "description": "Restores an archived custom object record. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomRecordsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/custom-objects/{objectKey}/restore": {
      "post": {
        "operationId": "restoreCustomObjectType",
        "summary": "Restores an archived custom object.",
        "description": "Restores an archived custom object. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCustomObjectTypesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/customisation": {
      "get": {
        "operationId": "getCustomisation",
        "summary": "Returns the version of the ledger's customisation and how many custom objects, fields, line fields, rules and dimensions it holds.",
        "description": "Returns the version of the ledger's customisation and how many custom objects, fields, line fields, rules and dimensions it holds. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ledgerId": {
                      "type": "string"
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "changedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "counts": {
                      "$ref": "#/components/schemas/Counts"
                    },
                    "fieldCounts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "enum": [
                          "CUSTOMER",
                          "INVOICE",
                          "CREDIT_MEMO",
                          "PRODUCT",
                          "CONTRACT",
                          "VENDOR",
                          "BILL",
                          "PURCHASE_ORDER",
                          "JOURNAL_ENTRY",
                          "CUSTOM_OBJECT",
                          "LINE"
                        ]
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "lineFieldCounts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "enum": [
                          "PURCHASE_ORDER_LINE",
                          "GOODS_RECEIPT_LINE",
                          "BILL_LINE",
                          "VENDOR_CREDIT_LINE",
                          "INVOICE_LINE",
                          "CREDIT_MEMO_LINE",
                          "JOURNAL_LINE"
                        ]
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    }
                  },
                  "required": [
                    "ledgerId",
                    "version",
                    "changedAt",
                    "counts",
                    "fieldCounts",
                    "lineFieldCounts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/customisation/catalogue": {
      "get": {
        "operationId": "getCustomisationCatalogue",
        "summary": "Returns everything the ledger customised: its custom objects with their operations, and the schema of each customised record and line.",
        "description": "Returns everything the ledger customised: its custom objects with their operations, and the schema of each customised record and line. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ledgerId": {
                      "type": "string"
                    },
                    "version": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "complete": {
                      "type": "boolean",
                      "const": true
                    },
                    "operations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "pattern": "^custom\\.[a-z][a-z0-9_]{0,39}\\.(list|get|create|update|archive|restore)$"
                          },
                          "base": {
                            "type": "string"
                          },
                          "params": {
                            "type": "object",
                            "properties": {
                              "objectKey": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "objectKey"
                            ],
                            "additionalProperties": false
                          },
                          "summary": {
                            "type": "string"
                          },
                          "effectClass": {
                            "type": "string",
                            "enum": [
                              "read",
                              "write",
                              "delete",
                              "money-out",
                              "banking",
                              "cra-filing"
                            ]
                          },
                          "input": {
                            "$ref": "#/components/schemas/Input"
                          },
                          "query": {
                            "$ref": "#/components/schemas/Input"
                          },
                          "output": {
                            "$ref": "#/components/schemas/InputOption1"
                          },
                          "since": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "name",
                          "base",
                          "params",
                          "summary",
                          "effectClass",
                          "input",
                          "query",
                          "output",
                          "since"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "customFields": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "enum": [
                          "CUSTOMER",
                          "INVOICE",
                          "CREDIT_MEMO",
                          "PRODUCT",
                          "CONTRACT",
                          "VENDOR",
                          "BILL",
                          "PURCHASE_ORDER",
                          "JOURNAL_ENTRY",
                          "CUSTOM_OBJECT",
                          "LINE"
                        ]
                      },
                      "additionalProperties": {
                        "$ref": "#/components/schemas/InputOption1"
                      }
                    },
                    "lineFields": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "enum": [
                          "PURCHASE_ORDER_LINE",
                          "GOODS_RECEIPT_LINE",
                          "BILL_LINE",
                          "VENDOR_CREDIT_LINE",
                          "INVOICE_LINE",
                          "CREDIT_MEMO_LINE",
                          "JOURNAL_LINE"
                        ]
                      },
                      "additionalProperties": {
                        "$ref": "#/components/schemas/InputOption1"
                      }
                    },
                    "dimensions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "counts": {
                      "$ref": "#/components/schemas/Counts"
                    }
                  },
                  "required": [
                    "ledgerId",
                    "version",
                    "complete",
                    "operations",
                    "customFields",
                    "lineFields",
                    "dimensions",
                    "counts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/first-week": {
      "get": {
        "operationId": "getFirstWeek",
        "summary": "Returns the first-week checklist for a new ledger.",
        "description": "Returns the first-week checklist for a new ledger. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "readAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "today": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "suppliers": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "active": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "state",
                            "active"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "banking": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "verified": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "owedWithoutVerified": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "waitingForSecondPerson": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "state",
                            "verified",
                            "owedWithoutVerified",
                            "waitingForSecondPerson"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "conversion": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "cutover": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "state": {
                                      "type": "string",
                                      "enum": [
                                        "OPEN",
                                        "SETTLED"
                                      ]
                                    },
                                    "conversionDate": {
                                      "type": "string",
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "state",
                                    "conversionDate"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "liveBills": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "state",
                            "cutover",
                            "liveBills"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "tieOut": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "postedBills": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "tie": {
                              "type": "string",
                              "enum": [
                                "TIED",
                                "NOT_TIED",
                                "NOT_READ"
                              ]
                            }
                          },
                          "required": [
                            "state",
                            "postedBills",
                            "tie"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "inbox": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "addresses": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "handedOut": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "state",
                            "addresses",
                            "handedOut"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "approvalPolicy": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "setByPerson": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "state",
                            "setByPerson"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "parallelRun": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "months": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "signedOff": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "state",
                            "months",
                            "signedOff"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "required": [
                    "entity",
                    "entityTimeZone",
                    "readAt",
                    "today",
                    "suppliers",
                    "banking",
                    "conversion",
                    "tieOut",
                    "inbox",
                    "approvalPolicy",
                    "parallelRun"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/held-outbound": {
      "get": {
        "operationId": "listHeldOutbound",
        "summary": "Lists the messages a test copy held instead of sending, newest first.",
        "description": "Lists the messages a test copy held instead of sending, newest first. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "mail",
                "payment-rail",
                "payment-collect",
                "bank-file",
                "cra-filing",
                "provider-config",
                "books-export",
                "webhook",
                "warehouse"
              ]
            }
          },
          {
            "name": "sender",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListHeldOutboundResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/held-outbound/{heldId}": {
      "get": {
        "operationId": "getHeldOutbound",
        "summary": "Reads one message a test copy held instead of sending, with its recipients, attachments and text.",
        "description": "Reads one message a test copy held instead of sending, with its recipients, attachments and text. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "heldId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListHeldOutboundResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains": {
      "get": {
        "operationId": "listInboundDomains",
        "summary": "Lists the email domains the ledger receives documents from.",
        "description": "Lists the email domains the ledger receives documents from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "VERIFIED",
                "DEGRADED",
                "REMOVED"
              ]
            }
          },
          {
            "name": "includeRemoved",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "true"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListInboundDomainsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains/requests": {
      "post": {
        "operationId": "requestInboundDomain",
        "summary": "Asks to add an email domain for a company and answers the pending domain; read getInboundDomain to see whether the name was claimed.",
        "description": "Asks to add an email domain for a company and answers the pending domain; read getInboundDomain to see whether the name was claimed. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "domain": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "entityId",
                  "domain"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInboundDomainsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains/{domainId}": {
      "get": {
        "operationId": "getInboundDomain",
        "summary": "Returns one inbound email domain with its verification status.",
        "description": "Returns one inbound email domain with its verification status. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInboundDomainsResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains/{domainId}/audit": {
      "get": {
        "operationId": "listInboundDomainAudit",
        "summary": "Lists the audit trail of one inbound email domain.",
        "description": "Lists the audit trail of one inbound email domain. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "NATIVE",
                "IMPORTED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains/{domainId}/check": {
      "post": {
        "operationId": "checkInboundDomain",
        "summary": "Checks the DNS records of an inbound email domain.",
        "description": "Checks the DNS records of an inbound email domain. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInboundDomainsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains/{domainId}/explanation": {
      "post": {
        "operationId": "explainInboundDomain",
        "summary": "Explains the state of an inbound email domain in plain words.",
        "description": "Explains the state of an inbound email domain in plain words. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "facts": {
                      "type": "object",
                      "properties": {
                        "findings": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "NO_MX",
                              "MX_ELSEWHERE",
                              "CNAME_AT_NAME",
                              "NO_PROOF",
                              "PROOF_WRONG",
                              "DOUBLED_SUFFIX",
                              "PROVISION_FAILED"
                            ]
                          }
                        },
                        "failedChecks": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "daysWaiting": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "findings",
                        "failedChecks",
                        "daysWaiting"
                      ],
                      "additionalProperties": false
                    },
                    "checklist": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "finding": {
                            "type": "string",
                            "enum": [
                              "NO_MX",
                              "MX_ELSEWHERE",
                              "CNAME_AT_NAME",
                              "NO_PROOF",
                              "PROOF_WRONG",
                              "DOUBLED_SUFFIX",
                              "PROVISION_FAILED"
                            ]
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "finding",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "paragraph": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "text",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "NOTHING_TO_EXPLAIN"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "facts",
                    "checklist",
                    "paragraph",
                    "why"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains/{domainId}/platform-senders": {
      "get": {
        "operationId": "listPlatformSenders",
        "summary": "Lists the platform senders allowed through an inbound domain.",
        "description": "Lists the platform senders allowed through an inbound domain. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "senderDomain": {
                            "type": "string"
                          },
                          "vendorName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "messages": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lastMessageAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "addressId": {
                            "type": "string"
                          },
                          "addressLabel": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "senderDomain",
                          "vendorName",
                          "messages",
                          "lastMessageAt",
                          "addressId",
                          "addressLabel"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbound-domains/{domainId}/remove": {
      "post": {
        "operationId": "removeInboundDomain",
        "summary": "Removes an inbound email domain.",
        "description": "Removes an inbound email domain. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 280
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListInboundDomainsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbox-controls/advice": {
      "post": {
        "operationId": "draftInboxPolicyAdvice",
        "summary": "Drafts advice on the inbox policy for a person to read.",
        "description": "Drafts advice on the inbox policy for a person to read. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:admin",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "entityId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "windowDays": {
                      "type": "number",
                      "const": 14
                    },
                    "facts": {
                      "type": "object",
                      "properties": {
                        "windowDays": {
                          "type": "number",
                          "const": 14
                        },
                        "arrivals": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "held": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "read": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "notABill": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "stillOpen": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "refused": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "byReason": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "enum": [
                              "UNAUTHENTICATED",
                              "UNKNOWN_SENDER",
                              "SENDER_DAY_MESSAGES",
                              "ADDRESS_DAY_MESSAGES",
                              "SENDER_DAY_SPEND",
                              "ADDRESS_DAY_SPEND",
                              "OVER_DAILY_LIMIT"
                            ]
                          },
                          "additionalProperties": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "required": [
                            "UNAUTHENTICATED",
                            "UNKNOWN_SENDER",
                            "SENDER_DAY_MESSAGES",
                            "ADDRESS_DAY_MESSAGES",
                            "SENDER_DAY_SPEND",
                            "ADDRESS_DAY_SPEND",
                            "OVER_DAILY_LIMIT"
                          ]
                        },
                        "topSenders": {
                          "maxItems": 5,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "domain": {
                                "type": "string"
                              },
                              "arrivals": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "held": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "read": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "known": {
                                "type": "boolean"
                              },
                              "authenticatedAll": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "domain",
                              "arrivals",
                              "held",
                              "read",
                              "known",
                              "authenticatedAll"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "current": {
                          "$ref": "#/components/schemas/Current"
                        }
                      },
                      "required": [
                        "windowDays",
                        "arrivals",
                        "held",
                        "read",
                        "notABill",
                        "stillOpen",
                        "refused",
                        "byReason",
                        "topSenders",
                        "current"
                      ],
                      "additionalProperties": false
                    },
                    "proposal": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Current"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "because": {
                      "maxItems": 2,
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "const": "R1"
                              },
                              "domain": {
                                "type": "string"
                              },
                              "peakDayMessages": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "authenticatedAll": {
                                "type": "boolean",
                                "const": true
                              }
                            },
                            "required": [
                              "rule",
                              "domain",
                              "peakDayMessages",
                              "authenticatedAll"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "const": "R2"
                              },
                              "releasedAuthenticatedUnknown": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "markedNotABillUnknown": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "rule",
                              "releasedAuthenticatedUnknown",
                              "markedNotABillUnknown"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "summary": {
                      "type": "string"
                    },
                    "paragraph": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "text",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "NOTHING_HELD",
                            "LIMIT_REACHED",
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "FIGURE_INVENTED",
                            "CLAIMS_ACTION",
                            "CONTACT_DETAIL",
                            "BANKING_WORDS",
                            "PAYMENT_WORDS"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "dismissed": {
                      "type": "boolean"
                    },
                    "digest": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    }
                  },
                  "required": [
                    "windowDays",
                    "facts",
                    "proposal",
                    "because",
                    "summary",
                    "paragraph",
                    "why",
                    "dismissed",
                    "digest"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbox-controls/firings": {
      "get": {
        "operationId": "listInboxControlFirings",
        "summary": "Lists the times the inbox controls fired, newest first.",
        "description": "Lists the times the inbox controls fired, newest first. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "addressId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "UNAUTHENTICATED",
                "UNKNOWN_SENDER",
                "SENDER_DAY_MESSAGES",
                "ADDRESS_DAY_MESSAGES",
                "SENDER_DAY_SPEND",
                "ADDRESS_DAY_SPEND",
                "OVER_DAILY_LIMIT"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "HELD",
                "REFUSED"
              ]
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "HELD",
                "DECIDED"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "HELD"
                              },
                              "id": {
                                "type": "string"
                              },
                              "at": {
                                "type": "string",
                                "minLength": 20
                              },
                              "entityId": {
                                "type": "string"
                              },
                              "entityName": {
                                "type": "string"
                              },
                              "entityTimeZone": {
                                "type": "string"
                              },
                              "addressId": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "addressLabel": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reasonSentence": {
                                "type": "string"
                              },
                              "setBy": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "setAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "senderDomain": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string",
                                "enum": [
                                  "UNAUTHENTICATED",
                                  "UNKNOWN_SENDER",
                                  "SENDER_DAY_MESSAGES",
                                  "ADDRESS_DAY_MESSAGES",
                                  "SENDER_DAY_SPEND",
                                  "ADDRESS_DAY_SPEND"
                                ]
                              },
                              "stage": {
                                "type": "string",
                                "enum": [
                                  "INTAKE",
                                  "READER"
                                ]
                              },
                              "policy": {
                                "type": "string",
                                "enum": [
                                  "ACCEPT_ALL",
                                  "QUARANTINE_UNAUTHENTICATED",
                                  "KNOWN_SENDERS_ONLY"
                                ]
                              },
                              "limit": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "measured": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "windowStart": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "inboundEmailId": {
                                "type": "string"
                              },
                              "outcome": {
                                "type": "string",
                                "enum": [
                                  "HELD",
                                  "READ",
                                  "NOT_A_BILL"
                                ]
                              },
                              "decidedBy": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "decidedAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "id",
                              "at",
                              "entityId",
                              "entityName",
                              "entityTimeZone",
                              "addressId",
                              "address",
                              "addressLabel",
                              "reasonSentence",
                              "setBy",
                              "setAt",
                              "sizeBytes",
                              "senderDomain",
                              "reason",
                              "stage",
                              "policy",
                              "limit",
                              "measured",
                              "windowStart",
                              "inboundEmailId",
                              "outcome",
                              "decidedBy",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "REFUSED"
                              },
                              "id": {
                                "type": "string"
                              },
                              "at": {
                                "type": "string",
                                "minLength": 20
                              },
                              "entityId": {
                                "type": "string"
                              },
                              "entityName": {
                                "type": "string"
                              },
                              "entityTimeZone": {
                                "type": "string"
                              },
                              "addressId": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "addressLabel": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reasonSentence": {
                                "type": "string"
                              },
                              "setBy": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "setAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "senderDomain": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {
                                "type": "string",
                                "const": "OVER_DAILY_LIMIT"
                              },
                              "capKind": {
                                "type": "string",
                                "enum": [
                                  "SENDER_MESSAGES",
                                  "ADDRESS_MESSAGES",
                                  "ADDRESS_HELD_BYTES"
                                ]
                              },
                              "limit": {
                                "type": "string"
                              },
                              "measured": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "id",
                              "at",
                              "entityId",
                              "entityName",
                              "entityTimeZone",
                              "addressId",
                              "address",
                              "addressLabel",
                              "reasonSentence",
                              "setBy",
                              "setAt",
                              "sizeBytes",
                              "senderDomain",
                              "reason",
                              "capKind",
                              "limit",
                              "measured"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbox-controls/preview": {
      "get": {
        "operationId": "previewInboxControls",
        "summary": "Previews the inbox controls before they are applied.",
        "description": "Previews the inbox controls before they are applied. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "senderPolicy",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ACCEPT_ALL",
                "QUARANTINE_UNAUTHENTICATED",
                "KNOWN_SENDERS_ONLY"
              ]
            }
          },
          {
            "name": "addressDailyMessages",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000
            }
          },
          {
            "name": "senderDailyMessages",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "default": 30,
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "days": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "arrivals": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "wouldHold": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "byReason": {
                      "type": "object",
                      "properties": {
                        "UNAUTHENTICATED": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "UNKNOWN_SENDER": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "SENDER_DAY_MESSAGES": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "ADDRESS_DAY_MESSAGES": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "UNAUTHENTICATED",
                        "UNKNOWN_SENDER",
                        "SENDER_DAY_MESSAGES",
                        "ADDRESS_DAY_MESSAGES"
                      ],
                      "additionalProperties": false
                    },
                    "topSenders": {
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "domain": {
                            "type": "string"
                          },
                          "arrivals": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "wouldHold": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "known": {
                            "type": "boolean"
                          },
                          "authenticatedAll": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "domain",
                          "arrivals",
                          "wouldHold",
                          "known",
                          "authenticatedAll"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "spendNotReplayed": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "days",
                    "arrivals",
                    "wouldHold",
                    "truncated",
                    "byReason",
                    "topSenders",
                    "spendNotReplayed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/inbox-controls/read-held": {
      "post": {
        "operationId": "readHeldInboundEmails",
        "summary": "Reads the inbound emails the inbox controls are holding.",
        "description": "Reads the inbound emails the inbox controls are holding. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inboundEmailIds": {
                    "minItems": 1,
                    "maxItems": 25,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "inboundEmailIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inboundEmailId": {
                            "type": "string"
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "READ",
                              "REFUSED"
                            ]
                          },
                          "sentence": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "inboundEmailId",
                          "outcome",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "results"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/list-views/draft": {
      "post": {
        "operationId": "draftPurchasesListView",
        "summary": "Drafts a purchases list view from the description a person gives.",
        "description": "Drafts a purchases list view from the description a person gives. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:read",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "list": {
                    "$ref": "#/components/schemas/List"
                  },
                  "sentence": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 300
                  }
                },
                "required": [
                  "list",
                  "sentence"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "readBy": {
                              "type": "string",
                              "enum": [
                                "PRODUCT",
                                "MODEL"
                              ]
                            },
                            "promptVersion": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "params": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "chips": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "valueWords": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "label",
                                  "valueWords"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "vendorPhraseUnresolved": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "adjusted": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "sentence": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "field",
                                  "sentence"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "quote": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "readBy",
                            "promptVersion",
                            "params",
                            "chips",
                            "vendorPhraseUnresolved",
                            "adjusted",
                            "quote"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "MODEL_FAILED",
                            "NOT_A_LIST_VIEW",
                            "NOT_FROM_LIST",
                            "FIGURE_NOT_IN_SENTENCE",
                            "READING_BUSY",
                            "LIST_TOO_LONG"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "drafted",
                    "why"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/openapi.json": {
      "get": {
        "operationId": "exportOpenApiDocument",
        "summary": "Returns the API's OpenAPI document with this ledger's custom objects and custom fields added.",
        "description": "Returns the API's OpenAPI document with this ledger's custom objects and custom fields added. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {},
                  "description": "An OpenAPI 3.1 document: the published contract at `/v1/openapi.json` without a credential, plus this ledger's custom operations.",
                  "x-open-by-reference": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/promotion-previews": {
      "get": {
        "operationId": "previewPromotion",
        "summary": "Previews what promoting configuration from a test copy would change on these books, and what conflicts.",
        "description": "Previews what promoting configuration from a test copy would change on these books, and what conflicts. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "testCopyId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "changes": {
                      "$ref": "#/components/schemas/Changes"
                    },
                    "conflicts": {
                      "$ref": "#/components/schemas/Conflicts"
                    },
                    "realVersion": {
                      "type": "string"
                    },
                    "copyVersion": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "changes",
                    "conflicts",
                    "realVersion",
                    "copyVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/promotions": {
      "post": {
        "operationId": "proposePromotion",
        "summary": "Proposes promoting selected configuration from a test copy to these books, for a second administrator to approve.",
        "description": "Proposes promoting selected configuration from a test copy to these books, for a second administrator to approve. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "testCopyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "keys": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "resolutions": {
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "minLength": 1
                        },
                        "field": {
                          "type": "string",
                          "minLength": 1
                        },
                        "take": {
                          "type": "string",
                          "enum": [
                            "copy",
                            "real"
                          ]
                        }
                      },
                      "required": [
                        "key",
                        "field",
                        "take"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "soleAdministrator": {
                    "type": "object",
                    "properties": {
                      "reason": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "reason"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "testCopyId",
                  "keys"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPromotionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "get": {
        "operationId": "listPromotions",
        "summary": "Lists the promotions from test copies to these books, newest first.",
        "description": "Lists the promotions from test copies to these books, newest first. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PROPOSED",
                "APPLIED",
                "CONFLICTED"
              ]
            }
          },
          {
            "name": "testCopyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GetPromotionResponse"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/promotions/{promotionId}": {
      "get": {
        "operationId": "getPromotion",
        "summary": "Reads one promotion with its changes, conflicts and state.",
        "description": "Reads one promotion with its changes, conflicts and state. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "promotionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPromotionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/promotions/{promotionId}/apply": {
      "post": {
        "operationId": "applyPromotion",
        "summary": "Applies an approved promotion to these books all at once, or refuses it whole if the books changed; reached only as the approval replay.",
        "description": "Applies an approved promotion to these books all at once, or refuses it whole if the books changed; reached only as the approval replay. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "promotionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "soleAdministrator": {
                    "type": "object",
                    "properties": {
                      "reason": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "reason"
                    ],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UndoAgentBatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/record-labels": {
      "get": {
        "operationId": "resolveRecordLabels",
        "summary": "Looks up the names behind up to 100 ids that custom fields point at, such as a customer, a vendor or a custom record.",
        "description": "Looks up the names behind up to 100 ids that custom fields point at, such as a customer, a vendor or a custom record. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "refs",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 20000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "labels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ref": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "archived": {
                            "type": "boolean"
                          },
                          "href": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "ref",
                          "label",
                          "archived",
                          "href"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "labels"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/records-destruction-permissions": {
      "get": {
        "operationId": "listRecordsDestructionPermissions",
        "summary": "Lists the permissions to destroy records.",
        "description": "Lists the permissions to destroy records. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "live",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListRecordsDestructionPermissionsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/records-destruction-permissions/{permissionId}/void": {
      "post": {
        "operationId": "voidRecordsDestructionPermission",
        "summary": "Voids a permission to destroy records.",
        "description": "Voids a permission to destroy records. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "permissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRecordsDestructionPermissionsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/reference": {
      "get": {
        "operationId": "reference",
        "summary": "Returns the reference lists the ledger's pickers draw on.",
        "description": "Returns the reference lists the ledger's pickers draw on. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "gifi": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "section": {
                            "type": "string",
                            "enum": [
                              "ASSET",
                              "LIABILITY",
                              "EQUITY",
                              "REVENUE",
                              "EXPENSE"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "label",
                          "section"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "gifi"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/rules": {
      "get": {
        "operationId": "listRules",
        "summary": "Lists the rules that route, approve or post documents.",
        "description": "Lists the rules that route, approve or post documents. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PROPOSED",
                "ACTIVE",
                "DISCARDED",
                "RETIRED"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ROUTING",
                "CODING",
                "AUTO_APPROVAL",
                "HOLD",
                "MATCH_TOLERANCE",
                "LINE_PROFILE",
                "RUN_PREPARE"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ENTRY",
                "BILL",
                "VENDOR",
                "RUN",
                "INVOICE"
              ]
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListRulesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createRule",
        "summary": "Creates a rule that routes, approves or posts documents.",
        "description": "Creates a rule that routes, approves or posts documents. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sourceText": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 400
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "ROUTING",
                      "CODING",
                      "AUTO_APPROVAL",
                      "HOLD",
                      "MATCH_TOLERANCE",
                      "LINE_PROFILE",
                      "RUN_PREPARE"
                    ]
                  },
                  "entityId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "rule": {
                    "$ref": "#/components/schemas/RuleOption1"
                  },
                  "subject": {
                    "default": "ENTRY",
                    "type": "string",
                    "enum": [
                      "ENTRY",
                      "BILL",
                      "VENDOR",
                      "RUN",
                      "INVOICE"
                    ]
                  },
                  "expiresOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "draft": {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "enum": [
                          "PARSER",
                          "MODEL",
                          "PERSON"
                        ]
                      },
                      "promptVersion": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 40
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fieldsChanged": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 40
                        }
                      }
                    },
                    "required": [
                      "source",
                      "promptVersion",
                      "fieldsChanged"
                    ],
                    "additionalProperties": false
                  },
                  "replacesRuleId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "sourceText",
                  "kind",
                  "rule"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRulesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/rules/firings": {
      "get": {
        "operationId": "listRuleFirings",
        "summary": "Lists the times the rules fired, newest first.",
        "description": "Lists the times the rules fired, newest first. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "ruleId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ROUTED",
                "SHAPED",
                "AUTO_APPROVED",
                "NOT_APPLIED",
                "WITHIN_AUTHORITY",
                "REFUSED",
                "HELD",
                "TOLERATED",
                "PREPARED"
              ]
            }
          },
          {
            "name": "entryId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "billId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "paymentRunId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "authorityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ruleId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ruleSourceText": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ruleVersion": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "ROUTED",
                              "SHAPED",
                              "AUTO_APPROVED",
                              "NOT_APPLIED",
                              "WITHIN_AUTHORITY",
                              "REFUSED",
                              "HELD",
                              "TOLERATED",
                              "PREPARED"
                            ]
                          },
                          "entryId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entryRef": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entryDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "amountMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tier": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "BOOKKEEPER",
                                  "SENIOR",
                                  "CONTROLLER"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "firedAt": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "ENTRY",
                                  "BILL",
                                  "VENDOR",
                                  "RUN",
                                  "INVOICE",
                                  "ORDER",
                                  "NONE"
                                ]
                              },
                              "id": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "ref": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "id",
                              "ref"
                            ],
                            "additionalProperties": false
                          },
                          "authorityId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "measuredMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "measuredCurrency": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "firedByName": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "ruleId",
                          "ruleSourceText",
                          "ruleVersion",
                          "outcome",
                          "entryId",
                          "entryRef",
                          "entryDate",
                          "amountMinor",
                          "currency",
                          "tier",
                          "reason",
                          "firedAt",
                          "subject",
                          "authorityId",
                          "measuredMinor",
                          "measuredCurrency",
                          "firedByName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/rules/preview": {
      "post": {
        "operationId": "previewRule",
        "summary": "Previews what a rule would do to recent documents before it is saved.",
        "description": "Previews what a rule would do to recent documents before it is saved. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ruleId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "ruleId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewRuleResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/rules/routing": {
      "get": {
        "operationId": "routingDecisions",
        "summary": "Lists the routing decisions the rules made.",
        "description": "Lists the routing decisions the rules made. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entryIds",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "decisions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entryId": {
                            "type": "string"
                          },
                          "tier": {
                            "type": "string",
                            "enum": [
                              "BOOKKEEPER",
                              "SENIOR",
                              "CONTROLLER"
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "ruleId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ruleSourceText": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pinned": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "entryId",
                          "tier",
                          "reason",
                          "ruleId",
                          "ruleSourceText",
                          "pinned"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "decisions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/rules/{ruleId}": {
      "get": {
        "operationId": "getRule",
        "summary": "Returns one rule with its conditions and status.",
        "description": "Returns one rule with its conditions and status. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRulesResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/rules/{ruleId}/decide": {
      "post": {
        "operationId": "decideRule",
        "summary": "Approves or declines a proposed rule.",
        "description": "Approves or declines a proposed rule. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "CONFIRM",
                      "DISCARD"
                    ]
                  },
                  "sourceText": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 400
                  },
                  "rule": {
                    "$ref": "#/components/schemas/RuleOption1"
                  },
                  "entityId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subject": {
                    "type": "string",
                    "enum": [
                      "ENTRY",
                      "BILL",
                      "VENDOR",
                      "RUN",
                      "INVOICE"
                    ]
                  },
                  "expiresAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "previewId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "decision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRulesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/rules/{ruleId}/status": {
      "post": {
        "operationId": "setRuleStatus",
        "summary": "Switches a rule on or off.",
        "description": "Switches a rule on or off. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "RETIRED"
                    ]
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRulesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/sender-domains": {
      "get": {
        "operationId": "getSenderDomain",
        "summary": "Returns the sending domain the ledger sends email from.",
        "description": "Returns the sending domain the ledger sends email from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSenderDomainResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createSenderDomain",
        "summary": "Adds a sending domain the ledger sends email from.",
        "description": "Adds a sending domain the ledger sends email from. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "address": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  }
                },
                "required": [
                  "entityId",
                  "address"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSenderDomainResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/sender-domains/check": {
      "post": {
        "operationId": "checkSenderDomain",
        "summary": "Checks the DNS records of a sending domain.",
        "description": "Checks the DNS records of a sending domain. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "entityId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSenderDomainResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/sender-domains/remove": {
      "post": {
        "operationId": "removeSenderDomain",
        "summary": "Removes a sending domain.",
        "description": "Removes a sending domain. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "entityId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSenderDomainResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/test-copies/current": {
      "get": {
        "operationId": "getTestCopy",
        "summary": "Reads the test copy of these books, or the copy these books belong to, with its generations and what the caller may do.",
        "description": "Reads the test copy of these books, or the copy these books belong to, with its generations and what the caller may do. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "testCopy": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/TestCopy"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "testCopy"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/test-copies/requests": {
      "post": {
        "operationId": "requestTestCopy",
        "summary": "Asks for a test copy of these books, or a refreshed one, for a second administrator to approve.",
        "description": "Asks for a test copy of these books, or a refreshed one, for a second administrator to approve. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestTestCopyRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "outcome": {
                          "type": "string",
                          "const": "proposed"
                        },
                        "proposalId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "outcome",
                        "proposalId"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "outcome": {
                          "type": "string",
                          "const": "started"
                        },
                        "testCopy": {
                          "$ref": "#/components/schemas/TestCopy"
                        }
                      },
                      "required": [
                        "outcome",
                        "testCopy"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/test-copies/start": {
      "post": {
        "operationId": "startTestCopy",
        "summary": "Starts the build of a test copy once the request is approved; reached only as the approval replay.",
        "description": "Starts the build of a test copy once the request is approved; reached only as the approval replay. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestTestCopyRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TestCopy"
                    },
                    {
                      "$ref": "#/components/schemas/UndoAgentBatchResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/test-copies/{testCopyId}/delete": {
      "post": {
        "operationId": "deleteTestCopy",
        "summary": "Deletes a test copy: it is archived at once and purged after the retention days.",
        "description": "Deletes a test copy: it is archived at once and purged after the retention days. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "testCopyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestCopy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/test-copies/{testCopyId}/discard": {
      "post": {
        "operationId": "discardTestCopyRefresh",
        "summary": "Discards a refreshed generation that was not switched to, keeping the current one.",
        "description": "Discards a refreshed generation that was not switched to, keeping the current one. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "testCopyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestCopy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/test-copies/{testCopyId}/switch": {
      "post": {
        "operationId": "switchTestCopyGeneration",
        "summary": "Switches a test copy to its refreshed generation and archives the previous one.",
        "description": "Switches a test copy to its refreshed generation and archives the previous one. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "testCopyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestCopy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "getLedgerUsage",
        "summary": "Reads how many API, MCP and web calls these books took this month, against the workspace's plan, and where they are kept.",
        "description": "Reads how many API, MCP and web calls these books took this month, against the workspace's plan, and where they are kept. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "month": {
                      "type": "string",
                      "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                    },
                    "asOf": {
                      "type": "string",
                      "minLength": 20
                    },
                    "ledger": {
                      "type": "object",
                      "properties": {
                        "rest": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "mcp": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "web": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "refused": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "limited": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "rest",
                        "mcp",
                        "web",
                        "refused",
                        "limited"
                      ],
                      "additionalProperties": false
                    },
                    "days": {
                      "maxItems": 31,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rest": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "mcp": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "web": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "refused": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "limited": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "day": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          }
                        },
                        "required": [
                          "rest",
                          "mcp",
                          "web",
                          "refused",
                          "limited",
                          "day"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "plan": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "monthlyCalls": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "keyReadsPerMinute": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "keyWritesPerMinute": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "grantReadsPerMinute": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "grantWritesPerMinute": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "code",
                                "name",
                                "monthlyCalls",
                                "keyReadsPerMinute",
                                "keyWritesPerMinute",
                                "grantReadsPerMinute",
                                "grantWritesPerMinute"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "counted": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "over": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ledgers": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "name",
                        "plan",
                        "counted",
                        "over",
                        "ledgers"
                      ],
                      "additionalProperties": false
                    },
                    "placement": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "SHARED",
                            "DEDICATED"
                          ]
                        },
                        "region": {
                          "type": "string",
                          "const": "Toronto"
                        }
                      },
                      "required": [
                        "kind",
                        "region"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "month",
                    "asOf",
                    "ledger",
                    "days",
                    "workspace",
                    "placement"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/usage/subjects": {
      "get": {
        "operationId": "listUsageSubjects",
        "summary": "Lists the keys and connected apps that called these books this month, with their counts, most recently active first.",
        "description": "Lists the keys and connected apps that called these books this month, with their counts, most recently active first. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subject": {
                            "type": "string",
                            "enum": [
                              "KEY",
                              "GRANT"
                            ]
                          },
                          "subjectId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "door": {
                            "type": "string",
                            "enum": [
                              "rest",
                              "mcp"
                            ]
                          },
                          "firstParty": {
                            "type": "boolean"
                          },
                          "reads": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "writes": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "refused": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "limited": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "busiestMinute": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "minute": {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  "calls": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "minute",
                                  "calls"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "subject",
                          "subjectId",
                          "name",
                          "door",
                          "firstParty",
                          "reads",
                          "writes",
                          "refused",
                          "limited",
                          "busiestMinute"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/validation-rules": {
      "get": {
        "operationId": "listValidationRules",
        "summary": "Lists the validation rules the ledger defines, with the sentence each one reads as.",
        "description": "Lists the validation rules the ledger defines, with the sentence each one reads as. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "recordKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "CUSTOMER",
                "INVOICE",
                "CREDIT_MEMO",
                "PRODUCT",
                "CONTRACT",
                "VENDOR",
                "BILL",
                "PURCHASE_ORDER",
                "JOURNAL_ENTRY",
                "CUSTOM_OBJECT",
                "LINE"
              ]
            }
          },
          {
            "name": "objectKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          },
          {
            "name": "lineKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PURCHASE_ORDER_LINE",
                "GOODS_RECEIPT_LINE",
                "BILL_LINE",
                "VENDOR_CREDIT_LINE",
                "INVOICE_LINE",
                "CREDIT_MEMO_LINE",
                "JOURNAL_LINE"
              ]
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListValidationRulesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createValidationRule",
        "summary": "Defines a validation rule that refuses a record when its condition holds.",
        "description": "Defines a validation rule that refuses a record when its condition holds. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recordKind": {
                    "type": "string",
                    "enum": [
                      "CUSTOMER",
                      "INVOICE",
                      "CREDIT_MEMO",
                      "PRODUCT",
                      "CONTRACT",
                      "VENDOR",
                      "BILL",
                      "PURCHASE_ORDER",
                      "JOURNAL_ENTRY",
                      "CUSTOM_OBJECT",
                      "LINE"
                    ]
                  },
                  "objectKey": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]{0,39}$"
                  },
                  "lineKind": {
                    "type": "string",
                    "enum": [
                      "PURCHASE_ORDER_LINE",
                      "GOODS_RECEIPT_LINE",
                      "BILL_LINE",
                      "VENDOR_CREDIT_LINE",
                      "INVOICE_LINE",
                      "CREDIT_MEMO_LINE",
                      "JOURNAL_LINE"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "condition": {
                    "$ref": "#/components/schemas/Condition"
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "fieldKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60,
                    "pattern": "^(cf\\.[a-z][a-z0-9_]{0,39}|[a-z][A-Za-z0-9]{0,39})$"
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "required": [
                  "recordKind",
                  "name",
                  "condition",
                  "message"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListValidationRulesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/validation-rules/{ruleId}": {
      "patch": {
        "operationId": "updateValidationRule",
        "summary": "Changes a validation rule's condition, message or position.",
        "description": "Changes a validation rule's condition, message or position. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "condition": {
                    "$ref": "#/components/schemas/Condition"
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "fieldKey": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60,
                        "pattern": "^(cf\\.[a-z][a-z0-9_]{0,39}|[a-z][A-Za-z0-9]{0,39})$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListValidationRulesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/validation-rules/{ruleId}/archive": {
      "post": {
        "operationId": "archiveValidationRule",
        "summary": "Archives a validation rule so it no longer applies.",
        "description": "Archives a validation rule so it no longer applies. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListValidationRulesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/validation-rules/{ruleId}/restore": {
      "post": {
        "operationId": "restoreValidationRule",
        "summary": "Restores an archived validation rule.",
        "description": "Restores an archived validation rule. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListValidationRulesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/destinations": {
      "get": {
        "operationId": "listWarehouseDestinations",
        "summary": "Lists the data warehouses these books are sent to, with how current each copy is.",
        "description": "Lists the data warehouses these books are sent to, with how current each copy is. Needs the `warehouse:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "warehouse:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListWarehouseDestinationsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/destinations/{destinationId}": {
      "get": {
        "operationId": "getWarehouseDestination",
        "summary": "Returns one data warehouse destination with its state, its failure if any and how current it is.",
        "description": "Returns one data warehouse destination with its state, its failure if any and how current it is. Needs the `warehouse:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "warehouse:read",
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWarehouseDestinationsResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/destinations/{destinationId}/backfill": {
      "post": {
        "operationId": "backfillWarehouse",
        "summary": "Sends every table, or the tables named, to a data warehouse again.",
        "description": "Sends every table, or the tables named, to a data warehouse again. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tables": {
                    "maxItems": 300,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ListWarehouseDestinationsResponseItem"
                    },
                    {
                      "$ref": "#/components/schemas/UndoAgentBatchResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/destinations/{destinationId}/pause": {
      "post": {
        "operationId": "pauseWarehouseDestination",
        "summary": "Pauses sending the books to a data warehouse; nothing is lost and it resumes from where it stopped.",
        "description": "Pauses sending the books to a data warehouse; nothing is lost and it resumes from where it stopped. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 300
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWarehouseDestinationsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/destinations/{destinationId}/setup": {
      "get": {
        "operationId": "getWarehouseSetup",
        "summary": "Returns the steps the owner of a data warehouse follows to let these books write to it.",
        "description": "Returns the steps the owner of a data warehouse follows to let these books write to it. Needs the `warehouse:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "warehouse:read",
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "destination": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{1,31}$"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "code": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "title",
                          "text",
                          "code"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "destination",
                    "kind",
                    "steps"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/destinations/{destinationId}/tables": {
      "get": {
        "operationId": "listWarehouseTables",
        "summary": "Lists the tables sent to a data warehouse, with rows, position reached and the last nightly check.",
        "description": "Lists the tables sent to a data warehouse, with rows, position reached and the last nightly check. Needs the `warehouse:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "warehouse:read",
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "target",
                "child",
                "append",
                "nightly"
              ]
            }
          },
          {
            "name": "drifted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "table": {
                            "type": "string"
                          },
                          "mode": {
                            "type": "string",
                            "enum": [
                              "target",
                              "child",
                              "append",
                              "nightly"
                            ]
                          },
                          "rows": {
                            "type": "string",
                            "pattern": "^\\d+$"
                          },
                          "lastPosition": {
                            "type": "string",
                            "pattern": "^(0|[1-9]\\d{0,18})$"
                          },
                          "schemaVersion": {
                            "type": "string"
                          },
                          "retiredColumns": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "backfill": {
                            "type": "string",
                            "enum": [
                              "none",
                              "queued",
                              "running",
                              "done",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "verify": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "at": {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  "drift": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "at",
                                  "drift"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "not-permitted",
                                      "never"
                                    ]
                                  }
                                },
                                "required": [
                                  "state"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "table",
                          "mode",
                          "rows",
                          "lastPosition",
                          "schemaVersion",
                          "retiredColumns",
                          "backfill",
                          "verify"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/destinations/{destinationId}/test": {
      "post": {
        "operationId": "testWarehouseDestination",
        "summary": "Tests whether these books can write to a data warehouse and reports where it is stored.",
        "description": "Tests whether these books can write to a data warehouse and reports where it is stored. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "destinationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "location": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inCanada": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "checks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "enum": [
                              "identity",
                              "target",
                              "verified",
                              "ddl",
                              "write",
                              "read"
                            ]
                          },
                          "ok": {
                            "type": "boolean"
                          },
                          "code": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "access_denied",
                                  "target_unverified",
                                  "target_not_found",
                                  "schema_conflict",
                                  "quota",
                                  "transient",
                                  "internal"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "remedy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "ok",
                          "code",
                          "remedy"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "location",
                    "inCanada",
                    "checks"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/warehouse/kinds": {
      "get": {
        "operationId": "listWarehouseKinds",
        "summary": "Lists the kinds of data warehouse these books can be sent to, with the fields each asks for.",
        "description": "Lists the kinds of data warehouse these books can be sent to, with the fields each asks for. Needs the `warehouse:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "warehouse:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "pattern": "^[a-z][a-z0-9-]{1,31}$"
                          },
                          "label": {
                            "type": "string"
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "help": {
                                  "type": "string"
                                },
                                "pattern": {
                                  "type": "string"
                                },
                                "maxLength": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "required": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "name",
                                "label",
                                "help",
                                "pattern",
                                "maxLength",
                                "required"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "choices": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "value": {
                                        "type": "string"
                                      },
                                      "label": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "value",
                                      "label"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "default": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "label",
                                "choices",
                                "default"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "credential": {
                            "type": "string",
                            "enum": [
                              "none",
                              "sealed"
                            ]
                          },
                          "canRotate": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "kind",
                          "label",
                          "fields",
                          "options",
                          "credential",
                          "canRotate"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "destination": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "destination",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflow-actions": {
      "get": {
        "operationId": "listWorkflowActions",
        "summary": "Lists the operations an automation workflow can run as its actions, with the input each one takes.",
        "description": "Lists the operations an automation workflow can run as its actions, with the input each one takes. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "recordKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "VENDOR",
                "BILL",
                "PURCHASE_ORDER",
                "INVOICE",
                "CUSTOMER",
                "RECEIPT",
                "JOURNAL_ENTRY",
                "PAYMENT_RUN"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "operation": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "effectClass": {
                            "type": "string",
                            "enum": [
                              "read",
                              "write",
                              "delete",
                              "money-out",
                              "banking",
                              "cra-filing"
                            ]
                          },
                          "proposes": {
                            "type": "boolean"
                          },
                          "params": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "input": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {},
                                "description": "A JSON Schema (draft 2020-12) document: the input of the operation this action runs, as that operation's own entry in this contract gives it.",
                                "x-open-by-reference": true
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "recordKinds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "operation",
                          "summary",
                          "effectClass",
                          "proposes",
                          "params",
                          "input",
                          "recordKinds"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflow-notices": {
      "post": {
        "operationId": "sendWorkflowNotice",
        "summary": "Sends a notice by mail to people who hold a seat on these books.",
        "description": "Sends a notice by mail to people who hold a seat on these books. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "minItems": 1,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "subject": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "recordRef": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "minLength": 1
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "type",
                          "id"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "to",
                  "subject",
                  "body",
                  "recordRef"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "sentAt": {
                      "type": "string",
                      "minLength": 20
                    }
                  },
                  "required": [
                    "recipients",
                    "sentAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflow-runs": {
      "get": {
        "operationId": "listWorkflowRuns",
        "summary": "Lists the times workflows fired, newest first, with what each did.",
        "description": "Lists the times workflows fired, newest first, with what each did. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "workflowId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "APPROVAL",
                "AUTOMATION"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ROUTED",
                "QUEUED",
                "RUNNING",
                "SUCCEEDED",
                "PROPOSED",
                "FAILED",
                "SKIPPED",
                "CAPPED",
                "LOOP_STOPPED",
                "CANCELLED",
                "REFUSED"
              ]
            }
          },
          {
            "name": "targetType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "targetId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 20
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListWorkflowRunsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflow-runs/{runId}": {
      "get": {
        "operationId": "getWorkflowRun",
        "summary": "Returns one workflow run with each of its steps.",
        "description": "Returns one workflow run with each of its steps. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowRunsResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflow-triggers": {
      "get": {
        "operationId": "listWorkflowTriggers",
        "summary": "Lists the changes an automation workflow can start on.",
        "description": "Lists the changes an automation workflow can start on. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "recordKind": {
                            "type": "string",
                            "enum": [
                              "VENDOR",
                              "BILL",
                              "PURCHASE_ORDER",
                              "INVOICE",
                              "CUSTOMER",
                              "RECEIPT",
                              "JOURNAL_ENTRY",
                              "PAYMENT_RUN"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "read": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "recordKind",
                          "label",
                          "read"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Lists the approval and automation workflows on these books, with each one's status and owner.",
        "description": "Lists the approval and automation workflows on these books, with each one's status and owner. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "APPROVAL",
                "AUTOMATION"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DRAFT",
                "ACTIVE",
                "PAUSED",
                "EXPIRED",
                "RETIRED"
              ]
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILL",
                "INVOICE",
                "PURCHASE_ORDER"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListWorkflowsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createWorkflowDraft",
        "summary": "Drafts a new approval or automation workflow; nothing runs until an administrator turns it on.",
        "description": "Drafts a new approval or automation workflow; nothing runs until an administrator turns it on. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50
                  },
                  "description": {
                    "default": "",
                    "type": "string",
                    "maxLength": 300
                  },
                  "definition": {
                    "$ref": "#/components/schemas/Definition2"
                  },
                  "expiresOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "name",
                  "definition",
                  "expiresOn"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflows/{workflowId}": {
      "get": {
        "operationId": "getWorkflow",
        "summary": "Returns one workflow with its active version, its draft and what the reader may do with it.",
        "description": "Returns one workflow with its active version, its draft and what the reader may do with it. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowsResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/draft": {
      "patch": {
        "operationId": "updateWorkflowDraft",
        "summary": "Changes the draft of a workflow; the active version keeps running until the draft is turned on.",
        "description": "Changes the draft of a workflow; the active version keeps running until the draft is turned on. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "definition": {
                    "$ref": "#/components/schemas/Definition2"
                  },
                  "expiresOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "basedOnVersion": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "basedOnVersion"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/draft/discard": {
      "post": {
        "operationId": "discardWorkflowDraft",
        "summary": "Discards the draft of a workflow; the active version is unchanged.",
        "description": "Discards the draft of a workflow; the active version is unchanged. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListWorkflowsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/draft/preview": {
      "post": {
        "operationId": "previewWorkflow",
        "summary": "Previews what the draft of a workflow would have done to recent records, and keeps the preview as evidence.",
        "description": "Previews what the draft of a workflow would have done to recent records, and keeps the preview as evidence. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewOption1"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/workflows/{workflowId}/versions": {
      "get": {
        "operationId": "listWorkflowVersions",
        "summary": "Lists the versions of one workflow, newest first, each in sentences.",
        "description": "Lists the versions of one workflow, newest first, each in sentences. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "settings"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ActiveOption1"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    }
  },
  "webhooks": {},
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "evk_ API key",
        "description": "A key an administrator of the books made in the app. It reads, or reads and drafts, on one ledger."
      },
      "oauth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token for a person who connected an app. Its audience is https://api.eternifylabs.com/v1. The app acts with that person's own role, inside what they allowed."
      }
    },
    "schemas": {
      "Active": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ActiveOption1"
          },
          {
            "type": "null"
          }
        ]
      },
      "ActiveOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "state": {
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "SUPERSEDED",
              "DISCARDED"
            ]
          },
          "definition": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DefinitionOption1"
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "AUTOMATION"
                  },
                  "trigger": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "entityId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "condition": {
                    "$ref": "#/components/schemas/Condition2"
                  },
                  "actions": {
                    "minItems": 1,
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "operation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "params": {
                          "$ref": "#/components/schemas/Params"
                        },
                        "input": {
                          "$ref": "#/components/schemas/Params"
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        }
                      },
                      "required": [
                        "operation",
                        "params",
                        "input",
                        "label"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "maxRunsPerDay": {
                    "default": 50,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000
                  },
                  "amountCapMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "trigger",
                  "entityId",
                  "currency",
                  "condition",
                  "actions",
                  "maxRunsPerDay",
                  "amountCapMinor"
                ],
                "additionalProperties": false
              }
            ]
          },
          "words": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "activatedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "activatedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "activatedAlone": {
            "type": "boolean"
          },
          "preview": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PreviewOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "version",
          "state",
          "definition",
          "words",
          "createdBy",
          "createdAt",
          "activatedBy",
          "activatedAt",
          "activatedAlone",
          "preview",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "All": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/AllItem"
        },
        "minItems": 1
      },
      "All2": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/All2Item"
        },
        "minItems": 1
      },
      "All2Item": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ConditionOption1"
          },
          {
            "type": "object",
            "properties": {
              "all": {
                "$ref": "#/components/schemas/All3"
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "$ref": "#/components/schemas/All3"
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/ConditionOption1"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          }
        ]
      },
      "All3": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ConditionOption1"
        },
        "minItems": 1
      },
      "AllItem": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ConditionOption1"
          },
          {
            "type": "object",
            "properties": {
              "all": {
                "$ref": "#/components/schemas/All2"
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "$ref": "#/components/schemas/All2"
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/All2Item"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AllItem2": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Condition2Option1"
          },
          {
            "type": "object",
            "properties": {
              "all": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AllItem3"
                }
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AllItem3"
                }
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/AllItem3"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AllItem3": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Condition2Option1"
          },
          {
            "type": "object",
            "properties": {
              "all": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AllItem4"
                }
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AllItem4"
                }
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/AllItem4"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AllItem4": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Condition2Option1"
          },
          {
            "type": "object",
            "properties": {
              "all": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Condition2Option1"
                }
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Condition2Option1"
                }
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/Condition2Option1"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AppliesTo": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "PURCHASE_ORDER_LINE",
                "GOODS_RECEIPT_LINE",
                "BILL_LINE",
                "VENDOR_CREDIT_LINE",
                "INVOICE_LINE",
                "CREDIT_MEMO_LINE",
                "JOURNAL_LINE"
              ]
            }
          },
          {
            "type": "null"
          }
        ]
      },
      "AppliesTo2": {
        "minItems": 1,
        "maxItems": 7,
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "PURCHASE_ORDER_LINE",
            "GOODS_RECEIPT_LINE",
            "BILL_LINE",
            "VENDOR_CREDIT_LINE",
            "INVOICE_LINE",
            "CREDIT_MEMO_LINE",
            "JOURNAL_LINE"
          ]
        }
      },
      "AuditLogResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/History"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "$ref": "#/components/schemas/Imported"
          },
          "totals": {
            "$ref": "#/components/schemas/Totals"
          },
          "origin": {
            "type": "string",
            "enum": [
              "ALL",
              "NATIVE",
              "IMPORTED"
            ]
          },
          "zone": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor",
          "total",
          "imported",
          "totals",
          "origin",
          "zone"
        ],
        "additionalProperties": false
      },
      "Changes": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "type": "string",
              "enum": [
                "objectType",
                "dimensionType",
                "recordField",
                "lineField",
                "rule"
              ]
            },
            "verb": {
              "type": "string",
              "enum": [
                "add",
                "change",
                "archive",
                "restore"
              ]
            },
            "label": {
              "type": "string"
            },
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "TEXT",
                    "NUMBER",
                    "DATE",
                    "CHOICE",
                    "CHECKBOX",
                    "MONEY",
                    "MULTI_CHOICE",
                    "REFERENCE"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "fields": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "byDependency": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "key",
            "kind",
            "verb",
            "label",
            "type",
            "fields",
            "byDependency"
          ],
          "additionalProperties": false
        }
      },
      "Choices": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChoicesOption1Item"
            }
          },
          {
            "type": "null"
          }
        ]
      },
      "Choices2": {
        "minItems": 1,
        "maxItems": 100,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ChoicesOption1Item"
        }
      },
      "ChoicesOption1Item": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        },
        "required": [
          "value",
          "label"
        ],
        "additionalProperties": false
      },
      "Code": {
        "type": "string",
        "x-extensible-enum": [
          "validation_failed",
          "unauthenticated",
          "permission_denied",
          "not_found",
          "precondition_failed",
          "idempotency_conflict",
          "idempotency_in_flight",
          "conflict",
          "counterparty_link_taken",
          "payload_too_large",
          "write_conflict",
          "audit_chain_order",
          "unsupported_version",
          "service_unavailable",
          "not_implemented",
          "rate_limited",
          "payment_required",
          "bad_gateway",
          "internal_error",
          "account_not_active",
          "approval_required",
          "currency_tuple",
          "dimension_policy",
          "entry_changed",
          "gifi_code",
          "gifi_mismatch",
          "gifi_reserved_total",
          "illegal_transition",
          "invalid_draft",
          "invalid_money",
          "materiality_exceeded",
          "payment_file_invalid",
          "period_locked",
          "separation_of_duties",
          "tax_account_not_recurring",
          "tax_check_finding_not_open",
          "unbalanced_entry",
          "invalid_tax_input",
          "unsupported_tax_rule",
          "ai_budget_exceeded",
          "disclosure_not_accepted",
          "invalid_prompt",
          "model_output_unparsable",
          "model_refused",
          "connector_sync_unavailable",
          "no_model_provider",
          "not_in_review_queue",
          "company_domain_personal",
          "company_domain_missing",
          "company_not_found",
          "company_person_not_listed",
          "provider_key_missing",
          "provider_key_refused",
          "provider_unavailable",
          "provider_credits_exhausted",
          "api_key_label_taken",
          "api_key_cap_reached",
          "api_key_already_revoked",
          "api_key_revoked",
          "api_key_expired",
          "public_api_field_not_allowed",
          "public_api_unknown_field",
          "public_api_unknown_parameter",
          "public_api_body_too_large",
          "api_key_warehouse_needs_admin",
          "connection_schedule_shape",
          "connection_schedule_too_frequent",
          "connection_time_zone_unknown",
          "connection_target_required",
          "connection_target_not_allowed",
          "connection_target_not_on_ledger",
          "connection_unsupported_provider",
          "connection_not_ready",
          "connection_ends_on_passed",
          "connection_schedule_not_set",
          "connection_not_stopped",
          "connection_not_a_bank_feed",
          "connection_suggestion_decided",
          "connection_seat_cannot_administer",
          "connection_company_required",
          "connection_suggestion_required",
          "connection_ledger_not_found",
          "connection_history_seat",
          "connection_history_page_size",
          "connection_history_trigger",
          "connection_history_cursor",
          "places_identity_missing",
          "places_not_permitted",
          "places_unavailable",
          "place_not_found",
          "itc_window_not_gst",
          "itc_window_year_unknown",
          "itc_window_year_future",
          "itc_window_already",
          "return_itc_support_not_gst34",
          "return_itc_support_export_too_many",
          "invoice_selection_stale",
          "invoice_documents_overrun",
          "contract_po_needs_approver",
          "grant_read_only",
          "grant_no_deletes",
          "banking_agent_refused",
          "banking_needs_web_app",
          "proposal_not_pending",
          "proposal_expired",
          "proposal_on_its_desk",
          "proposal_awaits_confirmation",
          "proposal_contract_changed",
          "proposal_declined_recently",
          "proposal_input_invalid",
          "proposal_input_sensitive",
          "operation_not_served_here",
          "undo_group_not_yours",
          "undo_group_closed",
          "test_copy_outbound_off",
          "test_copy_replaced",
          "test_copy_exists",
          "test_copy_of_copy",
          "test_copy_not_found",
          "test_copy_too_large",
          "test_copy_not_switchable",
          "test_copy_busy",
          "test_copy_base_missing",
          "promotion_too_large",
          "promotion_conflicted",
          "promotion_unresolved",
          "outbound_guard_belt",
          "operation_replay_only",
          "invitation_request_reused",
          "undo_group_required",
          "approval_needs_person",
          "operation_audit_facts",
          "model_read_facts_moved",
          "operation_call_timed_out",
          "operation_facts_moved",
          "operation_settling",
          "position_ahead_of_ledger",
          "job_not_started",
          "job_message_unreadable",
          "answer_unreadable",
          "resource_required",
          "consent_request_invalid",
          "two_factor_required",
          "two_factor_not_enrolled",
          "two_factor_code_wrong",
          "two_factor_locked",
          "grant_ledgers_empty",
          "grant_ledger_unavailable",
          "connected_app_not_found",
          "connected_app_already_revoked",
          "connected_apps_off",
          "connected_app_not_verified",
          "consent_incomplete",
          "intercompany_elimination_blocked_future",
          "intercompany_elimination_blocked_not_matched",
          "intercompany_elimination_blocked_currency",
          "intercompany_elimination_blocked_fiscal_year",
          "intercompany_elimination_blocked_not_posted",
          "intercompany_elimination_blocked_not_plain",
          "intercompany_elimination_blocked_open_differs",
          "intercompany_elimination_blocked_nothing_to_eliminate",
          "intercompany_void_needs_reason",
          "slip_copy_document_mismatch",
          "search_source_erased",
          "search_source_not_found",
          "search_source_not_failed",
          "search_query_empty",
          "search_unavailable",
          "redaction_unavailable",
          "parser_unavailable",
          "parser_refused",
          "ocr_unavailable",
          "embedding_unavailable",
          "assistant_rate_limited",
          "assistant_turn_running",
          "assistant_turn_ended",
          "assistant_confirmation_pending",
          "assistant_not_connected",
          "assistant_already_connected",
          "assistant_ticket_invalid",
          "assistant_ticket_expired",
          "assistant_turn_not_found",
          "assistant_model_unavailable",
          "erasure_request",
          "model_named",
          "figure_unread",
          "contact_detail",
          "web_address",
          "citation_unread",
          "ledger_required",
          "grant_ledger_excluded",
          "confirmation_not_yours",
          "program_limit_exceeded",
          "program_halted",
          "request_state_invalid",
          "undo_group_undone",
          "warehouse_not_configured",
          "warehouse_kind_unknown",
          "warehouse_target_invalid",
          "warehouse_destination_cap",
          "warehouse_target_taken",
          "warehouse_not_tested",
          "warehouse_residency_unacknowledged",
          "warehouse_destination_removed",
          "warehouse_wrong_state",
          "warehouse_credential_not_rotatable",
          "warehouse_backfill_running",
          "warehouse_writer_unavailable",
          "warehouse_setup_not_described",
          "job_not_found",
          "job_finished",
          "job_not_resumable",
          "job_already_open",
          "job_cancel_not_allowed",
          "job_cancel_reason_required",
          "job_step_failed",
          "job_stalled",
          "job_seat_revoked",
          "job_grant_revoked",
          "provider_token_refreshing",
          "bulk_operation_class_refused",
          "bulk_operation_not_idempotent",
          "bulk_operation_not_served",
          "bulk_operation_too_large",
          "bulk_operation_item_too_large",
          "bulk_operation_unknown",
          "bulk_operation_not_undoable",
          "job_not_pausable",
          "job_paused",
          "job_not_reinstatable",
          "undo_group_not_undone",
          "undo_outside_batch",
          "restore_only_through_undo",
          "undo_authority_revoked",
          "undo_authority_unknown",
          "record_import_not_found",
          "record_import_not_applying",
          "record_import_seat_narrowed",
          "close_not_ready",
          "chart_import_clash",
          "csv_import_too_many_rows",
          "custom_field_limit_reached",
          "custom_field_index_limit_reached",
          "custom_object_limit_reached",
          "custom_object_archived",
          "custom_key_taken",
          "custom_field_not_indexed",
          "custom_field_index_building",
          "custom_reference_not_found",
          "custom_record_changed",
          "dimension_type_limit_reached",
          "dimension_type_system",
          "validation_rule_limit_reached",
          "validation_rule_invalid",
          "validation_rule_failed",
          "record_labels_too_many",
          "custom_field_type_not_on_lines",
          "custom_field_line_not_indexable",
          "custom_field_print_limit_reached",
          "invalid_custom_field",
          "entry_posted",
          "operation_sunset",
          "idempotency_key_required",
          "api_access_not_enabled",
          "api_access_ledger_closed",
          "api_key_maker_left",
          "workflow_definition_invalid",
          "workflow_action_not_offered",
          "workflow_action_banking",
          "workflow_action_person_only",
          "workflow_proposal_not_last",
          "workflow_limit_reached",
          "workflow_expiry_invalid",
          "workflow_preview_required",
          "workflow_needs_second_admin",
          "workflow_owner_lacks_capability",
          "workflow_version_changed",
          "workflow_activation_needs_person",
          "workflow_not_active",
          "workflow_paused",
          "workflow_expired",
          "workflow_draft_missing",
          "approval_step_same_person",
          "approval_vote_twice",
          "rule_routing_moved",
          "rule_auto_approval_web_only",
          "workflow_run_banking_refused",
          "query_not_a_select",
          "query_multiple_statements",
          "query_syntax",
          "query_view_unknown",
          "query_view_not_permitted",
          "query_function_not_allowed",
          "query_construct_not_allowed",
          "query_duplicate_column",
          "query_too_large",
          "query_too_costly",
          "query_timed_out",
          "query_write_refused",
          "query_busy",
          "query_needs_order_for_paging",
          "query_offset_too_large",
          "query_cursor_mismatch",
          "analysis_scope_tampered",
          "analysis_deparse_mismatch",
          "measure_unknown",
          "dimension_unknown",
          "measure_dimension_unreachable",
          "measure_mixed_currency",
          "measure_point_in_time",
          "saved_query_changed",
          "saved_query_limit_reached",
          "saved_query_archived",
          "dimension_value_merge_type",
          "dimension_value_merge_target_merged",
          "dimension_value_merge_self",
          "dimension_value_has_children",
          "dimension_value_not_merged",
          "dimension_value_already_merged",
          "tenant_moving",
          "tenant_unavailable",
          "inbound_address_taken",
          "inbound_domain_taken",
          "vendor_export_too_many",
          "vendor_name_no_letters",
          "vendor_same_supplier",
          "vendor_default_account_not_on_ledger",
          "terms_not_on_ledger",
          "terms_not_for_purchases",
          "terms_days_no_set",
          "terms_days_ambiguous",
          "vendor_company_not_on_ledger",
          "vendor_owner_not_on_ledger",
          "vendor_counterparty_entity_taken",
          "banking_change_already_open",
          "vendor_second_remittance_contact",
          "vendor_archived_closed",
          "vendor_already_archived",
          "vendor_archive_banking_open",
          "vendor_not_archived",
          "vendor_hold_on_archived",
          "vendor_already_held",
          "vendor_not_held",
          "banking_evidence_not_on_ledger",
          "banking_vendor_archived",
          "banking_account_shared",
          "banking_change_already_decided",
          "banking_change_decided_meanwhile",
          "banking_change_frozen",
          "banking_change_not_in_force",
          "banking_decide_own_proposal",
          "banking_withdraw_not_yours",
          "banking_notice_moved",
          "banking_evidence_too_large",
          "banking_notice_not_owed",
          "banking_notice_already_recorded",
          "vendor_contact_remittance_needs_email",
          "vendor_contact_unreachable",
          "vendor_contact_email_role_taken",
          "vendor_contacts_full",
          "vendor_contact_unchanged",
          "purchases_cursor_unknown",
          "vendor_accept_own",
          "vendor_accept_archived",
          "vendor_already_accepted",
          "vendor_refuse_accepted",
          "vendor_refuse_already_decided",
          "banking_same_hand",
          "purchases_verification_method_not_offered",
          "purchases_payable_account_not_liability",
          "purchases_self_approved_export_too_many",
          "bill_export_too_many",
          "bill_vendor_not_on_ledger",
          "bill_vendor_archived",
          "bill_supplier_unnamed",
          "bill_due_before_bill_date",
          "bill_payable_not_on_chart",
          "bill_payable_not_liability",
          "bill_document_not_on_ledger",
          "bill_document_not_viewable",
          "bill_document_missing",
          "bill_document_stand_in",
          "bill_document_wrong_kind",
          "bill_document_inbox_keeps",
          "bill_lines_no_revisions",
          "bill_revision_unknown",
          "bill_line_price_mismatch",
          "bill_own_work_no_ceiling",
          "bill_own_work_over_ceiling",
          "bill_over_approval_ceiling",
          "bill_submit_blocked",
          "bill_decision_unknown",
          "bill_edit_blocked",
          "bill_import_number_required",
          "bill_import_company_gone",
          "bill_import_finding",
          "bill_import_duplicate",
          "bill_duplicate_stopped",
          "bill_not_found",
          "bill_not_awaiting_decision",
          "bill_decided_from_entry",
          "bill_approval_already_decided",
          "bill_cannot_post",
          "bill_line_uncoded",
          "bill_line_tax_changed",
          "bill_total_changed",
          "bill_draft_save_not_draft",
          "bill_edit_payload_unreadable",
          "bill_edit_not_posted",
          "bill_edit_already_pending",
          "bill_edit_payment_pinned",
          "bill_edit_none_pending",
          "bill_edit_own_proposal",
          "bill_edit_stale",
          "bill_edit_no_entry",
          "bill_legacy_changed",
          "bill_legacy_state",
          "bill_payment_changed",
          "bill_not_payable",
          "bill_changed",
          "bill_submit_not_draft",
          "bill_incomplete",
          "bill_number_used",
          "bill_void_not_posted",
          "bill_already_void",
          "bill_void_payment_blocked",
          "bill_void_edit_pending",
          "bill_void_no_entry",
          "bill_discard_not_draft",
          "payment_account_currency_not_in_file",
          "payment_originator_not_bank",
          "payment_run_export_too_many",
          "payment_date_too_far_ahead",
          "payment_date_too_far_back",
          "payment_run_account_not_company_bank",
          "payment_run_account_no_originator",
          "payment_run_bills_refused",
          "payment_run_bill_taken",
          "payment_run_allocation_moved",
          "payment_run_moved_meanwhile",
          "payment_run_payment_moved",
          "payment_run_release_own",
          "payment_run_not_draft",
          "payment_run_callback_unconfirmed",
          "payment_run_callback_unknown",
          "payment_run_no_rate",
          "payment_run_vendors_not_accepted",
          "payment_run_vendors_held",
          "payment_run_banking_moved",
          "payment_allocation_no_bill",
          "payment_bill_no_longer_owed",
          "payment_bill_entry_moved",
          "payment_bill_payable_lines",
          "payment_bill_payable_differs",
          "payment_run_cannot_cancel",
          "payment_run_cannot_reverse",
          "payment_run_no_entries",
          "payment_run_already_reversed",
          "payment_run_no_file",
          "payment_run_over_ceiling",
          "inbox_read_flag_not_open",
          "inbox_read_not_this_document",
          "inbox_read_already_read",
          "inbox_read_would_not_change",
          "inbox_read_attempts_used",
          "inbox_arrival_invoices_not_ours",
          "inbox_arrival_owned_by_bill",
          "inbox_arrival_at_the_desk",
          "inbox_arrival_already_decided",
          "inbox_arrival_sent_to_reader",
          "inbox_arrival_nothing_to_read",
          "inbox_arrival_type_not_readable",
          "inbox_arrival_already_read",
          "inbox_arrival_still_being_read",
          "inbox_arrivals_export_too_many",
          "inbox_refusals_export_too_many",
          "inbox_documents_export_too_many",
          "inbox_reply_stop_exists",
          "inbox_reply_stop_already_lifted",
          "inbox_replies_address_revoked",
          "inbox_replies_invoices_address",
          "inbox_replies_no_contact",
          "inbox_replies_until_out_of_range",
          "inbox_replies_already_off",
          "inbox_address_export_too_many",
          "inbox_address_mint_collided",
          "inbox_address_already_revoked",
          "inbox_address_vendor_archived",
          "inbox_address_watcher_no_seat",
          "inbox_address_telephone_required",
          "inbox_address_watcher_moved",
          "inbox_address_watcher_unchanged",
          "inbox_address_revoked_final",
          "inbox_address_binding_fixed",
          "inbox_address_invoices_not_bound",
          "inbox_address_suggestion_changed",
          "inbox_address_not_waiting",
          "inbox_address_no_suggestion",
          "vendor_notice_export_too_many",
          "vendor_notice_already_sent",
          "vendor_notice_withheld",
          "vendor_notice_draft_names_nobody",
          "vendor_notice_outbound_not_approved",
          "vendor_notice_recipient_stopped",
          "vendor_notice_recipient_bounced",
          "vendor_notice_relay_refused",
          "vendor_notice_vendor_archived",
          "vendor_notice_vendor_refused",
          "vendor_notice_address_unusable",
          "vendor_notice_recipient_not_on_record",
          "vendor_notice_no_email",
          "vendor_notice_no_contact",
          "vendor_notice_draft_open",
          "vendor_notice_not_drafted",
          "vendor_notice_paragraph_contact_detail",
          "vendor_notice_paragraph_banking",
          "bill_no_authority",
          "bill_outside_authority",
          "bill_authority_expired",
          "payment_run_no_authority",
          "payment_run_outside_authority",
          "payment_run_authority_expired",
          "authority_self_set",
          "authority_not_approver",
          "authority_scope_not_on_ledger",
          "authority_currency_not_company",
          "authority_own_work_above_cap",
          "authority_run_scope",
          "authority_expiry_out_of_range",
          "authority_already_open",
          "authority_closed",
          "authority_nothing_changed",
          "authority_carried_over_none",
          "authority_as_at_future",
          "authority_export_too_many",
          "bill_not_on_your_desk",
          "bill_stage_same_person",
          "bill_desk_not_waiting",
          "bill_desk_reassign_not_yours",
          "bill_desk_reassign_no_seat",
          "bill_desk_reassign_preparer",
          "bill_desk_reassign_no_authority",
          "bill_desk_reassign_same",
          "bill_desk_reassign_reviewer",
          "bill_awaiting_with_view",
          "bill_awaiting_too_many",
          "bill_approval_stage_export_too_many",
          "purchases_substitute_not_yours",
          "purchases_substitute_self",
          "purchases_substitute_no_seat",
          "purchases_substitute_too_long",
          "purchases_substitute_in_past",
          "purchases_substitute_overlap",
          "purchases_substitute_ended",
          "purchases_routing_desk_not_for_entries",
          "purchases_routing_author_no_authority",
          "purchases_policy_preview_needed",
          "purchases_policy_confirm_not_author",
          "purchases_policy_expiry_too_far",
          "purchases_policy_expiry_past",
          "purchases_policy_turn_on_by_confirm",
          "payment_originator_change_open",
          "payment_originator_same_as_in_force",
          "payment_originator_evidence_not_on_ledger",
          "payment_originator_decide_own_proposal",
          "payment_originator_change_already_decided",
          "payment_originator_change_decided_meanwhile",
          "payment_originator_withdraw_not_yours",
          "payment_run_originator_unverified",
          "payment_run_release_not_recorded",
          "bill_own_work_not_recorded",
          "payment_run_file_store_unavailable",
          "payment_run_file_missing",
          "payment_run_file_changed",
          "payment_run_file_stand_in",
          "full_export_own_request",
          "full_export_sole_admin",
          "full_export_override_not_sole",
          "full_export_override_not_owner",
          "full_export_already_decided",
          "full_export_decision_window_passed",
          "full_export_bank_files_not_confirmed",
          "full_export_bank_files_web_only",
          "full_export_not_approved",
          "full_export_not_yours",
          "full_export_already_downloaded",
          "full_export_download_window_passed",
          "full_export_not_requester",
          "full_export_list_too_many",
          "full_export_not_ready",
          "full_export_build_failed",
          "full_export_build_cancelled",
          "signal_already_decided",
          "signal_dismiss_own_work",
          "signal_export_too_many",
          "signal_decided_by_banking_change",
          "banking_signals_changed",
          "banking_reject_signal_not_fired",
          "vendor_sender_domain_already_retired",
          "vendor_sender_domain_not_retired",
          "bill_hold_not_payable",
          "bill_already_held",
          "bill_not_held",
          "bill_hold_until_past",
          "bill_hold_until_too_far",
          "payment_run_bills_held",
          "payment_run_bill_held_meanwhile",
          "bill_settlement_not_owed",
          "bill_settlement_in_draft_run",
          "bill_settlement_amount_moved",
          "bill_settlement_future_date",
          "bill_settlement_account_not_company",
          "bill_settlement_currency",
          "bill_settlement_paid_amount_required",
          "bill_settlement_method_not_recordable",
          "bill_settlement_no_open_period",
          "bill_settlement_payable_lines",
          "bill_settlement_payable_differs",
          "bill_settlement_same_person",
          "bill_settlement_over_ceiling",
          "bill_settlement_held",
          "bill_settlement_not_awaiting",
          "bill_settlement_run_owned",
          "bill_settlement_void_period_closed",
          "bill_paid_by_in_draft",
          "bill_paid_by_closed",
          "bill_paid_by_in_run",
          "bill_paid_by_recorded",
          "bill_still_owed_not_listed",
          "bill_paid_by_at_review",
          "bill_edit_paid_by",
          "purchases_as_of_future",
          "purchases_ageing_too_many_bills",
          "purchases_ageing_export_too_many",
          "purchases_report_unknown",
          "purchases_report_filter_not_taken",
          "purchases_report_status_unknown",
          "purchases_report_needs_company",
          "purchases_report_needs_dimension",
          "purchases_report_needs_slip_kind",
          "purchases_report_no_registration",
          "purchases_report_range_too_long",
          "purchases_report_controls_seat",
          "purchases_report_export_too_many",
          "purchases_report_working_set",
          "purchases_report_view_limit",
          "purchases_report_view_name_taken",
          "payment_run_reversal_not_recorded",
          "purchases_fx_method_recent",
          "bill_fx_not_foreign",
          "bill_fx_not_posted",
          "bill_fx_already_stated",
          "bill_fx_rate_date_future",
          "bill_itc_statement_void",
          "bill_itc_statement_not_claimed",
          "bill_itc_statement_stale",
          "vendor_registration_no_number",
          "vendor_registration_number_changed",
          "vendor_registration_date_future",
          "vendor_registration_evidence_not_found",
          "vendor_registration_evidence_too_large",
          "vendor_registration_evidence_missing",
          "vendor_registration_evidence_stand_in",
          "vendor_registration_state_checked",
          "bill_posting_date_required",
          "bill_posting_date_outside",
          "bill_posting_date_not_moved",
          "bill_posting_no_open_period",
          "bill_posting_date_not_recorded",
          "bill_posting_date_at_review",
          "payment_run_bill_owed_moved",
          "payment_bill_owed_moved",
          "bill_settlement_more_than_owed",
          "bill_settlement_short_without_reason",
          "vendor_credit_not_draft",
          "vendor_credit_no_vendor",
          "vendor_credit_incomplete",
          "vendor_credit_nothing_credited",
          "vendor_credit_number_used",
          "vendor_credit_date_future",
          "vendor_credit_vendor_archived",
          "vendor_credit_not_in_review",
          "vendor_credit_same_person",
          "vendor_credit_pricing_moved",
          "vendor_credit_posting_date_required",
          "vendor_credit_posting_date_outside",
          "vendor_credit_posting_date_not_moved",
          "vendor_credit_no_open_period",
          "vendor_credit_not_open",
          "vendor_credit_bill_other_vendor",
          "vendor_credit_bill_other_company",
          "vendor_credit_bill_currency",
          "vendor_credit_bill_not_owing",
          "vendor_credit_bill_in_draft_run",
          "vendor_credit_payable_differs",
          "vendor_credit_bill_over_open",
          "vendor_credit_over_remaining",
          "vendor_credit_already_applied",
          "vendor_credit_exchange_account_missing",
          "vendor_credit_application_in_run",
          "vendor_credit_application_not_live",
          "vendor_credit_not_approved",
          "vendor_credit_has_applications",
          "vendor_credit_has_refunds",
          "vendor_credit_refund_future_date",
          "vendor_credit_refund_account_not_company",
          "vendor_credit_refund_amount_required",
          "vendor_credit_refund_over_remaining",
          "vendor_credit_refund_not_awaiting",
          "vendor_credit_refund_not_standing",
          "vendor_credit_refund_same_person",
          "vendor_credit_export_too_many",
          "payment_run_credit_not_open",
          "payment_run_credit_other_vendor",
          "payment_run_credit_over_open",
          "payment_run_credit_covers_bill",
          "bill_supersede_not_draft",
          "bill_supersede_self",
          "bill_supersede_target_unknown",
          "bill_supersede_target_draft",
          "bill_supersede_other_company",
          "bill_supersede_no_vendor",
          "bill_supersede_other_vendor",
          "bill_supersede_taken",
          "bill_supersede_already_linked",
          "bill_supersede_not_linked",
          "bill_supersede_first_stands",
          "bill_supersede_flag_settled",
          "bill_supersede_flag_not_this",
          "payment_run_cheque_number_required",
          "payment_run_cheque_number_not_asked",
          "payment_run_cheque_number_range",
          "payment_run_cheque_number_taken",
          "payment_run_register_not_cheque",
          "payment_run_register_not_released",
          "bill_settlement_line_not_a_candidate",
          "bill_settlement_line_declined",
          "bill_settlement_feed_score_moved",
          "bill_settlement_line_taken",
          "bill_settlement_line_certified",
          "bill_feed_line_not_a_candidate",
          "payment_discount_changed",
          "payment_discount_window_closed",
          "payment_discount_account_type",
          "payment_run_remove_not_draft",
          "payment_run_remove_last",
          "payment_run_payment_already_removed",
          "payment_reverse_not_released",
          "payment_removed_never_posted",
          "payment_already_reversed",
          "payment_reverse_file_rejected",
          "payment_return_date_invalid",
          "payment_run_notice_document_invalid",
          "payment_run_lodgement_not_released",
          "payment_run_lodgement_recorded",
          "payment_run_lodgement_reversed",
          "payment_run_lodgement_date_invalid",
          "payment_run_outcome_not_lodged",
          "payment_run_outcome_recorded",
          "payment_run_outcome_accepted_reversed",
          "payment_run_outcome_after_return",
          "payment_run_outcome_date_invalid",
          "payment_run_banking_returned",
          "payment_run_banking_returned_meanwhile",
          "payment_run_totals_not_recorded",
          "payment_run_lodgement_cheque",
          "payment_run_bills_twin_paid",
          "bill_settlement_line_not_a_bill",
          "bill_settlement_line_amount_differs",
          "payment_run_clearing_disagrees",
          "payment_bank_profile_no_originator",
          "payment_bank_profile_exists",
          "payment_bank_profile_uncited",
          "payment_bank_profile_changed",
          "payment_run_test_not_draft",
          "payment_run_test_no_profile",
          "payment_run_test_check_failed",
          "payment_bank_file_verdict_recorded",
          "payment_bank_file_verdict_no_evidence",
          "payment_bank_file_evidence_not_on_ledger",
          "payment_bank_file_tests_export_too_many",
          "payment_run_bank_file_unproved",
          "payment_run_bank_date_window",
          "payment_run_bank_currency_refused",
          "payment_run_test_not_eft",
          "vendor_notice_remittance_run_not_released",
          "vendor_notice_remittance_not_sender",
          "vendor_notice_remittance_needs_second_person",
          "vendor_notice_remittance_new_address_needs_person",
          "vendor_notice_remittance_confirm_not_new",
          "vendor_notice_remittance_exists",
          "vendor_notice_remittance_payment_reversed",
          "vendor_notice_remittance_from_run",
          "vendor_notice_remittance_paragraph_contact_detail",
          "vendor_notice_remittance_paragraph_banking",
          "vendor_notice_remittance_paragraph_promise",
          "vendor_notice_bill_no_supplier",
          "vendor_notice_decision_not_made",
          "vendor_notice_no_supplier_contact",
          "vendor_notice_supplier_contact_no_seat",
          "vendor_notice_decision_draft_open",
          "vendor_notice_already_told",
          "vendor_notice_nothing_to_ask",
          "vendor_notice_words_decision",
          "vendor_notice_words_contact_detail",
          "vendor_notice_words_banking",
          "vendor_notice_banking_no_earlier_contact",
          "vendor_notice_recipient_after_change",
          "vendor_notice_not_person_drafted",
          "inbox_address_closing_out_of_range",
          "inbox_address_closing_scheduled",
          "inbox_address_closing_not_scheduled",
          "inbox_address_successor_unusable",
          "purchases_supplier_contact_no_seat",
          "inbox_address_closing_not_announced",
          "vendor_notice_supplier_contact_bills_address",
          "inbox_arrival_owned_by_credit",
          "vendor_credit_refund_currency",
          "vendor_credit_line_other_bill",
          "bill_settlement_evidence_unreadable",
          "bill_feed_line_no_supplier",
          "payment_run_bank_notice_too_large",
          "payment_run_wire_abroad_unreadable",
          "bill_supersede_prefill_too_many_lines",
          "bill_supersede_prefill_no_lines",
          "vendor_document_not_paper",
          "vendor_document_already_filed",
          "vendor_document_title",
          "vendor_document_dates",
          "vendor_document_expiry_too_far",
          "vendor_document_replaces_other_kind",
          "vendor_document_already_replaced",
          "vendor_document_already_withdrawn",
          "vendor_document_waiver_in_force",
          "vendor_document_without_terms_kind",
          "vendor_paper_cap",
          "vendor_paper_file_missing",
          "vendor_paper_file_stand_in",
          "vendor_agreement_term",
          "vendor_agreement_dates",
          "vendor_agreement_notice",
          "vendor_agreement_committed",
          "vendor_agreement_copy_not_theirs",
          "vendor_agreement_already_renewed",
          "vendor_agreement_not_your_decision",
          "vendor_agreement_closed",
          "vendor_paper_notice_no_recipient",
          "vendor_paper_notice_nothing_to_ask",
          "vendor_paper_notice_open_draft",
          "vendor_paper_notice_not_deciding_to_end",
          "vendor_paper_notice_needs_agreement",
          "vendor_paper_notice_names_no_agreement",
          "paper_requirements_count_moved",
          "paper_requirements_too_many",
          "paper_requirements_no_kind",
          "vendor_alias_key_taken",
          "vendor_alias_is_own_name",
          "vendor_alias_limit",
          "vendor_merged_not_restorable",
          "vendor_link_changed",
          "vendor_link_posted_needs_approver",
          "vendor_link_nothing",
          "vendor_merge_same_record",
          "vendor_merge_absorbed_archived",
          "vendor_merge_survivor_archived",
          "vendor_merge_absorbed_refused",
          "vendor_merge_survivor_refused",
          "vendor_merge_banking_open",
          "vendor_merge_banking_differs",
          "vendor_merge_hold_would_lift",
          "vendor_merge_in_draft_run",
          "vendor_merge_bills_in_review",
          "vendor_merge_open_credit",
          "vendor_merge_authority_scope",
          "vendor_merge_counterparty",
          "vendor_merge_slip_kind_differs",
          "vendor_merge_residency_differs",
          "vendor_merge_slip_consent_both_live",
          "vendor_merge_paper_over_cap",
          "vendor_merge_already_open",
          "vendor_merge_survivor_is_absorbed",
          "vendor_merge_same_hand",
          "vendor_merge_expired",
          "vendor_merge_decided",
          "vendor_merge_changed",
          "vendor_merge_withdraw_not_proposer",
          "vendor_merge_export_too_many",
          "vendor_merge_suggestion_dismissed",
          "vendor_merge_suggestion_reinstated",
          "bill_vendor_merged",
          "bill_link_vendor_in_review",
          "bill_link_vendor_void",
          "bill_link_vendor_posted_has_vendor",
          "supplier_match_decided",
          "bill_supplier_match_other_supplier",
          "slip_copies_file_not_kept",
          "slip_copies_print_too_many",
          "slip_copies_print_none",
          "slip_copy_document_not_stored",
          "slip_copy_export_too_many",
          "slip_copies_mailed_set_changed",
          "slip_copies_mailed_not_waiting",
          "slip_copies_mailed_future",
          "slip_consent_no_email",
          "slip_consent_already_live",
          "slip_consent_future",
          "slip_consent_not_given",
          "slip_copy_email_no_consent",
          "slip_copy_from_copies",
          "slip_copy_notice_by_hand",
          "slip_identity_ask_nothing_missing",
          "slip_identity_ask_recent",
          "bill_withholding_status",
          "bill_withholding_vendor_residency",
          "bill_withholding_withheld_on",
          "bill_withholding_changed",
          "bill_withholding_line_not_current",
          "bill_withholding_line_not_service",
          "bill_withholding_whole_bill_has_lines",
          "withholding_waiver_vendor",
          "withholding_waiver_document",
          "withholding_waiver_company",
          "withholding_waiver_already_recorded",
          "withholding_waiver_already_ended",
          "withholding_waiver_end_date",
          "purchases_withholding_account_not_liability",
          "vendor_slip_non_resident",
          "vendor_residency_has_nr_slip",
          "payment_withholding_moved",
          "payment_withholding_account_moved",
          "inbox_controls_sender_above_address",
          "inbox_arrival_held",
          "inbox_hold_not_held",
          "inbox_controls_export_too_many",
          "inbox_controls_firings_filters",
          "payment_run_marks_unconfirmed",
          "payment_run_marks_unknown",
          "payment_run_marks_not_recorded",
          "payment_run_brief_not_draft",
          "bill_dimension_value_unknown",
          "bill_proposed_tag_not_on_line",
          "bill_dimension_not_recorded",
          "bill_budget_changed",
          "bill_budget_not_open",
          "seat_company_outside",
          "seat_company_all_needed",
          "seat_company_person_not_covering",
          "seat_company_policy_wide",
          "seat_company_unclassified",
          "seat_company_report_needs_one",
          "seat_company_not_on_ledger",
          "seat_company_ledger_mismatch",
          "purchase_order_not_found",
          "purchase_order_not_draft",
          "purchase_order_empty_patch",
          "purchase_order_incomplete",
          "purchase_order_vendor_unusable",
          "purchase_order_asked_not_covered",
          "purchase_order_fx_no_rate",
          "purchase_order_fx_not_foreign",
          "purchase_order_dimension_misfiled",
          "purchase_order_awaiting_with_status",
          "purchase_order_changed",
          "purchase_order_not_in_approval",
          "purchase_order_no_authority",
          "purchase_order_outside_authority",
          "purchase_order_authority_expired",
          "purchase_order_over_approval_ceiling",
          "purchase_order_own_work_no_ceiling",
          "purchase_order_cannot_take_back",
          "purchase_order_take_back_seat",
          "purchase_order_notice_open",
          "purchase_order_not_sent",
          "purchase_order_cancel_seat",
          "purchase_order_cancelled",
          "purchase_order_not_approved_to_send",
          "purchase_order_already_sent",
          "purchase_order_no_recipient",
          "purchase_order_recipient_unknown",
          "purchase_order_not_cancelled",
          "purchase_order_series_next_lower",
          "purchase_order_export_too_many",
          "purchase_order_quote_document_not_quote",
          "purchase_order_suggestion_gone",
          "goods_receipt_not_found",
          "purchase_order_not_receivable",
          "goods_receipt_incomplete",
          "goods_receipt_over_receipt",
          "goods_receipt_future_date",
          "goods_receipt_before_order",
          "goods_receipt_receiver_is_approver",
          "goods_receipt_service_requester_only",
          "goods_receipt_on_behalf_seat",
          "goods_receipt_on_behalf_note",
          "goods_receipt_order_changed",
          "goods_receipt_not_proposed",
          "goods_receipt_not_confirmed",
          "goods_receipt_void_seat",
          "goods_receipt_billed",
          "goods_receipt_evidence_limit",
          "goods_receipt_evidence_kind",
          "goods_receipt_evidence_not_attached",
          "goods_receipt_attach_not_live",
          "goods_receipt_withdraw_seat",
          "purchase_order_cancel_after_receipt",
          "purchase_order_amend_after_receipt",
          "purchase_order_cannot_close",
          "purchase_order_close_seat",
          "purchase_order_not_closed",
          "bill_order_link_not_open",
          "bill_order_line_wrong_company",
          "bill_order_line_wrong_supplier",
          "bill_order_line_not_open",
          "bill_order_link_not_recorded",
          "bill_order_link_no_line",
          "bill_order_link_duplicate_line",
          "bill_order_proposal_cleared_line",
          "bill_order_proposal_no_supplier",
          "bill_match_changed",
          "purchases_policy_tolerance_over_authority",
          "vendor_order_exemption_reason_required",
          "accrual_account_missing",
          "accrual_account_not_liability",
          "accrual_account_is_payable",
          "accrual_period_locked",
          "accrual_earlier_standing",
          "accrual_nothing_to_accrue",
          "accrual_standing_differs",
          "accrual_rate_missing",
          "accrual_too_many_lines",
          "expected_bills_month_in_future",
          "expected_bills_export_too_many",
          "accrual_no_signals",
          "accrual_bill_arrived",
          "accrual_already_drafted",
          "accrual_not_predicted",
          "schedule_follow_not_posted",
          "schedule_follow_other_schedule",
          "schedule_follow_inactive",
          "signal_scope_not_offered",
          "bill_prepaid_changed",
          "bill_prepaid_choice_missing",
          "bill_prepaid_not_open",
          "bill_prepaid_released",
          "bill_prepaid_line_locked",
          "prepaid_release_waiting",
          "prepaid_nothing_to_end",
          "prepaid_period_closed",
          "prepaid_not_active",
          "prepaid_destination_refused",
          "prepaid_account_type",
          "bill_holdback_too_large",
          "bill_holdback_amount_invalid",
          "bill_holdback_foreign_currency",
          "bill_holdback_account_missing",
          "bill_holdback_account_not_liability",
          "bill_holdback_account_is_payable",
          "bill_holdback_release_not_posted",
          "bill_holdback_release_exceeds",
          "bill_holdback_release_none_left",
          "bill_holdback_release_before_bill",
          "bill_holdback_release_future",
          "bill_holdback_edit_released",
          "bill_holdback_void_released",
          "bill_holdback_none_note_short",
          "purchases_settings_account_shared",
          "cutover_exists",
          "cutover_date_future",
          "cutover_date_before_incorporation",
          "cutover_suspense_type",
          "cutover_suspense_inactive",
          "cutover_suspense_is_payable",
          "cutover_go_live_documents",
          "cutover_go_live_owned",
          "cutover_settled_frozen",
          "cutover_already_settled",
          "cutover_withdrawn",
          "cutover_withdraw_date_moved",
          "cutover_withdraw_opening_entry",
          "cutover_opening_entry_company",
          "cutover_opening_entry_date",
          "cutover_opening_entry_status",
          "cutover_checks_failing",
          "cutover_checks_changed",
          "cutover_acknowledgement_unknown",
          "cutover_export_too_many",
          "open_payables_cutover_closed",
          "open_payables_wrong_company",
          "open_payables_uploader_posts",
          "open_payables_attestation_missing",
          "open_payables_rows_not_ready",
          "open_payables_count_changed",
          "open_payables_difference_unexplained",
          "open_payables_authority",
          "open_payables_period_locked",
          "open_payables_reverse_closed",
          "open_payables_already_reversed",
          "open_payables_reverse_blocked",
          "open_payables_bill_not_editable",
          "open_payables_bill_void_closed",
          "open_payables_cutover_has_postings",
          "parallel_run_payables_month_not_ended",
          "parallel_run_payables_not_addable",
          "parallel_run_payables_not_compared",
          "parallel_run_proposal_decided",
          "parallel_run_proposal_stale",
          "parallel_run_total_not_classified",
          "parallel_run_proposal_not_found",
          "parallel_run_month_past_line_ceiling",
          "banking_batch_not_yours",
          "banking_batch_file_format",
          "banking_batch_too_many",
          "banking_batch_secret_fill",
          "banking_batch_paper_limit",
          "banking_batch_paper_duplicate",
          "banking_batch_paper_closed",
          "banking_batch_check_nothing",
          "banking_batch_check_running",
          "banking_batch_filter_kind",
          "banking_batch_expired",
          "banking_batch_still_reading",
          "banking_paper_name_empty",
          "banking_paper_taken_off",
          "bill_payable_account_not_recorded",
          "payment_run_release_totals_not_recorded",
          "record_import_apply_running",
          "record_import_too_many_to_approve",
          "record_import_revert_refused",
          "record_import_revert_asset_standing",
          "record_import_revert_customer_waiting",
          "record_import_kind_web_only",
          "payment_run_release_timed_out",
          "list_sort_unknown",
          "list_sort_needs_company",
          "list_sort_unavailable",
          "bill_amount_needs_company",
          "purchases_cursor_other_order",
          "list_view_limit",
          "list_view_shared_limit",
          "list_view_name_taken",
          "list_view_params_not_taken",
          "list_view_share_needs_seat",
          "bulk_act_empty",
          "bulk_act_too_many",
          "bulk_act_reason_needed",
          "bulk_act_filter_not_taken",
          "bulk_act_filter_changed",
          "bulk_act_changed",
          "bulk_act_over_cap",
          "bulk_act_nothing_eligible",
          "bulk_act_wrong_mode",
          "bulk_item_not_found",
          "bulk_item_status",
          "bill_bulk_stage_is_review",
          "bill_bulk_no_rate",
          "bill_bulk_month_closed",
          "bill_bulk_over_budget",
          "bill_bulk_match_exception",
          "bill_bulk_prepaid_offered",
          "bill_bulk_findings",
          "bill_bulk_signal_open",
          "bill_bulk_not_draft",
          "bill_bulk_not_held",
          "vendor_bulk_already_held",
          "vendor_bulk_not_held",
          "payment_run_bulk_not_draft",
          "purchase_order_bulk_not_draft",
          "inbox_bulk_already_decided",
          "purchases_export_kind_unknown",
          "purchases_export_query_invalid",
          "purchases_export_open_limit",
          "purchases_export_all_needs_audit",
          "purchases_export_not_ready",
          "purchases_export_failed",
          "purchases_export_expired",
          "purchases_export_not_yours",
          "purchases_export_seat_changed",
          "purchases_export_object_missing",
          "privacy_received_out_of_range",
          "privacy_identity_note_needed",
          "privacy_not_an_individual",
          "privacy_duplicate_open",
          "privacy_change_in_force",
          "privacy_change_in_draft_run",
          "privacy_change_not_paid",
          "privacy_digits_already_destroyed",
          "privacy_permission_needed",
          "privacy_permission_voided",
          "privacy_permission_other_supplier",
          "privacy_permission_duplicate",
          "privacy_permission_used",
          "privacy_own_request",
          "privacy_not_waiting",
          "privacy_not_open",
          "privacy_plan_moved",
          "privacy_not_yours",
          "privacy_answer_before_decision",
          "privacy_already_answered",
          "privacy_pack_not_for_this_kind",
          "privacy_pack_not_asked",
          "privacy_pack_not_ready",
          "privacy_pack_build_failed",
          "privacy_pack_build_cancelled",
          "privacy_pack_gone",
          "privacy_admin_only",
          "privacy_message_too_long",
          "privacy_no_decision_for_copy",
          "privacy_export_too_many",
          "privacy_permission_letter_wrong_kind",
          "vendor_merge_privacy_request_open",
          "vendor_merge_portal_submission_waiting",
          "vendor_merge_vendor_query_open",
          "vendor_merge_vendor_statement_open",
          "year_end_file_year_end_invalid",
          "year_end_file_building",
          "year_end_file_not_building",
          "year_end_file_not_ready",
          "year_end_file_already_signed",
          "year_end_file_store_unavailable",
          "year_end_file_audit_seat",
          "year_end_file_commentary_figure",
          "year_end_file_decisions_incomplete",
          "year_end_commentary_attempts",
          "year_end_file_export_too_many",
          "vendor_portal_off",
          "vendor_portal_link_revoked",
          "vendor_portal_no_live_link",
          "vendor_portal_issuer_deciding",
          "vendor_portal_already_decided",
          "vendor_portal_record_moved",
          "vendor_portal_submission_kind",
          "vendor_portal_evidence_mismatch",
          "vendor_portal_closed",
          "vendor_portal_facts_empty",
          "vendor_portal_facts_waiting",
          "vendor_portal_banking_waiting",
          "vendor_portal_digits_not_here",
          "vendor_portal_paper_kind",
          "vendor_portal_cap",
          "vendor_portal_daily_limit",
          "vendor_portal_no_company",
          "vendor_portal_file_too_large",
          "vendor_portal_file_empty",
          "vendor_portal_file_type",
          "vendor_portal_file_not_kept",
          "vendor_portal_not_withdrawable",
          "vendor_portal_link_mismatch",
          "vendor_query_closed",
          "vendor_query_moved_on",
          "vendor_query_already_resolved",
          "vendor_query_owner_no_seat",
          "vendor_query_assign_not_yours",
          "vendor_query_subject_other_supplier",
          "vendor_query_vendor_archived",
          "vendor_query_arrival_not_a_message",
          "vendor_query_arrival_already_opened",
          "vendor_query_arrival_supplier_needed",
          "vendor_query_fact_not_available",
          "vendor_query_answer_empty",
          "vendor_notice_invitation_needs_link",
          "vendor_notice_link_not_invitation",
          "vendor_portal_company_needed",
          "vendor_portal_owner_unavailable",
          "vendor_portal_query_closed",
          "vendor_query_arrival_text_unreadable",
          "vendor_query_policy_expires_past",
          "vendor_query_no_company_reachable",
          "vendor_query_message_other_supplier",
          "vendor_query_arrival_quoted_only",
          "vendor_query_internal_question_not_open",
          "vendor_statement_database_refused",
          "vendor_query_portal_duplicate",
          "vendor_query_portal_open_cap",
          "vendor_query_portal_message_cap",
          "vendor_query_policy_expiry",
          "vendor_query_policy_ended",
          "vendor_query_export_too_many",
          "vendor_query_set_aside_origin",
          "vendor_query_follow_up_open",
          "vendor_statement_not_found",
          "vendor_statement_exists",
          "vendor_statement_document_used",
          "vendor_statement_file_format",
          "vendor_statement_file_too_large",
          "vendor_statement_missing_date",
          "vendor_statement_too_many_lines",
          "vendor_statement_not_in_review",
          "vendor_statement_changed",
          "vendor_statement_books_moved",
          "vendor_statement_no_supplier",
          "vendor_statement_supplier_differs",
          "vendor_statement_unchecked_figures",
          "vendor_statement_missing_header",
          "vendor_statement_too_many_bills",
          "vendor_statement_link_invalid",
          "vendor_statement_decline_reason",
          "vendor_statement_read_in_progress",
          "vendor_statement_read_attempts_used",
          "vendor_statement_nothing_to_read",
          "vendor_statement_not_accepted",
          "vendor_statement_nothing_to_ask",
          "vendor_statement_discard_seat",
          "vendor_account_statement_not_tied",
          "vendor_account_statement_too_many_rows",
          "vendor_account_statement_too_many_to_draw",
          "bill_question_topic_open",
          "bill_question_bill_void",
          "bill_question_outcome_required",
          "bill_question_outcome_bill_only",
          "ai_ceiling_not_whole_cents",
          "ai_ceiling_too_high",
          "ai_ceiling_below_budget",
          "ai_budget_above_ledger",
          "ai_use_cursor_invalid",
          "ai_use_range_too_long",
          "ai_use_export_too_many",
          "bill_capital_bill_not_posted",
          "bill_capital_line_not_capital",
          "bill_capital_set_aside",
          "bill_capital_over_line",
          "bill_capital_entity_differs",
          "bill_capital_account_differs",
          "bill_capital_changed",
          "bill_capital_line_locked",
          "bill_capital_void_blocked",
          "bill_capital_read_off",
          "bill_capital_read_attempts_used",
          "bill_capital_read_not_open",
          "bill_capital_asset_already_linked",
          "bill_capital_asset_mismatch",
          "bill_capital_look_back_future",
          "signal_capital_set_aside_own_work",
          "signal_confirmed_by_registration",
          "purchases_line_profile_too_few_bills",
          "purchases_line_profile_field_not_agreed",
          "purchases_line_profile_pattern_moved",
          "purchases_line_profile_one_live",
          "purchases_line_profile_replaces_nothing",
          "purchases_line_profile_not_typed",
          "purchases_line_profile_account_not_active",
          "bill_plan_not_open",
          "bill_plan_date_past",
          "bill_plan_date_far",
          "bill_due_account_needs_company",
          "bill_due_account_invalid",
          "bulk_act_needs_date",
          "payment_plan_account_invalid",
          "payment_plan_vendor_unknown",
          "payment_plan_window_invalid",
          "payment_plan_nothing_to_plan",
          "payment_plan_expired",
          "payment_plan_already_decided",
          "payment_plan_changed",
          "payment_plan_line_unknown",
          "payment_plan_lines_open",
          "payment_plan_not_recorded",
          "payment_run_release_policy_author",
          "run_policy_account_taken",
          "run_policy_expiry_too_far",
          "run_policy_currency_differs",
          "run_policy_not_in_force",
          "run_policy_decline_needed",
          "run_policy_decline_suggestion",
          "run_policy_replace_invalid",
          "month_end_commentary_month_invalid",
          "month_end_commentary_draft_exists",
          "month_end_commentary_replaced",
          "month_end_commentary_race",
          "month_end_commentary_read_failed",
          "month_end_commentary_database_refused",
          "month_end_commentary_not_draft",
          "month_end_commentary_audit_seat",
          "month_end_commentary_sentence_figure",
          "month_end_commentary_decisions_incomplete",
          "month_end_commentary_nothing_kept",
          "month_end_commentary_attempts",
          "month_end_commentary_export_too_many",
          "imported_history_suppliers_unplaced",
          "imported_history_suppliers_not_offered",
          "migration_file_not_readable",
          "migration_file_wrong_kind",
          "migration_no_open_payables",
          "migration_too_many_files",
          "migration_reading_too_many",
          "migration_banking_needs_sensitive",
          "migration_month_signed",
          "migration_month_no_payables",
          "migration_month_company",
          "migration_month_before_conversion",
          "migration_assistant_not_for_lens",
          "migration_finding_decided",
          "migration_finding_not_proposal",
          "migration_finding_stale",
          "migration_class_not_allowed",
          "migration_change_needs",
          "migration_export_too_many",
          "webhook_signing_not_configured",
          "webhook_url_invalid",
          "webhook_url_not_https",
          "webhook_url_private",
          "webhook_url_has_query",
          "webhook_url_has_credentials",
          "webhook_url_port",
          "webhook_url_duplicate",
          "webhook_endpoint_limit",
          "webhook_event_unknown",
          "webhook_endpoint_not_active",
          "webhook_endpoint_removed",
          "webhook_secret_already_shown",
          "webhook_delivery_not_dead",
          "webhook_test_too_soon",
          "webhook_export_too_many",
          "card_receipt_export_too_many",
          "bill_also_record_needs_card",
          "bill_seen_total_changed",
          "bill_vendor_is_own_company",
          "vendor_counterparty_has_bills",
          "vendor_merge_counterparty_own_bills",
          "intercompany_other_company_not_in_seat",
          "intercompany_pair_decided",
          "intercompany_pair_not_open",
          "intercompany_candidate_taken",
          "intercompany_candidate_not_eligible",
          "intercompany_unlink_has_elimination",
          "intercompany_customer_needs_approval",
          "intercompany_customer_company_taken",
          "intercompany_mirror_line_not_billable",
          "intercompany_mirror_too_many_lines",
          "intercompany_account_not_revenue",
          "intercompany_figures_moved",
          "intercompany_decline_needs_reason",
          "intercompany_elimination_exists",
          "intercompany_elimination_already_void",
          "intercompany_by_hand_not_needed",
          "intercompany_by_hand_needs_note",
          "intercompany_elimination_groups_differ",
          "intercompany_reading_off",
          "intercompany_reading_limit",
          "intercompany_export_too_many",
          "intercompany_look_back_company_required",
          "inbox_domain_apex",
          "inbox_domain_platform",
          "inbox_domain_malformed",
          "inbox_domain_company_has_one",
          "inbox_domain_taken",
          "inbox_domain_unavailable",
          "inbox_domain_not_verified",
          "inbox_domain_local_part_reserved",
          "inbox_domain_address_taken",
          "inbox_domain_invoices_mailbox",
          "inbox_domain_company_mismatch",
          "inbox_domain_removed_final",
          "payment_rail_not_approved",
          "payment_rail_not_configured",
          "payment_rail_off",
          "payment_rail_no_connection",
          "payment_rail_connection_unavailable",
          "payment_rail_provider_unavailable",
          "payment_rail_funding_source_refused",
          "payment_rail_funding_source_in_use",
          "payment_rail_funding_source_not_bound",
          "payment_rail_already_set",
          "payment_rail_run_not_released",
          "payment_rail_method",
          "payment_rail_currency",
          "payment_rail_run_lodged",
          "payment_rail_already_dispatched",
          "payment_rail_run_reversed",
          "payment_rail_run_moved",
          "payment_rail_confirmation_needed",
          "payment_rail_run_changed",
          "payment_rail_nothing_to_send",
          "payment_rail_nothing_to_stop",
          "payment_rail_sending_now",
          "payment_rail_outcome_unknown",
          "payment_rail_payees_not_payable",
          "payment_rail_in_flight",
          "payment_run_lodgement_dispatched",
          "payment_return_file_invalid",
          "payment_return_file_duplicate",
          "payment_return_file_not_a_notice",
          "payment_return_run_not_released",
          "payment_return_run_not_eft",
          "payment_return_proposal_decided",
          "payment_run_outcome_with_open_returns",
          "vendor_query_arrival_changed",
          "vendor_statement_file_missing",
          "purchases_custom_field_values_bill_void",
          "purchases_custom_field_values_kind_unknown",
          "vendor_reopen_archived",
          "vendor_reopen_nothing_to_reopen",
          "vendor_reopen_decided_again",
          "vendor_restore_moved_on",
          "vendor_registration_check_replaced",
          "vendor_registration_stated_changed",
          "vendor_registration_earlier_check_unusable",
          "vendor_credit_moved_on",
          "payment_run_policy_pass_not_run",
          "payment_run_policy_pass_run_moved",
          "vendor_line_profile_not_proposal",
          "vendor_line_profile_not_dismissed",
          "vendor_line_profile_not_restorable",
          "vendor_line_profile_was_discarded_proposal",
          "inbox_suggestion_decline_moved_on",
          "bill_still_owed_moved_on",
          "bill_feed_decline_moved_on",
          "bill_submission_moved_on",
          "bill_prepaid_early_end_moved_on"
        ],
        "description": "The values listed in `x-extensible-enum` are the ones known today. New values can appear without a new release, so handle an unknown one as you would an unexpected state, not as a failure to parse."
      },
      "Condition": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ConditionOption1"
          },
          {
            "type": "object",
            "properties": {
              "all": {
                "$ref": "#/components/schemas/All"
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "$ref": "#/components/schemas/All"
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/AllItem"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          }
        ],
        "description": "A group {all: [...]}, {any: [...]} or {not: condition}, or a comparison {field, op, value | otherField}. field is cf.<key> for a custom field or the name of a standard field. op is isBlank, isNotBlank, equals, notEquals, greaterThan, atLeast, lessThan, atMost, oneOf, noneOf, contains or changed. Groups nest 3 levels deep, with 20 comparisons at most.",
        "examples": [
          {
            "all": [
              {
                "field": "totalMinor",
                "op": "greaterThan",
                "value": "1000000"
              },
              {
                "field": "cf.project",
                "op": "isBlank"
              }
            ]
          }
        ]
      },
      "Condition2": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Condition2Option1"
          },
          {
            "type": "object",
            "properties": {
              "all": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AllItem2"
                }
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AllItem2"
                }
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/AllItem2"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Condition2Option1": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "op": {
            "type": "string",
            "enum": [
              "isBlank",
              "isNotBlank",
              "equals",
              "notEquals",
              "greaterThan",
              "atLeast",
              "lessThan",
              "atMost",
              "oneOf",
              "noneOf",
              "contains",
              "changed"
            ]
          },
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "boolean"
              },
              {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 200
                }
              }
            ]
          },
          "otherField": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        },
        "required": [
          "field",
          "op"
        ],
        "additionalProperties": false
      },
      "ConditionOption1": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "pattern": "^(cf\\.[a-z][a-z0-9_]{0,39}|dim\\.[A-Z][A-Z0-9_]{0,39}|[a-z][A-Za-z0-9]{0,39})$"
          },
          "op": {
            "type": "string",
            "enum": [
              "isBlank",
              "isNotBlank",
              "equals",
              "notEquals",
              "greaterThan",
              "atLeast",
              "lessThan",
              "atMost",
              "oneOf",
              "noneOf",
              "contains",
              "changed"
            ]
          },
          "value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "minItems": 1,
                "maxItems": 100
              }
            ]
          },
          "otherField": {
            "type": "string",
            "pattern": "^(cf\\.[a-z][a-z0-9_]{0,39}|dim\\.[A-Z][A-Z0-9_]{0,39}|[a-z][A-Za-z0-9]{0,39})$"
          }
        },
        "required": [
          "field",
          "op"
        ],
        "additionalProperties": false
      },
      "Conflicts": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "objectType",
                "dimensionType",
                "recordField",
                "lineField",
                "rule"
              ]
            },
            "field": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "resolvable": {
              "type": "boolean"
            }
          },
          "required": [
            "key",
            "kind",
            "field",
            "reason",
            "resolvable"
          ],
          "additionalProperties": false
        }
      },
      "Counts": {
        "type": "object",
        "properties": {
          "objectTypes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "fields": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lineFields": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "rules": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "dimensionTypes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "objectTypes",
          "fields",
          "lineFields",
          "rules",
          "dimensionTypes"
        ],
        "additionalProperties": false
      },
      "CreateCustomFieldDefinitionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "recordKind": {
            "type": "string",
            "enum": [
              "CUSTOMER",
              "INVOICE",
              "CREDIT_MEMO",
              "PRODUCT",
              "CONTRACT",
              "VENDOR",
              "BILL",
              "PURCHASE_ORDER",
              "JOURNAL_ENTRY",
              "CUSTOM_OBJECT",
              "LINE"
            ]
          },
          "objectKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "TEXT",
              "NUMBER",
              "DATE",
              "CHOICE",
              "CHECKBOX",
              "MONEY",
              "MULTI_CHOICE",
              "REFERENCE"
            ]
          },
          "choices": {
            "$ref": "#/components/schemas/Choices"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "$ref": "#/components/schemas/Reference"
          },
          "required": {
            "type": "boolean"
          },
          "showOnDocument": {
            "type": "boolean"
          },
          "indexed": {
            "type": "boolean"
          },
          "indexState": {
            "type": "string",
            "enum": [
              "OFF",
              "BUILDING",
              "READY"
            ]
          },
          "indexJobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "appliesTo": {
            "$ref": "#/components/schemas/AppliesTo"
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "updatedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "recordKind",
          "objectKey",
          "key",
          "label",
          "description",
          "type",
          "choices",
          "currency",
          "reference",
          "required",
          "showOnDocument",
          "indexed",
          "appliesTo",
          "position",
          "archivedAt",
          "archivedBy",
          "createdBy",
          "createdAt",
          "updatedBy",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "Current": {
        "type": "object",
        "properties": {
          "senderPolicy": {
            "type": "string",
            "enum": [
              "ACCEPT_ALL",
              "QUARANTINE_UNAUTHENTICATED",
              "KNOWN_SENDERS_ONLY"
            ]
          },
          "addressDailyMessages": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "senderDailyMessages": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "senderPolicy",
          "addressDailyMessages",
          "senderDailyMessages"
        ],
        "additionalProperties": false
      },
      "Current2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "ledgerId": {
                "type": "string"
              },
              "generation": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "copiedAsOf": {
                "type": "string",
                "minLength": 20
              },
              "rowCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "ledgerId",
              "generation",
              "copiedAsOf",
              "rowCount"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "CustomFields": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,39}$"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 500
            },
            {
              "type": "boolean"
            },
            {
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 80
              }
            }
          ]
        }
      },
      "CustomFields6": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,39}$"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 500
                },
                {
                  "type": "boolean"
                },
                {
                  "minItems": 1,
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 80
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "description": "Send only the fields you are changing. A field with a value is set to it, a field with null is cleared, and a field left out keeps the value it holds, so two people saving different fields of one record at once both keep their change. A clear on an archived field that holds a value is refused."
      },
      "Definition2": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DefinitionOption1"
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "AUTOMATION"
              },
              "trigger": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "entityId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currency": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "condition": {
                "$ref": "#/components/schemas/Condition2"
              },
              "actions": {
                "minItems": 1,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "operation": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "params": {
                      "$ref": "#/components/schemas/Params"
                    },
                    "input": {
                      "$ref": "#/components/schemas/Params"
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    }
                  },
                  "required": [
                    "operation",
                    "params",
                    "input",
                    "label"
                  ],
                  "additionalProperties": false
                }
              },
              "maxRunsPerDay": {
                "default": 50,
                "type": "integer",
                "minimum": 1,
                "maximum": 1000
              },
              "amountCapMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "kind",
              "trigger",
              "entityId",
              "currency",
              "condition",
              "actions",
              "amountCapMinor"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DefinitionOption1": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "APPROVAL"
          },
          "subject": {
            "type": "string",
            "enum": [
              "BILL",
              "INVOICE",
              "PURCHASE_ORDER"
            ]
          },
          "entityId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "condition": {
            "$ref": "#/components/schemas/Condition2"
          },
          "steps": {
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "approver": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "PERSON"
                        },
                        "userId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "kind",
                        "userId"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "ROLE"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "ADMIN",
                            "APPROVER"
                          ]
                        }
                      },
                      "required": [
                        "kind",
                        "role"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "AUTHORITY"
                        }
                      },
                      "required": [
                        "kind"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "GROUP"
                        },
                        "rule": {
                          "type": "string",
                          "enum": [
                            "ANY",
                            "ALL"
                          ]
                        },
                        "userIds": {
                          "minItems": 2,
                          "maxItems": 10,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "kind",
                        "rule",
                        "userIds"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "escalation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "afterDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 60
                        },
                        "to": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "PERSON"
                                },
                                "userId": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "kind",
                                "userId"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "AUTHORITY"
                                }
                              },
                              "required": [
                                "kind"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "afterDays",
                        "to"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "approver",
                "escalation"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "kind",
          "subject",
          "entityId",
          "currency",
          "condition",
          "steps"
        ],
        "additionalProperties": false
      },
      "Desk": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DeskOption1"
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "ROLE"
              },
              "role": {
                "type": "string",
                "enum": [
                  "ADMIN",
                  "APPROVER"
                ]
              }
            },
            "required": [
              "kind",
              "role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "AUTHORITY"
              }
            },
            "required": [
              "kind"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "GROUP"
              },
              "rule": {
                "type": "string",
                "enum": [
                  "ANY",
                  "ALL"
                ]
              },
              "members": {
                "minItems": 2,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "kind",
              "rule",
              "members"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DeskOption1": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "PERSON"
          },
          "person": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "kind",
          "person"
        ],
        "additionalProperties": false
      },
      "DimensionsItem": {
        "type": "object",
        "properties": {
          "dimensionTypeId": {
            "type": "string",
            "minLength": 1
          },
          "dimensionValueId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "dimensionTypeId",
          "dimensionValueId"
        ],
        "additionalProperties": false
      },
      "Dkim": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "TXT",
              "CNAME"
            ]
          },
          "host": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "matches": {
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "host",
          "label",
          "value",
          "matches"
        ],
        "additionalProperties": false
      },
      "FillStatsOption1": {
        "type": "object",
        "properties": {
          "filledFields": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "bills": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "kept": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "changed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "declined": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lastFiredAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "filledFields",
          "bills",
          "kept",
          "changed",
          "declined",
          "lastFiredAt"
        ],
        "additionalProperties": false
      },
      "GetPromotionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "testCopyId": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "PROPOSED",
              "APPLIED",
              "CONFLICTED",
              "APPLYING"
            ]
          },
          "changes": {
            "$ref": "#/components/schemas/Changes"
          },
          "conflicts": {
            "$ref": "#/components/schemas/Conflicts"
          },
          "proposalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "jobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "proposedAt": {
            "type": "string",
            "minLength": 20
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "testCopyId",
          "state",
          "changes",
          "conflicts",
          "proposalId",
          "jobId",
          "outcome",
          "proposedAt",
          "decidedAt"
        ],
        "additionalProperties": false
      },
      "GetSenderDomainResponse": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string"
          },
          "domain": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "entityId": {
                    "type": "string"
                  },
                  "entityName": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "PENDING",
                      "VERIFIED",
                      "DEGRADED",
                      "REMOVED"
                    ]
                  },
                  "inUse": {
                    "type": "boolean"
                  },
                  "dkim": {
                    "$ref": "#/components/schemas/Dkim"
                  },
                  "returnPath": {
                    "$ref": "#/components/schemas/Dkim"
                  },
                  "dmarcPresent": {
                    "type": "boolean"
                  },
                  "dnsProvider": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "verifiedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lastCheckedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "dkimRotatedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "degradedReason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "entityId",
                  "entityName",
                  "domain",
                  "address",
                  "status",
                  "inUse",
                  "dkim",
                  "returnPath",
                  "dmarcPresent",
                  "dnsProvider",
                  "verifiedAt",
                  "lastCheckedAt",
                  "dkimRotatedAt",
                  "degradedReason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "platformAddress": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          }
        },
        "required": [
          "entityId",
          "domain",
          "platformAddress",
          "displayName"
        ],
        "additionalProperties": false
      },
      "History": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "at": {
              "type": "string"
            },
            "action": {
              "type": "string"
            },
            "actorName": {
              "type": [
                "string",
                "null"
              ]
            },
            "actorType": {
              "type": "string",
              "enum": [
                "USER",
                "AGENT",
                "SYSTEM",
                "CUSTOMER"
              ]
            },
            "attribution": {
              "type": "string"
            },
            "targetType": {
              "type": "string"
            },
            "targetId": {
              "type": "string"
            },
            "requestId": {
              "type": [
                "string",
                "null"
              ]
            },
            "clientAddress": {
              "type": [
                "string",
                "null"
              ]
            },
            "before": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                {
                  "type": "null"
                }
              ]
            },
            "after": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                {
                  "type": "null"
                }
              ]
            },
            "door": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "web",
                    "rest",
                    "mcp"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "operation": {
              "type": [
                "string",
                "null"
              ]
            },
            "connectedAppId": {
              "type": [
                "string",
                "null"
              ]
            },
            "undoGroupId": {
              "type": [
                "string",
                "null"
              ]
            },
            "confirmationId": {
              "type": [
                "string",
                "null"
              ]
            },
            "traceId": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "id",
            "at",
            "action",
            "actorName",
            "actorType",
            "attribution",
            "targetType",
            "targetId",
            "requestId",
            "clientAddress",
            "door",
            "operation",
            "connectedAppId",
            "undoGroupId",
            "confirmationId",
            "traceId"
          ],
          "additionalProperties": false
        }
      },
      "Imported": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "position": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "placement": {
              "type": "string",
              "enum": [
                "AT_TIME",
                "START_OF_DAY",
                "ON_DAY",
                "IN_PERIOD"
              ]
            },
            "sortsAt": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 20
                },
                {
                  "type": "null"
                }
              ]
            },
            "record": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "required": [
            "position",
            "placement",
            "sortsAt",
            "record"
          ],
          "additionalProperties": false
        }
      },
      "Input": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/InputOption1"
          },
          {
            "type": "null"
          }
        ]
      },
      "InputOption1": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {},
        "description": "A JSON Schema (draft 2020-12) document: the generated operation's input, query or output for this ledger's custom object.",
        "x-open-by-reference": true
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ledgerId": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "x-extensible-enum": [
              "RECORD_IMPORT_READ",
              "RECORD_IMPORT_APPLY",
              "LIST_EXPORT",
              "AUDIT_PACKAGE",
              "YEAR_END_FILE",
              "PAYMENT_RUN_DISPATCH",
              "BULK_OPERATION",
              "UNDO_GROUP",
              "FULL_EXPORT",
              "WAREHOUSE_BACKFILL",
              "TEST_COPY",
              "WORKFLOW_RUN",
              "VENDOR_PRIVACY_PACK",
              "CAPITAL_LOOK_BACK",
              "VENDOR_PAPER_APPLY",
              "VENDOR_MERGE_APPROVAL",
              "SETTLEMENT_PROPOSE",
              "SALES_INVOICE_IMPORT",
              "WORKSPACE_INVITATIONS_SEND",
              "PROVIDER_TOKEN_REFRESH",
              "PROJECTION_REPLAY",
              "CHART_IMPORT_APPLY",
              "WORKSPACE_IMPORT_APPLY",
              "CSV_IMPORT",
              "CUSTOM_FIELD_INDEX",
              "PROMOTION_APPLY",
              "PERIOD_CLOSE"
            ],
            "description": "The values listed in `x-extensible-enum` are the ones known today. New values can appear without a new release, so handle an unknown one as you would an unexpected state, not as a failure to parse."
          },
          "state": {
            "type": "string",
            "enum": [
              "QUEUED",
              "RUNNING",
              "CANCELLING",
              "STALLED",
              "SUCCEEDED",
              "FAILED",
              "CANCELLED"
            ]
          },
          "done": {
            "type": "boolean"
          },
          "subject": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "label"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "startedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "app": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "door": {
            "type": "string",
            "enum": [
              "web",
              "rest",
              "mcp"
            ]
          },
          "progress": {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "rows",
                  "records",
                  "items",
                  "sections",
                  "payments",
                  "tables"
                ]
              },
              "done": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "failed": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "percent": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "unit",
              "done",
              "failed",
              "total",
              "percent"
            ],
            "additionalProperties": false
          },
          "queuedAt": {
            "type": "string",
            "minLength": 20
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "heartbeatAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "queuePosition": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "cancel": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requestedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "requestedBy": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "late": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "requestedAt",
                  "requestedBy",
                  "reason",
                  "late"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "$ref": "#/components/schemas/Code"
                  },
                  "message": {
                    "type": "string"
                  },
                  "remedy": {
                    "type": "string"
                  },
                  "retryable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "code",
                  "message",
                  "remedy",
                  "retryable"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "x-extensible-enum": [
                      "RECORD_IMPORT_READ",
                      "RECORD_IMPORT_APPLY",
                      "LIST_EXPORT",
                      "AUDIT_PACKAGE",
                      "YEAR_END_FILE",
                      "PAYMENT_RUN_DISPATCH",
                      "BULK_OPERATION",
                      "UNDO_GROUP",
                      "FULL_EXPORT",
                      "WAREHOUSE_BACKFILL",
                      "TEST_COPY",
                      "WORKFLOW_RUN",
                      "VENDOR_PRIVACY_PACK",
                      "VENDOR_PAPER_APPLY",
                      "VENDOR_MERGE_APPROVAL",
                      "CAPITAL_LOOK_BACK",
                      "SETTLEMENT_PROPOSE",
                      "PROVIDER_TOKEN_REFRESH",
                      "WORKSPACE_INVITATIONS_SEND",
                      "PROJECTION_REPLAY",
                      "SALES_INVOICE_IMPORT",
                      "CHART_IMPORT_APPLY",
                      "WORKSPACE_IMPORT_APPLY",
                      "CSV_IMPORT",
                      "CUSTOM_FIELD_INDEX",
                      "PROMOTION_APPLY",
                      "PERIOD_CLOSE"
                    ],
                    "description": "Which kind of job this result is for. The values listed in `x-extensible-enum` are the ones known today. New values can appear without a new release, so handle an unknown one as you would an unexpected state, not as a failure to parse."
                  }
                },
                "required": [
                  "kind"
                ],
                "additionalProperties": true,
                "x-open-by-reference": true,
                "description": "What the job made: ids and counts. The fields depend on `kind`; `x-known-variants` lists the shapes known today. A kind added later is not a change to this contract.",
                "x-known-variants": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "RECORD_IMPORT_READ"
                      },
                      "batchId": {
                        "type": "string"
                      },
                      "rowsRead": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "batchId",
                      "rowsRead"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "RECORD_IMPORT_APPLY"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "applied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "applied",
                      "refused"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "LIST_EXPORT"
                      },
                      "exportId": {
                        "type": "string"
                      },
                      "rows": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "exportId",
                      "rows"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "AUDIT_PACKAGE"
                      },
                      "packageId": {
                        "type": "string"
                      },
                      "records": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "packageId",
                      "records"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "YEAR_END_FILE"
                      },
                      "yearEndFileId": {
                        "type": "string"
                      },
                      "sections": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "yearEndFileId",
                      "sections"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PAYMENT_RUN_DISPATCH"
                      },
                      "paymentRunId": {
                        "type": "string"
                      },
                      "submitted": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "failed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "paymentRunId",
                      "submitted",
                      "failed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "BULK_OPERATION"
                      },
                      "operation": {
                        "type": "string"
                      },
                      "succeeded": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "failed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "skipped": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "operation",
                      "succeeded",
                      "failed",
                      "skipped"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "UNDO_GROUP"
                      },
                      "undoGroupId": {
                        "type": "string"
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "undo",
                          "redo"
                        ]
                      },
                      "groupState": {
                        "type": "string",
                        "enum": [
                          "IN_PLACE",
                          "UNDONE",
                          "PARTLY_UNDONE",
                          "UNDO_PROPOSED"
                        ]
                      },
                      "undone": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "staying": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "notUndone": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refusals": {
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "$ref": "#/components/schemas/Code"
                            },
                            "message": {
                              "type": "string"
                            },
                            "remedy": {
                              "type": "string"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "operation": {
                              "type": "string"
                            },
                            "recordId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "message",
                            "remedy",
                            "ordinal",
                            "operation",
                            "recordId"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "undoGroupId",
                      "direction",
                      "groupState",
                      "undone",
                      "refused",
                      "staying",
                      "notUndone",
                      "refusals"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "FULL_EXPORT"
                      },
                      "requestId": {
                        "type": "string"
                      },
                      "tables": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "requestId",
                      "tables"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WAREHOUSE_BACKFILL"
                      },
                      "destinationId": {
                        "type": "string"
                      },
                      "tables": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "rows": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "destinationId",
                      "tables",
                      "rows"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "TEST_COPY"
                      },
                      "testCopyId": {
                        "type": "string"
                      },
                      "tables": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "testCopyId",
                      "tables"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WORKFLOW_RUN"
                      },
                      "workflowRunId": {
                        "type": "string"
                      },
                      "stepsDone": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "workflowRunId",
                      "stepsDone"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "VENDOR_PRIVACY_PACK"
                      },
                      "requestId": {
                        "type": "string"
                      },
                      "sections": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "requestId",
                      "sections"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "VENDOR_PAPER_APPLY"
                      },
                      "changed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "changed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "VENDOR_MERGE_APPROVAL"
                      },
                      "mergeId": {
                        "type": "string"
                      },
                      "billsMoved": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "mergeId",
                      "billsMoved"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "examined": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "raised": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "alreadyRaised": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "cleared": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "belowFloor": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "notCapital": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "noRate": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "kind": {
                        "type": "string",
                        "const": "CAPITAL_LOOK_BACK"
                      },
                      "entityId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "examined",
                      "raised",
                      "alreadyRaised",
                      "cleared",
                      "belowFloor",
                      "notCapital",
                      "noRate",
                      "kind",
                      "entityId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "SETTLEMENT_PROPOSE"
                      },
                      "settlementId": {
                        "type": "string"
                      },
                      "proposed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "alreadyProposed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "taxMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      }
                    },
                    "required": [
                      "kind",
                      "settlementId",
                      "proposed",
                      "alreadyProposed",
                      "taxMinor"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PROVIDER_TOKEN_REFRESH"
                      },
                      "connectionId": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string",
                        "enum": [
                          "QBO",
                          "XERO"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "REFRESHED",
                          "ALREADY_FRESH"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "connectionId",
                      "provider",
                      "outcome"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WORKSPACE_INVITATIONS_SEND"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "sent": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "notConfigured": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "queued": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "throttled": {
                        "type": "boolean"
                      },
                      "resumesAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "sent",
                      "refused",
                      "notConfigured",
                      "queued",
                      "throttled",
                      "resumesAt"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PROJECTION_REPLAY"
                      },
                      "projection": {
                        "type": "string",
                        "enum": [
                          "entity-summary",
                          "document-index",
                          "webhooks",
                          "workflow-trigger"
                        ]
                      },
                      "appliedFrom": {
                        "type": "string"
                      },
                      "appliedThrough": {
                        "type": "string"
                      },
                      "applied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "projection",
                      "appliedFrom",
                      "appliedThrough",
                      "applied"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "SALES_INVOICE_IMPORT"
                      },
                      "entityId": {
                        "type": "string"
                      },
                      "imported": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "customersCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refusals": {
                        "maxItems": 25,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "number": {
                              "type": "string"
                            },
                            "reason": {
                              "type": "string"
                            },
                            "tax": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "chargedMinor": {
                                      "type": "string"
                                    },
                                    "determinedMinor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "chargedMinor",
                                    "determinedMinor"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "row",
                            "number",
                            "reason",
                            "tax"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "entityId",
                      "imported",
                      "refused",
                      "customersCreated",
                      "refusals"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "CHART_IMPORT_APPLY"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "accountsCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "dimensionValuesCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "dimensionPoliciesCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "dimensionTypeCode": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "declinedGroupCount": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "accountsWithoutGifiCount": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "accountsCreated",
                      "dimensionValuesCreated",
                      "dimensionPoliciesCreated",
                      "dimensionTypeCode",
                      "declinedGroupCount",
                      "accountsWithoutGifiCount"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WORKSPACE_IMPORT_APPLY"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "applied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "sendJobId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "applied",
                      "refused",
                      "sendJobId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "CSV_IMPORT"
                      },
                      "connectionId": {
                        "type": "string"
                      },
                      "syncRunId": {
                        "type": "string"
                      },
                      "inserted": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "duplicates": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "total": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "evidenceKey": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "connectionId",
                      "syncRunId",
                      "inserted",
                      "duplicates",
                      "total",
                      "evidenceKey"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "CUSTOM_FIELD_INDEX"
                      },
                      "definitionId": {
                        "type": "string"
                      },
                      "recordsIndexed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "definitionId",
                      "recordsIndexed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PROMOTION_APPLY"
                      },
                      "promotionId": {
                        "type": "string"
                      },
                      "changesApplied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "indexJobsStarted": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "promotionId",
                      "changesApplied",
                      "indexJobsStarted"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PERIOD_CLOSE"
                      },
                      "closePeriodId": {
                        "type": "string"
                      },
                      "periodYear": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "periodMonth": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      },
                      "lockId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "closePeriodId",
                      "periodYear",
                      "periodMonth",
                      "lockId"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "undoGroupId": {
            "type": [
              "string",
              "null"
            ]
          },
          "traceId": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "may": {
            "type": "object",
            "properties": {
              "cancel": {
                "type": "boolean"
              },
              "resume": {
                "type": "boolean"
              }
            },
            "required": [
              "cancel",
              "resume"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "ledgerId",
          "kind",
          "state",
          "done",
          "subject",
          "startedBy",
          "app",
          "door",
          "progress",
          "queuedAt",
          "startedAt",
          "finishedAt",
          "heartbeatAt",
          "queuePosition",
          "cancel",
          "error",
          "result",
          "undoGroupId",
          "traceId",
          "may"
        ],
        "additionalProperties": false
      },
      "LinesItem2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "billId": {
            "type": "string"
          },
          "supplierName": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "rank": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "decision": {
            "type": "string",
            "enum": [
              "TAKEN",
              "SKIPPED"
            ]
          },
          "skipReason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SkipReasonOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "openMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "cashMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "id",
          "billId",
          "supplierName",
          "number",
          "rank",
          "decision",
          "skipReason",
          "detail",
          "openMinor",
          "cashMinor",
          "currency"
        ],
        "additionalProperties": false
      },
      "List": {
        "type": "string",
        "enum": [
          "vendors",
          "bills",
          "billsDue",
          "paymentRuns",
          "purchaseOrders",
          "arrivals",
          "documents",
          "vendorNotices",
          "signals",
          "vendorCredits",
          "vendorMerges",
          "billInbox",
          "expectedBills",
          "bankingWorklist",
          "vendorQueries",
          "vendorStatements"
        ]
      },
      "ListApiKeysResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "access": {
            "type": "string",
            "enum": [
              "READ",
              "READ_DRAFT"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "EXPIRING",
              "EXPIRED",
              "REVOKED",
              "PENDING"
            ]
          },
          "standing": {
            "type": "string",
            "enum": [
              "active",
              "paused_standing",
              "stopped_maker_left",
              "stopped_ledger_closed"
            ]
          },
          "daysLeft": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "type": "string",
            "minLength": 20
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "revokeReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "prefix",
          "access",
          "scopes",
          "state",
          "standing",
          "daysLeft",
          "createdBy",
          "createdAt",
          "expiresAt",
          "lastUsedAt",
          "revokedBy",
          "revokedAt",
          "revokeReason",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "ListApprovalAuthoritiesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "personName": {
            "type": "string"
          },
          "seatRole": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ADMIN",
                  "APPROVER",
                  "PREPARER",
                  "VIEWER"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "subjectKind": {
            "type": "string",
            "enum": [
              "BILL",
              "ORDER",
              "RUN"
            ]
          },
          "entityId": {
            "type": [
              "string",
              "null"
            ]
          },
          "entityName": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "ANY",
                  "ACCOUNT",
                  "DIMENSION_VALUE",
                  "VENDOR"
                ]
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "kind",
              "id",
              "label"
            ],
            "additionalProperties": false
          },
          "currency": {
            "type": "string"
          },
          "capMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "ownWorkCapMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "origin": {
            "type": "string",
            "enum": [
              "CARRIED_OVER",
              "PERSON",
              "IMPORT"
            ]
          },
          "setBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "setAlone": {
            "type": "boolean"
          },
          "sourceImport": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "fileName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "fileName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "effectiveFrom": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "lastDay": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "effectiveTo": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "closedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "closeReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "CHANGED",
                  "WITHDRAWN"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "closeNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "supersedesId": {
            "type": [
              "string",
              "null"
            ]
          },
          "supersededById": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "IN_FORCE",
              "ENDING",
              "EXPIRED",
              "CLOSED",
              "SEAT_ENDED",
              "EARLIER_SEAT"
            ]
          },
          "entityTimeZone": {
            "type": "string"
          },
          "firingCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lastFiredAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "userId",
          "personName",
          "seatRole",
          "subjectKind",
          "entityId",
          "entityName",
          "scope",
          "currency",
          "capMinor",
          "ownWorkCapMinor",
          "origin",
          "setBy",
          "setAlone",
          "sourceImport",
          "note",
          "effectiveFrom",
          "expiresAt",
          "lastDay",
          "effectiveTo",
          "closedBy",
          "closeReason",
          "closeNote",
          "supersedesId",
          "supersededById",
          "state",
          "entityTimeZone",
          "firingCount",
          "lastFiredAt"
        ],
        "additionalProperties": false
      },
      "ListApprovalSubstitutesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "person": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "substitute": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "startsOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "endsOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "ended": {
            "$ref": "#/components/schemas/Retired"
          },
          "state": {
            "type": "string",
            "enum": [
              "UPCOMING",
              "LIVE",
              "PAST",
              "ENDED"
            ]
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "person",
          "substitute",
          "startsOn",
          "endsOn",
          "note",
          "createdBy",
          "createdAt",
          "ended",
          "state",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "ListCustomObjectTypesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "singularLabel": {
            "type": "string"
          },
          "pluralLabel": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "numberPrefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "liveFieldCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "recordCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "updatedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "key",
          "singularLabel",
          "pluralLabel",
          "description",
          "numberPrefix",
          "position",
          "liveFieldCount",
          "recordCount",
          "archivedAt",
          "archivedBy",
          "createdBy",
          "createdAt",
          "updatedBy",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ListCustomRecordsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "objectKey": {
            "type": "string"
          },
          "number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "displayNumber": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "values": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "updatedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "objectKey",
          "number",
          "displayNumber",
          "name",
          "values",
          "revision",
          "archivedAt",
          "archivedBy",
          "createdBy",
          "createdAt",
          "updatedBy",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ListHeldOutboundResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "mail",
              "payment-rail",
              "payment-collect",
              "bank-file",
              "cra-filing",
              "provider-config",
              "books-export",
              "webhook",
              "warehouse"
            ]
          },
          "sender": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "recipients": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "name",
                "sizeBytes"
              ],
              "additionalProperties": false
            }
          },
          "text": {
            "type": "string",
            "maxLength": 2000
          },
          "truncated": {
            "type": "boolean"
          },
          "heldAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "kind",
          "sender",
          "subject",
          "recipients",
          "attachments",
          "text",
          "truncated",
          "heldAt"
        ],
        "additionalProperties": false
      },
      "ListInboundDomainsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "VERIFIED",
              "DEGRADED",
              "REMOVED"
            ]
          },
          "records": {
            "minItems": 2,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "MX",
                    "TXT"
                  ]
                },
                "host": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "priority": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "FOUND",
                    "MISSING",
                    "DIFFERENT",
                    "BLOCKED"
                  ]
                },
                "found": {
                  "maxItems": 5,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              },
              "required": [
                "kind",
                "host",
                "label",
                "value",
                "priority",
                "state",
                "found"
              ],
              "additionalProperties": false
            }
          },
          "findings": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "NO_MX",
                "MX_ELSEWHERE",
                "CNAME_AT_NAME",
                "NO_PROOF",
                "PROOF_WRONG",
                "DOUBLED_SUFFIX",
                "PROVISION_FAILED"
              ]
            }
          },
          "dnsHost": {
            "type": "object",
            "properties": {
              "key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": "string"
              },
              "wantsBareLabel": {
                "type": "boolean"
              },
              "where": {
                "type": "string"
              }
            },
            "required": [
              "key",
              "label",
              "wantsBareLabel",
              "where"
            ],
            "additionalProperties": false
          },
          "verifiedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "lastCheckedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "degradedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "removed": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "by": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "reason": {
                    "type": "string"
                  },
                  "expired": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "at",
                  "by",
                  "reason",
                  "expired"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "liveAddresses": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "entityId",
          "entityName",
          "domain",
          "zone",
          "status",
          "records",
          "findings",
          "dnsHost",
          "verifiedAt",
          "lastCheckedAt",
          "degradedAt",
          "createdAt",
          "createdBy",
          "expiresAt",
          "removed",
          "liveAddresses",
          "lastError"
        ],
        "additionalProperties": false
      },
      "ListRecordsDestructionPermissionsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "craReference": {
            "type": "string"
          },
          "grantedOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "covers": {
            "type": "string"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "displayName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "document": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "fileName"
            ],
            "additionalProperties": false
          },
          "recordedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "recordedAt": {
            "type": "string",
            "minLength": 20
          },
          "voidedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "voidedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "voidReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "usedByRequests": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "craReference",
          "grantedOn",
          "covers",
          "vendor",
          "document",
          "recordedBy",
          "recordedAt",
          "voidedAt",
          "voidedBy",
          "voidReason",
          "usedByRequests",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "ListRulesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sourceText": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ROUTING",
              "CODING",
              "AUTO_APPROVAL",
              "HOLD",
              "MATCH_TOLERANCE",
              "LINE_PROFILE",
              "RUN_PREPARE"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "PROPOSED",
              "ACTIVE",
              "DISCARDED",
              "RETIRED"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "WRITTEN",
              "LEARNED"
            ]
          },
          "entityId": {
            "type": [
              "string",
              "null"
            ]
          },
          "entityName": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "isAutoApproval": {
            "type": "boolean"
          },
          "rule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RuleOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "interpretation": {
            "type": "string"
          },
          "authorName": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "sourceEntryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceEntryRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "supersedesId": {
            "type": [
              "string",
              "null"
            ]
          },
          "firingCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "toleranceUsedMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "toleranceTotalCapMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "vendor": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "id",
                  "displayName",
                  "archived"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "fillStats": {
            "default": null,
            "anyOf": [
              {
                "$ref": "#/components/schemas/FillStatsOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "runPolicy": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "financialAccountId": {
                    "type": "string"
                  },
                  "accountName": {
                    "type": "string"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "EFT",
                      "CHEQUE",
                      "WIRE"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "perBillCapMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "weekCapMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "weekUsedMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "maxBills": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  },
                  "weekday": {
                    "type": "string",
                    "enum": [
                      "MON",
                      "TUE",
                      "WED",
                      "THU",
                      "FRI",
                      "SAT",
                      "SUN"
                    ]
                  },
                  "payInDays": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "nextPassOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nextPassState": {
                    "type": "string",
                    "enum": [
                      "SCHEDULED",
                      "PAUSED",
                      "NOT_LIVE"
                    ]
                  },
                  "pausedUntil": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastPass": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "firedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "outcome": {
                            "type": "string"
                          },
                          "runId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "firedAt",
                          "outcome",
                          "runId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "openDeclines": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "replacesRuleId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "entityTimeZone": {
                    "type": "string"
                  }
                },
                "required": [
                  "financialAccountId",
                  "accountName",
                  "method",
                  "currency",
                  "perBillCapMinor",
                  "weekCapMinor",
                  "weekUsedMinor",
                  "maxBills",
                  "weekday",
                  "payInDays",
                  "nextPassOn",
                  "nextPassState",
                  "pausedUntil",
                  "lastPass",
                  "openDeclines",
                  "replacesRuleId",
                  "entityTimeZone"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "lastFiredAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "authorMayApprove": {
            "type": "boolean"
          },
          "subject": {
            "type": "string",
            "enum": [
              "ENTRY",
              "BILL",
              "VENDOR",
              "RUN",
              "INVOICE"
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "expired": {
            "type": "boolean"
          },
          "desk": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "first": {
                    "$ref": "#/components/schemas/Desk"
                  },
                  "second": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Desk"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "previewId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "first",
                  "second",
                  "previewId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "readerIsAuthor": {
            "type": "boolean"
          },
          "holdingNow": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "sourceText",
          "kind",
          "status",
          "origin",
          "entityId",
          "entityName",
          "version",
          "isAutoApproval",
          "rule",
          "interpretation",
          "authorName",
          "createdAt",
          "sourceEntryId",
          "sourceEntryRef",
          "supersedesId",
          "firingCount",
          "toleranceUsedMinor",
          "toleranceTotalCapMinor",
          "vendor",
          "fillStats",
          "runPolicy",
          "lastFiredAt",
          "authorMayApprove",
          "subject",
          "expiresAt",
          "expired",
          "desk",
          "readerIsAuthor",
          "holdingNow"
        ],
        "additionalProperties": false
      },
      "ListValidationRulesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "recordKind": {
            "type": "string",
            "enum": [
              "CUSTOMER",
              "INVOICE",
              "CREDIT_MEMO",
              "PRODUCT",
              "CONTRACT",
              "VENDOR",
              "BILL",
              "PURCHASE_ORDER",
              "JOURNAL_ENTRY",
              "CUSTOM_OBJECT",
              "LINE"
            ]
          },
          "objectKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineKind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PURCHASE_ORDER_LINE",
                  "GOODS_RECEIPT_LINE",
                  "BILL_LINE",
                  "VENDOR_CREDIT_LINE",
                  "INVOICE_LINE",
                  "CREDIT_MEMO_LINE",
                  "JOURNAL_LINE"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "$ref": "#/components/schemas/Condition"
          },
          "summary": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "fieldKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "needsAttention": {
            "type": "boolean"
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "archivedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "updatedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "recordKind",
          "objectKey",
          "lineKind",
          "name",
          "description",
          "condition",
          "summary",
          "message",
          "fieldKey",
          "position",
          "needsAttention",
          "archivedAt",
          "archivedBy",
          "createdBy",
          "createdAt",
          "updatedBy",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ListWarehouseDestinationsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{1,31}$"
          },
          "kindLabel": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "provisioning",
              "awaiting-access",
              "active",
              "paused",
              "removed"
            ]
          },
          "target": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "fields": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^[a-zA-Z][a-zA-Z0-9]{0,31}$"
                },
                "additionalProperties": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                }
              }
            },
            "required": [
              "label",
              "fields"
            ],
            "additionalProperties": false
          },
          "options": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-zA-Z][a-zA-Z0-9]{0,31}$"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 255
                },
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "verificationLabel": {
            "type": "string"
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "inCanada": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "residencyAcknowledged": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "byName": {
                    "type": "string"
                  }
                },
                "required": [
                  "at",
                  "byName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "credential": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "fingerprint": {
                    "type": "string"
                  },
                  "rotating": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "fingerprint",
                  "rotating"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "pauseAfterHours": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "pause": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "manual",
                      "failing"
                    ]
                  },
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "byName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "reason",
                  "at",
                  "byName",
                  "note"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "failing": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "since": {
                    "type": "string",
                    "minLength": 20
                  },
                  "code": {
                    "type": "string",
                    "enum": [
                      "access_denied",
                      "target_unverified",
                      "target_not_found",
                      "schema_conflict",
                      "quota",
                      "transient",
                      "internal"
                    ]
                  },
                  "remedy": {
                    "type": "string"
                  },
                  "nextAttemptAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "since",
                  "code",
                  "remedy",
                  "nextAttemptAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "lastSuccessAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "lastTest": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "ok": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "at",
                  "ok"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "sync": {
            "type": "object",
            "properties": {
              "position": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,18})$"
              },
              "ledgerPosition": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,18})$"
              },
              "behindBy": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "oldestWaitingAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "backfill": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "jobId": {
                        "type": "string"
                      },
                      "done": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "total": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "jobId",
                      "done",
                      "total"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "position",
              "ledgerPosition",
              "behindBy",
              "oldestWaitingAt",
              "backfill"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "createdByName": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "kindLabel",
          "state",
          "target",
          "options",
          "verificationLabel",
          "location",
          "inCanada",
          "residencyAcknowledged",
          "credential",
          "pauseAfterHours",
          "pause",
          "failing",
          "lastSuccessAt",
          "lastTest",
          "sync",
          "createdAt",
          "createdByName"
        ],
        "additionalProperties": false
      },
      "ListWorkflowRunsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workflow": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "name",
              "version"
            ],
            "additionalProperties": false
          },
          "kind": {
            "type": "string",
            "enum": [
              "APPROVAL",
              "AUTOMATION"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ROUTED",
              "QUEUED",
              "RUNNING",
              "SUCCEEDED",
              "PROPOSED",
              "FAILED",
              "SKIPPED",
              "CAPPED",
              "LOOP_STOPPED",
              "CANCELLED",
              "REFUSED"
            ]
          },
          "target": {
            "$ref": "#/components/schemas/Target2"
          },
          "depth": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "parentRunId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sentence": {
            "type": "string"
          },
          "cappedCount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "jobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "traceId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "position": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "label": {
                  "type": "string"
                },
                "operation": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "PENDING",
                    "SUCCEEDED",
                    "PROPOSED",
                    "FAILED",
                    "SKIPPED"
                  ]
                },
                "record": {
                  "$ref": "#/components/schemas/Target2"
                },
                "proposalId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "error": {
                  "$ref": "#/components/schemas/Refusal"
                }
              },
              "required": [
                "position",
                "label",
                "operation",
                "status",
                "record",
                "proposalId",
                "error"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "workflow",
          "kind",
          "status",
          "target",
          "depth",
          "parentRunId",
          "sentence",
          "cappedCount",
          "jobId",
          "traceId",
          "createdAt",
          "finishedAt"
        ],
        "additionalProperties": false
      },
      "ListWorkflowsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "APPROVAL",
              "AUTOMATION"
            ]
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "BILL",
                  "INVOICE",
                  "PURCHASE_ORDER"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "PAUSED",
              "EXPIRED",
              "RETIRED"
            ]
          },
          "pauseReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PERSON",
                  "OWNER_GONE",
                  "LOOP"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "position": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "owner": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "$ref": "#/components/schemas/Active"
          },
          "draft": {
            "$ref": "#/components/schemas/Active"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "runsToday": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "lastRunAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "may": {
            "type": "object",
            "properties": {
              "edit": {
                "type": "boolean"
              },
              "activate": {
                "type": "boolean"
              },
              "pause": {
                "type": "boolean"
              },
              "resume": {
                "type": "boolean"
              },
              "retire": {
                "type": "boolean"
              }
            },
            "required": [
              "edit",
              "activate",
              "pause",
              "resume",
              "retire"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "kind",
          "subject",
          "status",
          "pauseReason",
          "position",
          "owner",
          "active",
          "draft",
          "expiresAt",
          "runsToday",
          "lastRunAt",
          "may"
        ],
        "additionalProperties": false
      },
      "Mark": {
        "type": "object",
        "properties": {
          "importId": {
            "type": "string"
          },
          "lineNumber": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "documentId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "fileSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "sourceSystem": {
            "type": "string",
            "enum": [
              "QUICKBOOKS_ONLINE",
              "QUICKBOOKS_DESKTOP",
              "XERO",
              "SAGE_50",
              "SPREADSHEET",
              "OTHER"
            ]
          },
          "sourceSystemLabel": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "uploadedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "approvedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "approvedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "importId",
          "lineNumber",
          "documentId",
          "fileName",
          "fileSha256",
          "sourceSystem",
          "sourceSystemLabel",
          "sourceRef",
          "uploadedBy",
          "approvedBy",
          "approvedAt"
        ],
        "additionalProperties": false
      },
      "Params": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string",
                  "const": "constant"
                },
                "value": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                }
              },
              "required": [
                "from",
                "value"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string",
                  "const": "record"
                },
                "field": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                }
              },
              "required": [
                "from",
                "field"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "PreviewOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "considered": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "matched": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "from": {
            "type": "string",
            "minLength": 20
          },
          "to": {
            "type": "string",
            "minLength": 20
          },
          "examples": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ref": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "href": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "outcome": {
                  "type": "string"
                }
              },
              "required": [
                "ref",
                "label",
                "href",
                "outcome"
              ],
              "additionalProperties": false
            }
          },
          "takenAt": {
            "type": "string",
            "minLength": 20
          },
          "fresh": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "considered",
          "matched",
          "from",
          "to",
          "examples",
          "takenAt",
          "fresh"
        ],
        "additionalProperties": false
      },
      "PreviewRuleResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ruleId": {
            "type": "string"
          },
          "ruleVersion": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "consideredCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "matchedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "skippedForCurrency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "largestMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string"
          },
          "matched": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entryId": {
                  "type": "string"
                },
                "entryRef": {
                  "type": "string"
                },
                "entryDate": {
                  "type": "string"
                },
                "memo": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "amountMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "entryId",
                "entryRef",
                "entryDate",
                "memo",
                "amountMinor",
                "currency"
              ],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "subject": {
            "default": "ENTRY",
            "type": "string",
            "enum": [
              "ENTRY",
              "BILL",
              "VENDOR",
              "RUN",
              "INVOICE"
            ]
          },
          "billMatched": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "supplierName": {
                  "type": "string"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "totalMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "currency": {
                  "type": "string"
                },
                "effect": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "desk": {
                          "$ref": "#/components/schemas/Desk"
                        },
                        "stageCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 2
                        }
                      },
                      "required": [
                        "desk",
                        "stageCount"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "hold": {
                          "type": "boolean",
                          "const": true
                        },
                        "capReached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "hold",
                        "capReached"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "billId",
                "revision",
                "supplierName",
                "number",
                "totalMinor",
                "currency",
                "effect"
              ],
              "additionalProperties": false
            }
          },
          "toleranceMatched": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "supplierName": {
                  "type": "string"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "currency": {
                  "type": "string"
                },
                "totalMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "tolerated": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "PO_PRICE_VARIANCE",
                          "PO_QUANTITY_VARIANCE",
                          "PO_OVER_BILLED",
                          "PO_NOT_RECEIVED"
                        ]
                      },
                      "line": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "valueMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "bp": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "code",
                      "line",
                      "valueMinor",
                      "bp"
                    ],
                    "additionalProperties": false
                  }
                },
                "capReached": {
                  "type": "boolean"
                }
              },
              "required": [
                "billId",
                "revision",
                "supplierName",
                "number",
                "currency",
                "totalMinor",
                "tolerated",
                "capReached"
              ],
              "additionalProperties": false
            }
          },
          "cut": {
            "default": false,
            "type": "boolean"
          },
          "profileMatched": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "billDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "filled": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "agrees": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "differs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "position": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "field": {
                        "type": "string"
                      },
                      "profile": {
                        "type": "string"
                      },
                      "approved": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "position",
                      "field",
                      "profile",
                      "approved"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "billId",
                "number",
                "billDate",
                "filled",
                "agrees",
                "differs"
              ],
              "additionalProperties": false
            }
          },
          "runWeeks": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "weekStart": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "passOn": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "consideredCount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "cut": {
                  "type": "boolean"
                },
                "takenCount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "takenAppliedMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "takenCashMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "lines": {
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LinesItem2"
                  }
                }
              },
              "required": [
                "weekStart",
                "passOn",
                "consideredCount",
                "cut",
                "takenCount",
                "takenAppliedMinor",
                "takenCashMinor",
                "lines"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "ruleId",
          "ruleVersion",
          "consideredCount",
          "matchedCount",
          "skippedForCurrency",
          "totalMinor",
          "largestMinor",
          "currency",
          "matched",
          "createdAt",
          "expiresAt",
          "subject",
          "billMatched",
          "toleranceMatched",
          "cut",
          "profileMatched",
          "runWeeks"
        ],
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "$ref": "#/components/schemas/Code"
          },
          "requestId": {
            "type": [
              "string",
              "null"
            ]
          },
          "fields": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "remedy": {
            "type": "string"
          },
          "maxBytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code"
        ],
        "additionalProperties": false
      },
      "Record": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "AUDIT_LINE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "actorName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actorEmail": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "action": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "targetDescription": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "before": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "after": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "zoneAssumed": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "actorName",
                  "actorEmail",
                  "action",
                  "targetDescription",
                  "amountMinor",
                  "currency",
                  "before",
                  "after",
                  "note",
                  "zoneAssumed"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "CONTROL_FIRING"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "controlName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "AUTO_APPROVED",
                      "ROUTED",
                      "REFUSED",
                      "CHANGED"
                    ]
                  },
                  "subjectRef": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actorName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "controlName",
                  "outcome",
                  "subjectRef",
                  "amountMinor",
                  "currency",
                  "actorName",
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "PERIOD_LOCK"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "lockedThrough": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "scope": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subledger": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lockedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lockedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unlockedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unlockedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "lockedThrough",
                  "scope",
                  "subledger",
                  "lockedByName",
                  "lockedOn",
                  "unlockedOn",
                  "unlockedByName",
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "REPORT_PACK"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "statusAsIssued": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "issuedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "issuedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "title",
                  "statusAsIssued",
                  "issuedOn",
                  "issuedByName"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "SLIP_FILE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "T4A",
                      "T5018"
                    ]
                  },
                  "taxYear": {
                    "type": "integer",
                    "minimum": 1900,
                    "maximum": 2200
                  },
                  "periodEnd": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "slipCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000
                  },
                  "totalMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "reportType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "ORIGINAL",
                          "AMENDMENT"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "filedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "confirmationNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "taxYear",
                  "periodEnd",
                  "slipCount",
                  "totalMinor",
                  "reportType",
                  "filedOn",
                  "confirmationNumber"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "FX_RATE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "base": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "quote": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "rate": {
                    "type": "string",
                    "pattern": "^\\d{1,6}\\.\\d{6}$"
                  },
                  "rateSourceAsNamed": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "base",
                  "quote",
                  "rate",
                  "rateSourceAsNamed",
                  "note"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "SCHEDULE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "templateType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "intervalText": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "interval": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "unit": {
                            "type": "string",
                            "enum": [
                              "DAY",
                              "WEEK",
                              "MONTH",
                              "YEAR"
                            ]
                          },
                          "every": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 366
                          }
                        },
                        "required": [
                          "unit",
                          "every"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "previousDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nextDateInSource": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "counterpartyName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "activeInSource": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "templateType",
                  "intervalText",
                  "interval",
                  "previousDate",
                  "nextDateInSource",
                  "endDate",
                  "counterpartyName",
                  "amountMinor",
                  "currency",
                  "activeInSource"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "QUEUE_DECISION"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "recordType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "APPROVED",
                      "DECLINED"
                    ]
                  },
                  "decidedByName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "submittedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "recordType",
                  "reference",
                  "decision",
                  "decidedByName",
                  "submittedByName",
                  "amountMinor",
                  "currency",
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "TAX_OVERRIDE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "engineOrDefaultTreatment": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "chosenTreatment": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "taxAmountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "registrationNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "overriddenByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "reference",
                  "engineOrDefaultTreatment",
                  "chosenTreatment",
                  "reason",
                  "taxAmountMinor",
                  "currency",
                  "registrationNumber",
                  "overriddenByName"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "PAID_BILL"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "supplierName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dueDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paidOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "subtotalMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "taxMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "totalMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "functionalTotalMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paymentMethod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paymentReference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "supplierName",
                  "number",
                  "dueDate",
                  "paidOn",
                  "currency",
                  "subtotalMinor",
                  "taxMinor",
                  "totalMinor",
                  "functionalTotalMinor",
                  "paymentMethod",
                  "paymentReference",
                  "memo"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "VENDOR_PAYMENT"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "supplierName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "amountMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "method": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paidFromAccountName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billsAppliedText": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "supplierName",
                  "currency",
                  "amountMinor",
                  "method",
                  "reference",
                  "paidFromAccountName",
                  "billsAppliedText",
                  "memo"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Reference": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "target": {
                "type": "string",
                "enum": [
                  "CUSTOMER",
                  "VENDOR",
                  "PRODUCT",
                  "CONTRACT",
                  "ACCOUNT",
                  "ENTITY",
                  "PERSON",
                  "DIMENSION_VALUE",
                  "CUSTOM_RECORD"
                ]
              },
              "objectKey": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "dimensionCode": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "target",
              "objectKey",
              "dimensionCode"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Refusal": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "remedy": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "remedy"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "RequestTestCopyRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "make",
              "refresh"
            ]
          },
          "maskContacts": {
            "type": "boolean"
          },
          "soleAdministrator": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "minLength": 10,
                "maxLength": 500
              }
            },
            "required": [
              "reason"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "mode"
        ],
        "additionalProperties": false
      },
      "Retired": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "by",
              "at",
              "reason"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "RuleOption1": {
        "type": "object",
        "properties": {
          "when": {
            "type": "object",
            "properties": {
              "amountMinorAtLeast": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "amountMinorBelow": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "amountCurrency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "sourceKinds": {
                "minItems": 1,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "MANUAL",
                    "AGENT_PROPOSAL",
                    "RECURRING",
                    "REVERSAL",
                    "IMPORT",
                    "CHAT",
                    "MIGRATION",
                    "PAYMENT_RUN",
                    "INVOICE",
                    "RECEIPT",
                    "BILL",
                    "BILL_SETTLEMENT",
                    "VENDOR_CREDIT"
                  ]
                }
              },
              "accountCode": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32
              },
              "memoContains": {
                "type": "string",
                "minLength": 2,
                "maxLength": 120
              },
              "missingDimension": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "vendorId": {
                "type": "string",
                "minLength": 1
              },
              "newVendor": {
                "type": "boolean",
                "const": true
              },
              "dimensionValueId": {
                "type": "string",
                "minLength": 1
              },
              "billSources": {
                "minItems": 1,
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "INBOX_DOCUMENT",
                    "MANUAL",
                    "IMPORT",
                    "RECURRING",
                    "CONVERSION"
                  ]
                }
              },
              "vendorPaperNotCurrent": {
                "minItems": 1,
                "maxItems": 8,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "WSIB_CLEARANCE",
                    "INSURANCE_CERTIFICATE",
                    "MASTER_AGREEMENT",
                    "W8BEN",
                    "DIRECT_DEPOSIT_FORM",
                    "WITHHOLDING_WAIVER",
                    "OTHER"
                  ]
                }
              },
              "overBudget": {
                "type": "boolean",
                "const": true
              },
              "orderException": {
                "type": "boolean",
                "const": true
              },
              "customerId": {
                "type": "string",
                "minLength": 1
              },
              "departmentValueId": {
                "type": "string",
                "minLength": 1
              },
              "dueWithinDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 60
              },
              "discountLapsesWithinDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30
              },
              "vendorIds": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "exceptVendorIds": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "additionalProperties": false
          },
          "then": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "route": {
                    "type": "string",
                    "enum": [
                      "BOOKKEEPER",
                      "SENIOR",
                      "CONTROLLER"
                    ]
                  }
                },
                "required": [
                  "route"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "object",
                    "properties": {
                      "accountCode": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 32
                      },
                      "note": {
                        "type": "string",
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "accountCode"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "code"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "autoApprove": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "autoApprove"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "hold": {
                    "type": "object",
                    "properties": {
                      "maxOpen": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 500
                      }
                    },
                    "required": [
                      "maxOpen"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "hold"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "tolerate": {
                    "type": "object",
                    "properties": {
                      "priceBp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      },
                      "quantityBp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      },
                      "capMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "totalCapMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      }
                    },
                    "required": [
                      "priceBp",
                      "quantityBp",
                      "capMinor",
                      "totalCapMinor",
                      "currency"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "tolerate"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "fill": {
                    "type": "object",
                    "properties": {
                      "account": {
                        "type": "object",
                        "properties": {
                          "accountCode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 32
                          }
                        },
                        "required": [
                          "accountCode"
                        ],
                        "additionalProperties": false
                      },
                      "supplyCategory": {
                        "type": "string",
                        "enum": [
                          "GOODS",
                          "SERVICES",
                          "INTANGIBLE_PROPERTY",
                          "REAL_PROPERTY"
                        ]
                      },
                      "itcKind": {
                        "type": "string",
                        "enum": [
                          "GENERAL",
                          "MEALS_ENTERTAINMENT",
                          "PASSENGER_VEHICLE",
                          "ZERO_EMISSION_VEHICLE",
                          "EXEMPT_ACTIVITY",
                          "NONE"
                        ]
                      },
                      "commercialUsePct": {
                        "type": "string",
                        "pattern": "^0(?:\\.\\d{1,4})?$"
                      },
                      "provincialServiceKind": {
                        "type": "string",
                        "enum": [
                          "ACCOUNTING",
                          "ARCHITECTURAL_OR_ENGINEERING",
                          "SECURITY",
                          "NON_RESIDENTIAL_REAL_ESTATE",
                          "ADVERTISING",
                          "ACCOMMODATION"
                        ]
                      },
                      "propertyRegion": {
                        "type": "string",
                        "enum": [
                          "CA-AB",
                          "CA-BC",
                          "CA-MB",
                          "CA-NB",
                          "CA-NL",
                          "CA-NS",
                          "CA-NT",
                          "CA-NU",
                          "CA-ON",
                          "CA-PE",
                          "CA-QC",
                          "CA-SK",
                          "CA-YT"
                        ]
                      },
                      "dimensions": {
                        "minItems": 1,
                        "maxItems": 8,
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/DimensionsItem"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "fill"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/components/schemas/ThenOption7"
              }
            ]
          }
        },
        "required": [
          "when",
          "then"
        ],
        "additionalProperties": false
      },
      "SetCustomFieldValuesRequest": {
        "type": "object",
        "properties": {
          "customFields": {
            "$ref": "#/components/schemas/CustomFields6"
          }
        },
        "required": [
          "customFields"
        ],
        "additionalProperties": false
      },
      "SkipReasonOption1": {
        "type": "string",
        "enum": [
          "BILL_HELD",
          "NO_VENDOR",
          "VENDOR_ARCHIVED",
          "VENDOR_HELD",
          "VENDOR_NOT_ACCEPTED",
          "NO_BANKING",
          "BANKING_PENDING",
          "BANKING_RETURNED",
          "BANKING_FOREIGN",
          "IN_RUN",
          "CURRENCY_DIFFERS",
          "PLANNED_LATER",
          "DECLINED_RECENTLY",
          "OPEN_SIGNAL",
          "CREDIT_AVAILABLE",
          "WITHHOLDING_REVIEW",
          "PER_BILL_CAP",
          "MAX_BILLS",
          "WEEK_CAP",
          "NEW_PAYEE",
          "ABOVE_HISTORICAL_MAX",
          "REFUSED_AT_PREPARE"
        ]
      },
      "Target2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "href": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "id",
              "label",
              "href"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "TestCopy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "current": {
            "$ref": "#/components/schemas/Current2"
          },
          "pending": {
            "$ref": "#/components/schemas/Current2"
          },
          "state": {
            "type": "string",
            "enum": [
              "MAKING",
              "READY",
              "REFRESHING",
              "REFRESH_READY",
              "FAILED",
              "DELETED"
            ]
          },
          "maskContacts": {
            "type": "boolean"
          },
          "deletedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "purgeAfter": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "notCarriedOnSwitch": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "kind",
                "label"
              ],
              "additionalProperties": false
            }
          },
          "may": {
            "type": "object",
            "properties": {
              "refresh": {
                "type": "boolean"
              },
              "switch": {
                "type": "boolean"
              },
              "discard": {
                "type": "boolean"
              },
              "delete": {
                "type": "boolean"
              },
              "promote": {
                "type": "boolean"
              }
            },
            "required": [
              "refresh",
              "switch",
              "discard",
              "delete",
              "promote"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "source",
          "current",
          "pending",
          "state",
          "maskContacts",
          "deletedAt",
          "purgeAfter",
          "notCarriedOnSwitch",
          "may"
        ],
        "additionalProperties": false
      },
      "ThenOption7": {
        "type": "object",
        "properties": {
          "prepare": {
            "type": "object",
            "properties": {
              "financialAccountId": {
                "type": "string",
                "minLength": 1
              },
              "method": {
                "type": "string",
                "enum": [
                  "EFT",
                  "CHEQUE",
                  "WIRE"
                ]
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "perBillCapMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "weekCapMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "maxBills": {
                "type": "integer",
                "minimum": 1,
                "maximum": 200
              },
              "weekday": {
                "type": "string",
                "enum": [
                  "MON",
                  "TUE",
                  "WED",
                  "THU",
                  "FRI",
                  "SAT",
                  "SUN"
                ]
              },
              "payInDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 14
              }
            },
            "required": [
              "financialAccountId",
              "method",
              "currency",
              "perBillCapMinor",
              "weekCapMinor",
              "maxBills",
              "weekday",
              "payInDays"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "prepare"
        ],
        "additionalProperties": false
      },
      "Totals": {
        "type": "object",
        "properties": {
          "native": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "imported": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "native",
          "imported"
        ],
        "additionalProperties": false
      },
      "UndoAgentBatchResponse": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "const": "job_started"
          },
          "job": {
            "$ref": "#/components/schemas/Job"
          },
          "existing": {
            "type": "boolean"
          }
        },
        "required": [
          "outcome",
          "job",
          "existing"
        ],
        "additionalProperties": false
      },
      "Vendor": {
        "default": null,
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "placement": {
                "type": "string",
                "enum": [
                  "NAME",
                  "ALIAS"
                ]
              }
            },
            "required": [
              "id",
              "displayName",
              "placement"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "responses": {
      "Problem400": {
        "description": "The request has no Idempotency-Key header.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem401": {
        "description": "The key or token is missing, malformed, unknown, revoked or expired.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem403": {
        "description": "The key or token may not do this, or the books are closed to the API.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem404": {
        "description": "There is no such record on these books.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem409": {
        "description": "An identical request is still running, or another change reached the record first.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem412": {
        "description": "The books refuse this in their current state. The problem body says what to change.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem422": {
        "description": "A field is invalid or cannot be set through the API, or the Idempotency-Key was reused for a different request.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem429": {
        "description": "Too many requests. Wait the number of seconds in Retry-After.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem500": {
        "description": "A fault on our side. Quote the X-Request-Id when you write to us.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "A new value for each new request (a UUID is fine), the same value when you retry it. Kept for 7 days.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "headers": {
      "XRequestId": {
        "description": "Quote this when you write to us about the call.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitPolicy": {
        "description": "The quota and window of this class of call, for example \"reads\";q=300;w=60.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "What is left of the quota and when it resets, for example \"reads\";r=250;t=30.",
        "schema": {
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before sending the same request again.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "LedgerPosition": {
        "description": "The position in the ledger's event log after this write. Pass it to listEvents as startPosition to read what followed.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{1,19}$"
        }
      },
      "Location": {
        "description": "Where to read the record that was created, or the page where a person confirms the act.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}
