{
  "openapi": "3.1.1",
  "info": {
    "title": "Eternify Ledger API: Documents",
    "version": "v1",
    "x-wire-version": "2026-08-31",
    "description": "Files, attachments and document intake. 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": "documents",
      "description": "Files, attachments and document intake.",
      "x-display-name": "Documents"
    }
  ],
  "paths": {
    "/v1/document-search": {
      "post": {
        "operationId": "searchDocuments",
        "summary": "Finds passages in the ledger's documents, emails, record text and guides, each cited by document, page and span.",
        "description": "Finds passages in the ledger's documents, emails, record text and guides, each cited by document, page and span. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:read",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "limit": {
                    "default": 10,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20
                  },
                  "atLeast": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "candidates": {
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 150
                  },
                  "filters": {
                    "type": "object",
                    "properties": {
                      "sourceKinds": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "document",
                            "inbound-email",
                            "record",
                            "guide"
                          ]
                        }
                      },
                      "documentKinds": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Kind7"
                        }
                      },
                      "documentIds": {
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "recordTypes": {
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "vendorId": {
                        "type": "string"
                      },
                      "customerId": {
                        "type": "string"
                      },
                      "dateFrom": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "dateTo": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "languages": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "en",
                            "fr"
                          ]
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "query"
                ],
                "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": {
                    "passages": {
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PassagesItem"
                      }
                    },
                    "capped": {
                      "type": "boolean",
                      "const": true
                    },
                    "limit": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "confident": {
                      "type": "boolean"
                    },
                    "meaningSearch": {
                      "type": "string",
                      "enum": [
                        "on",
                        "off"
                      ]
                    },
                    "reranked": {
                      "type": "boolean"
                    },
                    "guardrail": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "erasure_request"
                            },
                            "message": {
                              "type": "string"
                            },
                            "address": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "kind",
                            "message",
                            "address"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "asOf": {
                      "type": "object",
                      "properties": {
                        "position": {
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,18})$"
                        },
                        "ledgerPosition": {
                          "type": "string",
                          "pattern": "^(0|[1-9]\\d{0,18})$"
                        },
                        "freshness": {
                          "type": "string",
                          "enum": [
                            "current",
                            "behind",
                            "held"
                          ]
                        },
                        "waitingSources": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "waiting": {
                          "maxItems": 5,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sourceId": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "sourceId",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "position",
                        "ledgerPosition",
                        "freshness",
                        "waitingSources",
                        "waiting"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "passages",
                    "capped",
                    "limit",
                    "confident",
                    "meaningSearch",
                    "reranked",
                    "guardrail",
                    "asOf"
                  ],
                  "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/document-search/documents/{documentId}": {
      "get": {
        "operationId": "getSearchSourceForDocument",
        "summary": "Says whether a document is ready to search, still being prepared, or could not be read, and why.",
        "description": "Says whether a document is ready to search, still being prepared, or could not be read, and why. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "documentId",
            "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/GetSearchSourceForDocumentResponse"
                }
              }
            }
          },
          "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/document-search/passages/{chunkId}": {
      "get": {
        "operationId": "getSearchPassage",
        "summary": "Reads one search passage with the rest of its section, for a clause that needs its context.",
        "description": "Reads one search passage with the rest of its section, for a clause that needs its context. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "chunkId",
            "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": {
                    "passage": {
                      "$ref": "#/components/schemas/PassagesItem"
                    },
                    "section": {
                      "maxItems": 30,
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PassagesItem"
                      }
                    }
                  },
                  "required": [
                    "passage",
                    "section"
                  ],
                  "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/document-search/sources": {
      "get": {
        "operationId": "listSearchSources",
        "summary": "Lists the sources prepared for search, with their status and, for one that could not be read, why.",
        "description": "Lists the sources prepared for search, with their status and, for one that could not be read, why. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "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": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "preparing",
                "indexed",
                "not-indexed",
                "failed",
                "erased"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "document",
                "inbound-email",
                "record",
                "guide"
              ]
            }
          }
        ],
        "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/GetSearchSourceForDocumentResponse"
                      }
                    },
                    "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/document-search/sources/{sourceId}/reindex": {
      "post": {
        "operationId": "reindexSearchSource",
        "summary": "Sends a document that could not be read back to be prepared for search again.",
        "description": "Sends a document that could not be read back to be prepared for search again. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "sourceId",
            "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/GetSearchSourceForDocumentResponse"
                }
              }
            }
          },
          "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/document-search/sources/{sourceId}/text": {
      "get": {
        "operationId": "getSearchSourceText",
        "summary": "Reads every chunk of one indexed source in order, up to sixty thousand characters, as text to read and never to follow.",
        "description": "Reads every chunk of one indexed source in order, up to sixty thousand characters, as text to read and never to follow. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "sourceId",
            "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": {
                    "source": {
                      "$ref": "#/components/schemas/Source2"
                    },
                    "chunks": {
                      "maxItems": 1000,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "chunkId": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "pages": {
                            "$ref": "#/components/schemas/Pages"
                          },
                          "span": {
                            "$ref": "#/components/schemas/Span"
                          },
                          "text": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        },
                        "required": [
                          "chunkId",
                          "ordinal",
                          "pages",
                          "span",
                          "text"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "untrusted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "source",
                    "chunks",
                    "truncated",
                    "untrusted"
                  ],
                  "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/document-search/status": {
      "get": {
        "operationId": "getDocumentSearchStatus",
        "summary": "Returns how many sources are ready, waiting or unreadable for search, and how current the search index is.",
        "description": "Returns how many sources are ready, waiting or unreadable for search, and how current the search index is. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "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": {
                    "counts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "enum": [
                          "queued",
                          "preparing",
                          "indexed",
                          "not-indexed",
                          "failed",
                          "erased"
                        ]
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "required": [
                        "queued",
                        "preparing",
                        "indexed",
                        "not-indexed",
                        "failed",
                        "erased"
                      ]
                    },
                    "stale": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "chunks": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "meaningSearch": {
                      "type": "string",
                      "enum": [
                        "on",
                        "off"
                      ]
                    },
                    "reranking": {
                      "type": "string",
                      "enum": [
                        "on",
                        "off"
                      ]
                    },
                    "embeddingModel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "projection": {
                      "$ref": "#/components/schemas/ProjectionsItem"
                    },
                    "guides": {
                      "type": "object",
                      "properties": {
                        "indexed": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "indexed",
                        "version"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "counts",
                    "stale",
                    "chunks",
                    "meaningSearch",
                    "reranking",
                    "embeddingModel",
                    "projection",
                    "guides"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/documents": {
      "get": {
        "operationId": "listDocuments",
        "summary": "Lists the documents in the inbox, with the server's total.",
        "description": "Lists the documents in the inbox, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "EMAIL_INBOX",
                "UPLOAD",
                "CONNECTOR"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILL",
                "SALES_INVOICE",
                "RECORD_IMPORT"
              ]
            }
          },
          {
            "name": "became",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILL",
                "IMPORT_BATCH",
                "FLAGGED",
                "NOTHING"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "addressId",
            "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": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "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"
                          },
                          "sha256": {
                            "type": "string",
                            "minLength": 64,
                            "maxLength": 64
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "EMAIL_INBOX",
                              "UPLOAD",
                              "CONNECTOR"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "uploadedByName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "viaVendorPortal": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "submissionId": {
                                    "type": "string"
                                  },
                                  "vendorId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "submissionId",
                                  "vendorId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "extraction": {
                            "$ref": "#/components/schemas/Extraction"
                          },
                          "kind": {
                            "$ref": "#/components/schemas/Kind7"
                          },
                          "sender": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "inboundEmailId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entityId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entityName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "became": {
                            "$ref": "#/components/schemas/Became"
                          }
                        },
                        "required": [
                          "id",
                          "sha256",
                          "fileName",
                          "mimeType",
                          "sizeBytes",
                          "source",
                          "createdAt",
                          "uploadedByName",
                          "viaVendorPortal",
                          "extraction",
                          "kind",
                          "sender",
                          "inboundEmailId",
                          "address",
                          "entityId",
                          "entityName",
                          "entityTimeZone",
                          "became"
                        ],
                        "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/documents/{documentId}": {
      "get": {
        "operationId": "getDocument",
        "summary": "Returns one document with its status and where it was filed.",
        "description": "Returns one document with its status and where it was filed. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "documentId",
            "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": {
                    "id": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 64
                    },
                    "fileName": {
                      "type": "string"
                    },
                    "mimeType": {
                      "type": "string"
                    },
                    "sizeBytes": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "EMAIL_INBOX",
                        "UPLOAD",
                        "CONNECTOR"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "uploadedByName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "viaVendorPortal": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "submissionId": {
                              "type": "string"
                            },
                            "vendorId": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "submissionId",
                            "vendorId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "extraction": {
                      "$ref": "#/components/schemas/Extraction"
                    },
                    "kind": {
                      "$ref": "#/components/schemas/Kind7"
                    },
                    "sender": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inboundEmailId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "address": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "entityId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "entityName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "became": {
                      "$ref": "#/components/schemas/Became"
                    },
                    "arrivals": {
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inboundEmailId": {
                            "type": "string"
                          },
                          "receivedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "sender": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "inboundEmailId",
                          "receivedAt",
                          "sender",
                          "address"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "arrivalsTotal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "evidenceLinks": {
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "ENTRY",
                              "BILL",
                              "INVOICE",
                              "CREDIT_MEMO",
                              "CUSTOMER"
                            ]
                          },
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "id",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "evidenceTotal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "extractionNote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "sha256",
                    "fileName",
                    "mimeType",
                    "sizeBytes",
                    "source",
                    "createdAt",
                    "uploadedByName",
                    "viaVendorPortal",
                    "extraction",
                    "kind",
                    "sender",
                    "inboundEmailId",
                    "address",
                    "entityId",
                    "entityName",
                    "entityTimeZone",
                    "became",
                    "arrivals",
                    "arrivalsTotal",
                    "evidenceLinks",
                    "evidenceTotal",
                    "extractionNote"
                  ],
                  "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/documents/{documentId}/read-again": {
      "post": {
        "operationId": "readDocumentAgain",
        "summary": "Reads an inbox document again after it was corrected.",
        "description": "Reads an inbox document again after it was corrected. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "proposalId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "proposalId"
                ],
                "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": {
                    "documentId": {
                      "type": "string"
                    },
                    "proposalId": {
                      "type": "string"
                    },
                    "attempt": {
                      "type": "integer",
                      "minimum": 2,
                      "maximum": 3
                    },
                    "queued": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "documentId",
                    "proposalId",
                    "attempt",
                    "queued"
                  ],
                  "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/evidence/links/{linkId}/detach": {
      "post": {
        "operationId": "detachEvidence",
        "summary": "Detaches an evidence file from a record.",
        "description": "Detaches an evidence file from a record. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "linkId",
            "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/ListEvidenceResponseItem"
                }
              }
            }
          },
          "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/evidence/{subject}/{recordId}": {
      "get": {
        "operationId": "listEvidence",
        "summary": "Lists the evidence files attached to a record.",
        "description": "Lists the evidence files attached to a record. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "subject",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "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
            }
          },
          {
            "name": "detached",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "no",
                "all",
                "only"
              ]
            }
          }
        ],
        "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/ListEvidenceResponseItem"
                      }
                    },
                    "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": "attachEvidence",
        "summary": "Attaches an evidence file to a record.",
        "description": "Attaches an evidence file to a record. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "subject",
            "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": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "documentId"
                ],
                "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/ListEvidenceResponseItem"
                }
              }
            }
          },
          "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/export/requests": {
      "post": {
        "operationId": "requestFullExport",
        "summary": "Asks for a full export of the ledger, which a second person must approve.",
        "description": "Asks for a full export of the ledger, which a second person must approve. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string",
                        "const": "TWO_PERSON"
                      },
                      "reason": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "includeBankFiles": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "path",
                      "reason",
                      "includeBankFiles"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string",
                        "const": "SOLE_ADMIN_OWNER_OVERRIDE"
                      },
                      "reason": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "includeBankFiles": {
                        "type": "boolean"
                      },
                      "overrideReason": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      "overrideCapacity": {
                        "type": "string",
                        "enum": [
                          "OWN_ORGANIZATION",
                          "MANAGING_FIRM"
                        ]
                      }
                    },
                    "required": [
                      "path",
                      "reason",
                      "includeBankFiles",
                      "overrideReason",
                      "overrideCapacity"
                    ],
                    "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/RequestFullExportResponse"
                }
              }
            }
          },
          "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": "listFullExportRequests",
        "summary": "Lists the full export requests and where each one stands.",
        "description": "Lists the full export requests and where each one stands. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "WAITING",
                "APPROVED",
                "DOWNLOADED",
                "DECLINED",
                "WITHDRAWN",
                "EXPIRED",
                "CANCELLED"
              ]
            }
          },
          {
            "name": "mine",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "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/RequestFullExportResponseOption1"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "context": {
                      "type": "object",
                      "properties": {
                        "adminSeats": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "people": {
                              "maxItems": 20,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "count",
                            "people"
                          ],
                          "additionalProperties": false
                        },
                        "override": {
                          "type": "object",
                          "properties": {
                            "available": {
                              "type": "boolean"
                            },
                            "capacity": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "OWN_ORGANIZATION",
                                    "MANAGING_FIRM"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "available",
                            "capacity"
                          ],
                          "additionalProperties": false
                        },
                        "carries": {
                          "type": "object",
                          "properties": {
                            "tables": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "vendorsWithVerifiedBanking": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "bankFiles": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "tables",
                            "vendorsWithVerifiedBanking",
                            "bankFiles"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "adminSeats",
                        "override",
                        "carries"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "context"
                  ],
                  "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/export/requests/{requestId}/approve": {
      "post": {
        "operationId": "approveFullExport",
        "summary": "Approves a full export request so that its archive can be produced.",
        "description": "Approves a full export request so that its archive can be produced. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "includeBankFiles": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "brief": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "promptVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 60
                          },
                          "purpose": {
                            "type": "string",
                            "enum": [
                              "AUDIT_OR_REVIEW",
                              "ACCOUNTANT_HANDOVER",
                              "MOVING_TO_ANOTHER_SYSTEM",
                              "LEGAL_OR_REGULATORY",
                              "BACKUP",
                              "OFF_BOARDING",
                              "OTHER",
                              "UNCLEAR"
                            ]
                          },
                          "bankFiles": {
                            "type": "string",
                            "enum": [
                              "EXPLAINED",
                              "NOT_EXPLAINED",
                              "NOT_ASKED"
                            ]
                          },
                          "addressedToApprover": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "promptVersion",
                          "purpose",
                          "bankFiles",
                          "addressedToApprover"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "includeBankFiles"
                ],
                "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/RequestFullExportResponse"
                }
              }
            }
          },
          "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/export/requests/{requestId}/brief": {
      "post": {
        "operationId": "draftFullExportBrief",
        "summary": "Drafts the brief a person reads before approving a full export.",
        "description": "Drafts the brief a person reads before approving a full export. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "requestId",
            "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": {
                    "brief": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "purpose": {
                              "type": "string",
                              "enum": [
                                "AUDIT_OR_REVIEW",
                                "ACCOUNTANT_HANDOVER",
                                "MOVING_TO_ANOTHER_SYSTEM",
                                "LEGAL_OR_REGULATORY",
                                "BACKUP",
                                "OFF_BOARDING",
                                "OTHER",
                                "UNCLEAR"
                              ]
                            },
                            "bankFiles": {
                              "type": "string",
                              "enum": [
                                "EXPLAINED",
                                "NOT_EXPLAINED",
                                "NOT_ASKED"
                              ]
                            },
                            "addressedToApprover": {
                              "type": "boolean"
                            },
                            "summary": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "purpose",
                            "bankFiles",
                            "addressedToApprover",
                            "summary",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "type": "string",
                      "enum": [
                        "DISCLOSURE",
                        "BUDGET",
                        "PROVIDER",
                        "UNPARSABLE",
                        "REFUSED",
                        "FIGURE_INVENTED",
                        "NOT_WAITING",
                        "OWN_REQUEST"
                      ]
                    }
                  },
                  "required": [
                    "brief"
                  ],
                  "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/export/requests/{requestId}/decline": {
      "post": {
        "operationId": "declineFullExport",
        "summary": "Declines a full export request with a reason.",
        "description": "Declines a full export request with a reason. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "requestId",
            "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/RequestFullExportResponseOption1"
                }
              }
            }
          },
          "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/export/requests/{requestId}/withdraw": {
      "post": {
        "operationId": "withdrawFullExport",
        "summary": "Withdraws a full export request its requester no longer wants.",
        "description": "Withdraws a full export request its requester no longer wants. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "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/RequestFullExportResponseOption1"
                }
              }
            }
          },
          "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/imports/csv/requests": {
      "post": {
        "operationId": "requestCsvImport",
        "summary": "Asks for an uploaded CSV statement to be imported into the bank feed now, and answers the connection whose run history shows it.",
        "description": "Asks for an uploaded CSV statement to be imported into the bank feed now, and answers the connection whose run history shows it. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "mapping": {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string",
                        "minLength": 1
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1
                      },
                      "amount": {
                        "type": "string"
                      },
                      "debit": {
                        "type": "string"
                      },
                      "credit": {
                        "type": "string"
                      },
                      "counterparty": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "date",
                      "description"
                    ],
                    "additionalProperties": false
                  },
                  "currency": {
                    "default": "CAD",
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "dateFormat": {
                    "default": "iso",
                    "type": "string",
                    "enum": [
                      "iso",
                      "us",
                      "eu"
                    ]
                  },
                  "objectKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  "fileName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "financialAccountId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "required": [
                  "displayName",
                  "mapping",
                  "objectKey",
                  "fileName"
                ],
                "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": {
                  "type": "object",
                  "properties": {
                    "connectionId": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string"
                    },
                    "evidenceKey": {
                      "type": "string"
                    },
                    "requestedAt": {
                      "type": "string",
                      "minLength": 20
                    }
                  },
                  "required": [
                    "connectionId",
                    "requestId",
                    "evidenceKey",
                    "requestedAt"
                  ],
                  "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/imports/{syncRunId}/propose": {
      "post": {
        "operationId": "proposeFromImport",
        "summary": "Proposes journal entries from the rows of one import run for a person to decide.",
        "description": "Proposes journal entries from the rows of one import run for a person to decide. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "syncRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contraAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500
                  }
                },
                "required": [
                  "contraAccountId"
                ],
                "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": {
                    "proposed": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "alreadyProposed": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "remaining": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "returnedWithEntry": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "settledByPayout": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "entityId": {
                      "type": "string"
                    },
                    "entityName": {
                      "type": "string"
                    },
                    "bankAccountCode": {
                      "type": "string"
                    },
                    "contraAccountCode": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "proposed",
                    "alreadyProposed",
                    "remaining",
                    "returnedWithEntry",
                    "settledByPayout",
                    "entityId",
                    "entityName",
                    "bankAccountCode",
                    "contraAccountCode"
                  ],
                  "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/inbound-addresses": {
      "get": {
        "operationId": "listInboundAddresses",
        "summary": "Lists the inbound email addresses the ledger receives documents at.",
        "description": "Lists the inbound email addresses the ledger receives documents at. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "inboundDomainId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "onDomain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "true"
            }
          },
          {
            "name": "mailbox",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILLS",
                "INVOICES"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "REVOKED"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "watcherUserId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "watcherAccess",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "LOST"
              ]
            }
          },
          {
            "name": "hasHeld",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "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/ListInboundAddressesResponseItem"
                      }
                    },
                    "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": "createInboundAddress",
        "summary": "Creates an inbound email address for the ledger.",
        "description": "Creates an inbound email address for the ledger. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "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
                  },
                  "label": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 24,
                    "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
                  },
                  "mailbox": {
                    "default": "BILLS",
                    "type": "string",
                    "enum": [
                      "BILLS",
                      "INVOICES"
                    ]
                  },
                  "inboundDomainId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "purpose": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "watcherUserId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "watcherTelephone": {
                    "type": "string",
                    "maxLength": 40
                  }
                },
                "required": [
                  "entityId",
                  "label"
                ],
                "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/ListInboundAddressesResponseItem"
                }
              }
            }
          },
          "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-addresses/{addressId}": {
      "get": {
        "operationId": "getInboundAddress",
        "summary": "Returns one inbound email address with its binding and watcher.",
        "description": "Returns one inbound email address with its binding and watcher. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "addressId",
            "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/GetInboundAddressResponse"
                }
              }
            }
          },
          "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-addresses/{addressId}/binding": {
      "post": {
        "operationId": "setInboundAddressBinding",
        "summary": "Binds an inbound email address to a vendor or customer.",
        "description": "Binds an inbound email address to a vendor or customer. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "purpose": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fromSuggestion": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "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/GetInboundAddressResponse"
                }
              }
            }
          },
          "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-addresses/{addressId}/binding-suggestion/decline": {
      "post": {
        "operationId": "declineInboundAddressSuggestion",
        "summary": "Declines the suggested binding of an inbound email address.",
        "description": "Declines the suggested binding of an inbound email address. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "vendorId"
                ],
                "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/GetInboundAddressResponse"
                }
              }
            }
          },
          "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-addresses/{addressId}/closing": {
      "post": {
        "operationId": "scheduleAddressClosing",
        "summary": "Schedules the closing of an inbound email address.",
        "description": "Schedules the closing of an inbound email address. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "closesOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "successorAddressId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 280
                  }
                },
                "required": [
                  "closesOn",
                  "successorAddressId",
                  "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/ListInboundAddressesResponseItem"
                }
              }
            }
          },
          "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-addresses/{addressId}/closing/withdraw": {
      "post": {
        "operationId": "withdrawAddressClosing",
        "summary": "Withdraws a scheduled closing of an inbound email address.",
        "description": "Withdraws a scheduled closing of an inbound email address. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "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
                  },
                  "expectedClosesOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "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/ListInboundAddressesResponseItem"
                }
              }
            }
          },
          "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-addresses/{addressId}/replies": {
      "post": {
        "operationId": "enableInboxReplies",
        "summary": "Turns on replies from an inbound email address.",
        "description": "Turns on replies from an inbound email address. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "until": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "until"
                ],
                "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/ListInboundAddressesResponseItem"
                }
              }
            }
          },
          "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-addresses/{addressId}/replies/off": {
      "post": {
        "operationId": "disableInboxReplies",
        "summary": "Turns off replies from an inbound email address.",
        "description": "Turns off replies from an inbound email address. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "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/ListInboundAddressesResponseItem"
                }
              }
            }
          },
          "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-addresses/{addressId}/revoke": {
      "post": {
        "operationId": "revokeInboundAddress",
        "summary": "Revokes an inbound email address.",
        "description": "Revokes an inbound email address. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "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/ListInboundAddressesResponseItem"
                }
              }
            }
          },
          "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-addresses/{addressId}/watcher": {
      "post": {
        "operationId": "changeInboundAddressWatcher",
        "summary": "Changes the person who watches an inbound email address.",
        "description": "Changes the person who watches an inbound email address. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "watcherUserId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "watcherTelephone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expectedWatcherUserId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "watcherUserId",
                  "watcherTelephone",
                  "expectedWatcherUserId"
                ],
                "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/GetInboundAddressResponse"
                }
              }
            }
          },
          "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-emails": {
      "get": {
        "operationId": "listInboundEmails",
        "summary": "Lists the inbound emails the ledger received, with the server's total.",
        "description": "Lists the inbound emails the ledger received, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "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": "mailbox",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILLS",
                "INVOICES"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "senderDomain",
            "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": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "waiting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "mine",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "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"
                          },
                          "receivedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "addressId": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "addressLabel": {
                            "type": "string"
                          },
                          "mailbox": {
                            "type": "string",
                            "enum": [
                              "BILLS",
                              "INVOICES"
                            ]
                          },
                          "sender": {
                            "type": "string"
                          },
                          "senderDomain": {
                            "type": "string"
                          },
                          "subject": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 200
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "partCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "reference": {
                            "type": "string"
                          },
                          "partNames": {
                            "maxItems": 60,
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "READ",
                              "IN_REVIEW",
                              "BOOKED",
                              "UNREADABLE",
                              "NOT_A_BILL",
                              "DUPLICATE",
                              "HELD",
                              "SLIP",
                              "STATEMENT"
                            ]
                          },
                          "stateSentence": {
                            "type": "string"
                          },
                          "became": {
                            "$ref": "#/components/schemas/Became2"
                          },
                          "reading": {
                            "$ref": "#/components/schemas/Reading3"
                          },
                          "waiting": {
                            "type": "boolean"
                          },
                          "auth": {
                            "$ref": "#/components/schemas/Auth"
                          },
                          "forward": {
                            "type": "object",
                            "properties": {
                              "state": {
                                "type": "string",
                                "enum": [
                                  "UNRECORDED",
                                  "DIRECT",
                                  "FORWARDED"
                                ]
                              },
                              "forwardedByName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "state",
                              "forwardedByName"
                            ],
                            "additionalProperties": false
                          },
                          "statement": {
                            "$ref": "#/components/schemas/Statement"
                          },
                          "vendorQuery": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "reference": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "reference"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "receivedAt",
                          "entityTimeZone",
                          "entityId",
                          "entityName",
                          "addressId",
                          "address",
                          "addressLabel",
                          "mailbox",
                          "sender",
                          "senderDomain",
                          "subject",
                          "partCount",
                          "reference",
                          "partNames",
                          "state",
                          "stateSentence",
                          "became",
                          "reading",
                          "waiting",
                          "auth",
                          "forward",
                          "statement",
                          "vendorQuery"
                        ],
                        "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/inbound-emails/bulk/handled": {
      "post": {
        "operationId": "bulkMarkInboundEmailsHandled",
        "summary": "Marks several inbound emails as handled in one request.",
        "description": "Marks several inbound emails as handled in one request. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "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/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "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-emails/bulk/not-a-bill": {
      "post": {
        "operationId": "bulkMarkInboundEmailsNotABill",
        "summary": "Marks several inbound emails as not bills in one request.",
        "description": "Marks several inbound emails as not bills in one request. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "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/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "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-emails/summary": {
      "get": {
        "operationId": "summarizeInboundEmails",
        "summary": "Returns the counts of inbound emails by what happened to them.",
        "description": "Returns the counts of inbound emails by what happened to them. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "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}$"
            }
          }
        ],
        "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}$"
                    },
                    "timeZone": {
                      "type": "string"
                    },
                    "arrived": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "byState": {
                      "type": "object",
                      "properties": {
                        "READ": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "IN_REVIEW": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "BOOKED": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "UNREADABLE": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "NOT_A_BILL": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "DUPLICATE": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "HELD": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "SLIP": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "STATEMENT": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "READ",
                        "IN_REVIEW",
                        "BOOKED",
                        "UNREADABLE",
                        "NOT_A_BILL",
                        "DUPLICATE",
                        "HELD",
                        "SLIP",
                        "STATEMENT"
                      ],
                      "additionalProperties": false
                    },
                    "refused": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "waiting": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "byAddress": {
                      "maxItems": 6,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "addressId": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "mailbox": {
                            "type": "string",
                            "enum": [
                              "BILLS",
                              "INVOICES"
                            ]
                          },
                          "arrived": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "booked": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "bookedOrReview": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "addressId",
                          "address",
                          "label",
                          "mailbox",
                          "arrived",
                          "booked"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "moreAddresses": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "byEntity": {
                      "maxItems": 6,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "arrived": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "booked": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "bookedOrReview": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "entityId",
                          "entityName",
                          "arrived",
                          "booked"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "moreEntities": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "from",
                    "to",
                    "timeZone",
                    "arrived",
                    "byState",
                    "refused",
                    "waiting",
                    "byAddress",
                    "moreAddresses",
                    "byEntity",
                    "moreEntities"
                  ],
                  "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-emails/{inboundEmailId}": {
      "get": {
        "operationId": "getInboundEmail",
        "summary": "Returns one inbound email with its attachments.",
        "description": "Returns one inbound email with its attachments. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "inboundEmailId",
            "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/GetInboundEmailResponse"
                }
              }
            }
          },
          "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-emails/{inboundEmailId}/handled": {
      "post": {
        "operationId": "markInboundEmailHandled",
        "summary": "Marks an inbound email as handled.",
        "description": "Marks an inbound email as handled. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "inboundEmailId",
            "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": 4,
                    "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/GetInboundEmailResponse"
                }
              }
            }
          },
          "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-emails/{inboundEmailId}/not-a-bill": {
      "post": {
        "operationId": "markInboundEmailNotABill",
        "summary": "Marks an inbound email as not a bill.",
        "description": "Marks an inbound email as not a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "inboundEmailId",
            "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": 4,
                    "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/GetInboundEmailResponse"
                }
              }
            }
          },
          "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-emails/{inboundEmailId}/read-as-bill": {
      "post": {
        "operationId": "readInboundEmailAsBill",
        "summary": "Reads an inbound email as a bill and returns what it found.",
        "description": "Reads an inbound email as a bill and returns what it found. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "inboundEmailId",
            "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/GetInboundEmailResponse"
                }
              }
            }
          },
          "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-refusals": {
      "get": {
        "operationId": "listInboundRefusals",
        "summary": "Lists the inbound emails the ledger refused, with the reason for each.",
        "description": "Lists the inbound emails the ledger refused, with the reason for each. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "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": {
              "$ref": "#/components/schemas/Reason2"
            }
          },
          {
            "name": "senderDomain",
            "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": {
              "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"
                          },
                          "refusedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "addressId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "domain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reason": {
                            "$ref": "#/components/schemas/Reason2"
                          },
                          "reasonLabel": {
                            "type": "string"
                          },
                          "note": {
                            "type": "string"
                          },
                          "senderDomain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sizeBytes": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "attributedToName": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "refusedAt",
                          "entityTimeZone",
                          "entityId",
                          "entityName",
                          "addressId",
                          "address",
                          "domain",
                          "reason",
                          "reasonLabel",
                          "note",
                          "senderDomain",
                          "sizeBytes",
                          "attributedToName"
                        ],
                        "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-reply-stops": {
      "get": {
        "operationId": "listInboxReplyStops",
        "summary": "Lists the stops on replies to senders, with the server's total.",
        "description": "Lists the stops on replies to senders, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "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/ListInboxReplyStopsResponseItem"
                      }
                    },
                    "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": "stopInboxReplies",
        "summary": "Stops replies to a sender for a period.",
        "description": "Stops replies to a sender for a period. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "recipientEmail",
                  "reason"
                ],
                "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/ListInboxReplyStopsResponseItem"
                }
              }
            }
          },
          "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/inbox-reply-stops/{stopId}/lift": {
      "post": {
        "operationId": "liftInboxReplyStop",
        "summary": "Lifts a stop on replies to a sender.",
        "description": "Lifts a stop on replies to a sender. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "stopId",
            "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": 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/ListInboxReplyStopsResponseItem"
                }
              }
            }
          },
          "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/intake-links": {
      "post": {
        "operationId": "createIntakeLink",
        "summary": "Creates a link a customer or vendor uses to send their details to the ledger.",
        "description": "Creates a link a customer or vendor uses to send their details to the ledger. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "expiresOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "label"
                ],
                "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/CreateIntakeLinkResponse"
                }
              }
            }
          },
          "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": "listIntakeLinks",
        "summary": "Lists the intake links, with the server's total.",
        "description": "Lists the intake links, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "OPEN",
                "CLOSED"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "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/ListIntakeLinksResponseItem"
                      }
                    },
                    "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/intake-links/{linkId}/revoke": {
      "post": {
        "operationId": "revokeIntakeLink",
        "summary": "Revokes an intake link so it can no longer be used.",
        "description": "Revokes an intake link so it can no longer be used. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "linkId",
            "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": 3,
                    "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/ListIntakeLinksResponseItem"
                }
              }
            }
          },
          "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/intake-links/{linkId}/url": {
      "post": {
        "operationId": "copyIntakeLink",
        "summary": "Returns the address of an intake link so it can be copied.",
        "description": "Returns the address of an intake link so it can be copied. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "linkId",
            "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": {
                  "$ref": "#/components/schemas/CreateIntakeLinkResponse"
                }
              }
            }
          },
          "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/places/autocomplete": {
      "post": {
        "operationId": "placesAutocomplete",
        "summary": "Suggests addresses from a partial address typed into a form.",
        "description": "Suggests addresses from a partial address typed into a form. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "sessionToken": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,36}$"
                  },
                  "languageCode": {
                    "type": "string",
                    "pattern": "^[a-z]{2}(-[A-Z]{2})?$"
                  },
                  "countries": {
                    "minItems": 1,
                    "maxItems": 15,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Z]{2}$"
                    }
                  }
                },
                "required": [
                  "input",
                  "sessionToken"
                ],
                "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": {
                    "suggestions": {
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "placeId": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9_-]{1,512}$"
                          },
                          "mainText": {
                            "type": "string"
                          },
                          "secondaryText": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "placeId",
                          "mainText",
                          "secondaryText"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "suggestions"
                  ],
                  "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/places/details": {
      "post": {
        "operationId": "placeDetails",
        "summary": "Returns the full address of a place a person picked.",
        "description": "Returns the full address of a place a person picked. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "placeId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,512}$"
                  },
                  "sessionToken": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,36}$"
                  },
                  "languageCode": {
                    "type": "string",
                    "pattern": "^[a-z]{2}(-[A-Z]{2})?$"
                  }
                },
                "required": [
                  "placeId",
                  "sessionToken"
                ],
                "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": {
                    "placeId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,512}$"
                    },
                    "formattedAddress": {
                      "type": "string"
                    },
                    "line1": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "line2": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "region": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^(CA|US)-[A-Z]{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "postalCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "placeId",
                    "formattedAddress",
                    "line1",
                    "line2",
                    "city",
                    "region",
                    "postalCode",
                    "country"
                  ],
                  "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/privacy-requests/contact": {
      "get": {
        "operationId": "getPrivacyRequestContact",
        "summary": "Gives the fixed answer to any request to erase or delete personal data: people handle it at info@eternifylabs.com.",
        "description": "Gives the fixed answer to any request to erase or delete personal data: people handle it at info@eternifylabs.com. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "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": {
                    "message": {
                      "type": "string"
                    },
                    "messageFr": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message",
                    "messageFr",
                    "address"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/record-imports": {
      "get": {
        "operationId": "listRecordImports",
        "summary": "Lists the record imports, with the server's total.",
        "description": "Lists the record imports, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Kind2"
            }
          },
          {
            "name": "objectKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "READING",
                "REVIEW",
                "APPLIED",
                "FAILED",
                "APPLYING",
                "REVERTED"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "uploadedFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "uploadedTo",
            "in": "query",
            "required": false,
            "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": {
                            "$ref": "#/components/schemas/Kind2"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "format": {
                            "type": "string",
                            "enum": [
                              "CSV",
                              "XLSX",
                              "IIF",
                              "PDF",
                              "IMAGE",
                              "XML",
                              "API"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "READING",
                              "REVIEW",
                              "APPLIED",
                              "FAILED",
                              "APPLYING",
                              "REVERTED"
                            ]
                          },
                          "counts": {
                            "$ref": "#/components/schemas/Counts3"
                          },
                          "documentId": {
                            "type": "string"
                          },
                          "uploadedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "approvedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "approvedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "failure": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sourceSystem": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "QUICKBOOKS_ONLINE",
                                  "QUICKBOOKS_DESKTOP",
                                  "XERO",
                                  "SAGE_50",
                                  "SPREADSHEET",
                                  "OTHER"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "sourceSystemLabel": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "apply": {
                            "default": null,
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "jobId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "jobId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "read": {
                            "default": null,
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "jobId": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "jobId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "objectKey": {
                            "default": null,
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "fileName",
                          "format",
                          "status",
                          "counts",
                          "documentId",
                          "uploadedBy",
                          "createdAt",
                          "approvedBy",
                          "approvedAt",
                          "failure",
                          "apply",
                          "read",
                          "objectKey"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "entityTimeZone"
                  ],
                  "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/record-imports/{importId}": {
      "get": {
        "operationId": "getRecordImport",
        "summary": "Returns one record import with its rows and mapping.",
        "description": "Returns one record import with its rows and mapping. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "importId",
            "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
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "problems",
                "low",
                "disagrees",
                "refused"
              ]
            }
          }
        ],
        "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/GetRecordImportResponse"
                }
              }
            }
          },
          "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/record-imports/{importId}/banking-checks": {
      "post": {
        "operationId": "requestBankingIntakeCheck",
        "summary": "Requests a check of the banking details a record import carries.",
        "description": "Requests a check of the banking details a record import carries. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "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": {
                    "id": {
                      "type": "string"
                    },
                    "importId": {
                      "type": "string"
                    },
                    "requestedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "requestedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "rowsRequested": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "resultsSoFar": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "rowsQueued": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "importId",
                    "requestedAt",
                    "requestedBy",
                    "rowsRequested",
                    "resultsSoFar",
                    "rowsQueued"
                  ],
                  "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/record-imports/{importId}/banking-documents": {
      "get": {
        "operationId": "listBankingIntakeDocuments",
        "summary": "Lists the banking documents attached to a record import.",
        "description": "Lists the banking documents attached to a record import. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "importId",
            "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/ListBankingIntakeDocumentsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "entityTimeZone"
                  ],
                  "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": "attachBankingIntakeDocument",
        "summary": "Attaches a banking document to a record import.",
        "description": "Attaches a banking document to a record import. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "documentId"
                ],
                "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/ListBankingIntakeDocumentsResponseItem"
                }
              }
            }
          },
          "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-imports/{importId}/banking-documents/{attachmentId}/detach": {
      "post": {
        "operationId": "detachBankingIntakeDocument",
        "summary": "Detaches a banking document from a record import.",
        "description": "Detaches a banking document from a record import. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachmentId",
            "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/ListBankingIntakeDocumentsResponseItem"
                }
              }
            }
          },
          "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-imports/{importId}/fill": {
      "post": {
        "operationId": "fillRecordImportField",
        "summary": "Fills a missing field on every row of a record import.",
        "description": "Fills a missing field on every row of a record import. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "field",
                  "value"
                ],
                "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": {
                    "kind": {
                      "$ref": "#/components/schemas/Kind2"
                    },
                    "field": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
                    },
                    "value": {
                      "type": "string"
                    },
                    "filled": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "counts": {
                      "$ref": "#/components/schemas/Counts3"
                    }
                  },
                  "required": [
                    "kind",
                    "field",
                    "value",
                    "filled",
                    "counts"
                  ],
                  "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/record-imports/{importId}/history-suppliers": {
      "get": {
        "operationId": "getRecordImportHistorySuppliers",
        "summary": "Lists the suppliers a record import's history refers to.",
        "description": "Lists the suppliers a record import's history refers to. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "importId",
            "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
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PLACED",
                "NOT_FOUND"
              ]
            }
          }
        ],
        "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": {
                          "nameKey": {
                            "type": "string"
                          },
                          "nameAsWritten": {
                            "type": "string"
                          },
                          "spellings": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "rows": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "PLACED_NAME",
                              "PLACED_ALIAS",
                              "NOT_FOUND"
                            ]
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "archived": {
                                    "type": "boolean"
                                  },
                                  "mergedInto": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "displayName": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "displayName"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName",
                                  "archived",
                                  "mergedInto"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "alias": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "nearby": {
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "displayName": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "displayName"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "nameKey",
                          "nameAsWritten",
                          "spellings",
                          "rows",
                          "state",
                          "vendor",
                          "alias",
                          "nearby"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "PAID_BILL",
                        "VENDOR_PAYMENT"
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "names": {
                          "$ref": "#/components/schemas/Names"
                        },
                        "rows": {
                          "$ref": "#/components/schemas/Names"
                        }
                      },
                      "required": [
                        "names",
                        "rows"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "kind",
                    "counts"
                  ],
                  "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/record-imports/{importId}/mapping": {
      "put": {
        "operationId": "updateRecordImportMapping",
        "summary": "Changes the mapping from a file's columns to the ledger's fields.",
        "description": "Changes the mapping from a file's columns to the ledger's fields. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "columns": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 199
                        },
                        "field": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "index",
                        "field"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "columns"
                ],
                "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/GetRecordImportResponse"
                }
              }
            }
          },
          "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-imports/{importId}/open-payables-position": {
      "get": {
        "operationId": "getOpenPayablesPosition",
        "summary": "Returns the open payables position an import found for the company.",
        "description": "Returns the open payables position an import found for the company. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "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": {
                    "importId": {
                      "type": "string"
                    },
                    "cutover": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "entityId": {
                          "type": "string"
                        },
                        "entityName": {
                          "type": "string"
                        },
                        "entityTimeZone": {
                          "type": "string"
                        },
                        "conversionDate": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "OPEN",
                            "SETTLED",
                            "WITHDRAWN"
                          ]
                        },
                        "previousSystem": {
                          "type": "string",
                          "enum": [
                            "QUICKBOOKS_ONLINE",
                            "QUICKBOOKS_DESKTOP",
                            "XERO",
                            "SAGE_50",
                            "SPREADSHEET",
                            "OTHER"
                          ]
                        },
                        "previousSystemLabel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "itcClaimedInPreviousSystem": {
                          "type": "boolean"
                        },
                        "suspenseAccount": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "code": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "code",
                            "name"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "entityId",
                        "entityName",
                        "entityTimeZone",
                        "conversionDate",
                        "state",
                        "previousSystem",
                        "previousSystemLabel",
                        "itcClaimedInPreviousSystem",
                        "suspenseAccount"
                      ],
                      "additionalProperties": false
                    },
                    "rows": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ready": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "notReady": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "total",
                        "ready",
                        "notReady"
                      ],
                      "additionalProperties": false
                    },
                    "bills": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "totals": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "minor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              }
                            },
                            "required": [
                              "currency",
                              "minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "functionalCurrency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "functionalTotalMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "oldestBillDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "overdueAtConversion": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "functionalMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            }
                          },
                          "required": [
                            "count",
                            "functionalMinor"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "count",
                        "totals",
                        "functionalCurrency",
                        "functionalTotalMinor",
                        "oldestBillDate",
                        "overdueAtConversion"
                      ],
                      "additionalProperties": false
                    },
                    "notReady": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "vendor": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {
                                "type": "string"
                              },
                              "candidates": {
                                "maxItems": 3,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "vendorId": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "vendorId",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "line",
                              "vendor",
                              "number",
                              "reason",
                              "candidates"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "data",
                        "nextCursor",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "overAuthority": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "first": {
                          "maxItems": 5,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              "vendor": {
                                "type": "string"
                              },
                              "number": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "line",
                              "vendor",
                              "number"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "holders": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "more": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "count",
                        "first",
                        "holders",
                        "more"
                      ],
                      "additionalProperties": false
                    },
                    "blockers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "enum": [
                              "CUTOVER_CLOSED",
                              "NO_ROWS",
                              "ROWS_NOT_READY",
                              "UPLOADER",
                              "OVER_AUTHORITY",
                              "PERIOD_LOCKED",
                              "ALREADY_APPLIED"
                            ]
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "mayPost": {
                      "type": "boolean"
                    },
                    "posted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "postedBy": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "postedAt": {
                              "type": "string",
                              "minLength": 20
                            },
                            "count": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "functionalTotalMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "controlTotalMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "differenceMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "controlNote": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "entryDate": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "firstEntryNumber": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "lastEntryNumber": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "postedBy",
                            "postedAt",
                            "count",
                            "functionalTotalMinor",
                            "controlTotalMinor",
                            "differenceMinor",
                            "controlNote",
                            "entryDate",
                            "firstEntryNumber",
                            "lastEntryNumber"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "importId",
                    "cutover",
                    "rows",
                    "bills",
                    "notReady",
                    "overAuthority",
                    "blockers",
                    "mayPost",
                    "posted"
                  ],
                  "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/record-imports/{importId}/prior-system": {
      "post": {
        "operationId": "declareRecordImportPriorSystem",
        "summary": "Declares which system a record import's figures came from.",
        "description": "Declares which system a record import's figures came from. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recorded": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "recorded"
                ],
                "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/GetRecordImportResponse"
                }
              }
            }
          },
          "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-imports/{importId}/result": {
      "get": {
        "operationId": "getRecordImportResult",
        "summary": "Returns the result of a record import, with each row's outcome.",
        "description": "Returns the result of a record import, with each row's outcome. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "importId",
            "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
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 30
            }
          }
        ],
        "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": {
                          "recordId": {
                            "type": "string"
                          },
                          "firstLine": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "label": {
                            "type": "string"
                          },
                          "secondLine": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": "string"
                          },
                          "note": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "changedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "changedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amount": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "minor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  }
                                },
                                "required": [
                                  "minor",
                                  "currency"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "recordId",
                          "firstLine",
                          "label",
                          "secondLine",
                          "state",
                          "note",
                          "changedAt",
                          "changedBy",
                          "amount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "importId": {
                      "type": "string"
                    },
                    "kind": {
                      "$ref": "#/components/schemas/Kind2"
                    },
                    "approvedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approvedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "system": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "QUICKBOOKS_ONLINE",
                                "QUICKBOOKS_DESKTOP",
                                "XERO",
                                "SAGE_50",
                                "SPREADSHEET",
                                "OTHER"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "system",
                        "label"
                      ],
                      "additionalProperties": false
                    },
                    "recordCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "states": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "state": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "state",
                          "count"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "filter": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "state"
                      ],
                      "additionalProperties": false
                    },
                    "hiddenOutsideSeat": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "missing": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "importId",
                    "kind",
                    "approvedBy",
                    "approvedAt",
                    "source",
                    "recordCount",
                    "states",
                    "filter",
                    "hiddenOutsideSeat",
                    "missing",
                    "entityTimeZone"
                  ],
                  "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/record-imports/{importId}/rows/{rowId}": {
      "patch": {
        "operationId": "updateRecordImportRow",
        "summary": "Changes one row of a record import.",
        "description": "Changes one row of a record import. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rowId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cells": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "cells"
                ],
                "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": {
                    "row": {
                      "$ref": "#/components/schemas/RowsItem2"
                    },
                    "counts": {
                      "$ref": "#/components/schemas/Counts3"
                    }
                  },
                  "required": [
                    "row",
                    "counts"
                  ],
                  "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/sending": {
      "get": {
        "operationId": "getSendingSettings",
        "summary": "Returns the settings the ledger sends email with.",
        "description": "Returns the settings the ledger sends email with. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "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/GetSendingSettingsResponse"
                }
              }
            }
          },
          "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"
          }
        }
      },
      "patch": {
        "operationId": "updateSendingSettings",
        "summary": "Changes the settings the ledger sends email with.",
        "description": "Changes the settings the ledger sends email with. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "documents"
        ],
        "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
                  },
                  "replyToEmail": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "email",
                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      {
                        "type": "string",
                        "const": ""
                      }
                    ]
                  },
                  "paymentInstructions": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "string",
                        "const": ""
                      }
                    ]
                  },
                  "template": {
                    "$ref": "#/components/schemas/Template"
                  },
                  "documentLabels": {
                    "$ref": "#/components/schemas/DocumentLabels"
                  },
                  "paymentLink": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "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/GetSendingSettingsResponse"
                }
              }
            }
          },
          "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"
          }
        }
      }
    }
  },
  "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": {
      "Act": {
        "type": "string",
        "enum": [
          "bills.submit",
          "bills.approve",
          "bills.hold",
          "bills.releaseHold",
          "bills.addToRun",
          "bills.plan",
          "bills.unplan",
          "vendors.holdPayments",
          "vendors.releasePaymentHolds",
          "paymentRuns.cancelDrafts",
          "purchaseOrders.submit",
          "arrivals.notABill",
          "arrivals.handled"
        ]
      },
      "Auth": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "spf": {
                "type": "string",
                "enum": [
                  "PASS",
                  "FAIL",
                  "SOFTFAIL",
                  "NEUTRAL",
                  "NONE",
                  "TEMPERROR",
                  "PERMERROR",
                  "UNKNOWN"
                ]
              },
              "dkim": {
                "type": "string",
                "enum": [
                  "PASS",
                  "FAIL",
                  "SOFTFAIL",
                  "NEUTRAL",
                  "NONE",
                  "TEMPERROR",
                  "PERMERROR",
                  "UNKNOWN"
                ]
              },
              "dmarc": {
                "type": "string",
                "enum": [
                  "PASS",
                  "FAIL",
                  "SOFTFAIL",
                  "NEUTRAL",
                  "NONE",
                  "TEMPERROR",
                  "PERMERROR",
                  "UNKNOWN"
                ]
              }
            },
            "required": [
              "spf",
              "dkim",
              "dmarc"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Became": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "BILL",
                  "IMPORT_BATCH",
                  "FLAGGED"
                ]
              },
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "id",
              "label"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Became2": {
        "anyOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "BILL"
                  },
                  "billId": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "supplierName": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "DRAFT",
                      "IN_REVIEW",
                      "DECLINED",
                      "APPROVED",
                      "HELD",
                      "OPEN",
                      "DUE",
                      "OVERDUE",
                      "IN_RUN",
                      "PARTIALLY_PAID",
                      "PAID",
                      "VOID"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "billId",
                  "number",
                  "supplierName",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "CREDIT"
                  },
                  "vendorCreditId": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "supplierName": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "DRAFT",
                      "IN_REVIEW",
                      "APPROVED",
                      "APPLIED",
                      "VOID"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "vendorCreditId",
                  "number",
                  "supplierName",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "ANOMALY"
                  },
                  "proposalId": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "proposalId",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "IMPORT_BATCH"
                  },
                  "importId": {
                    "type": "string"
                  },
                  "fileName": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "importId",
                  "fileName"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "EARLIER_ARRIVAL"
                  },
                  "inboundEmailId": {
                    "type": "string"
                  },
                  "receivedAt": {
                    "type": "string",
                    "minLength": 20
                  }
                },
                "required": [
                  "kind",
                  "inboundEmailId",
                  "receivedAt"
                ],
                "additionalProperties": false
              }
            ]
          },
          {
            "type": "null"
          }
        ]
      },
      "Breaker": {
        "type": "object",
        "properties": {
          "paused": {
            "type": "boolean"
          },
          "hardBounces": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "window": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "thresholdBp": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "paused",
          "hardBounces",
          "window",
          "thresholdBp"
        ],
        "additionalProperties": false
      },
      "BulkHoldVendorPaymentsRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "PREVIEW",
              "RUN"
            ]
          },
          "selection": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "ids"
                  },
                  "ids": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "kind",
                  "ids"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "filter"
                  },
                  "query": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "expectedTotal": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "kind",
                  "query",
                  "expectedTotal"
                ],
                "additionalProperties": false
              }
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "until": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "on": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "confirmed": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "totals": {
                "$ref": "#/components/schemas/Totals2"
              }
            },
            "required": [
              "count",
              "totals"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "mode",
          "selection"
        ],
        "additionalProperties": false
      },
      "BulkHoldVendorPaymentsResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "const": "PREVIEW"
              },
              "act": {
                "$ref": "#/components/schemas/Act"
              },
              "matching": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taken": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "eligible": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "entityId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "currency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "minor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "href": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "entityId",
                    "currency",
                    "minor",
                    "href"
                  ],
                  "additionalProperties": false
                }
              },
              "skipped": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "sentence": {
                      "type": "string"
                    },
                    "href": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "code",
                    "sentence",
                    "href"
                  ],
                  "additionalProperties": false
                }
              },
              "figures": {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "entries": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "totals": {
                    "$ref": "#/components/schemas/Totals2"
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "FUNCTIONAL_TOTAL",
                      "DOCUMENT_TOTAL",
                      "STILL_OWED",
                      "NONE"
                    ]
                  }
                },
                "required": [
                  "count",
                  "entries",
                  "totals",
                  "basis"
                ],
                "additionalProperties": false
              },
              "authority": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "authorityId": {
                          "type": "string"
                        },
                        "scopeLabel": {
                          "type": "string"
                        },
                        "entityId": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "capMinor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "usedMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "over": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "authorityId",
                        "scopeLabel",
                        "entityId",
                        "currency",
                        "capMinor",
                        "usedMinor",
                        "over"
                      ],
                      "additionalProperties": false
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "blocked": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "sentence": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "sentence"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "confirm": {
                "type": "string"
              },
              "handoff": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "entityId": {
                        "type": "string"
                      },
                      "entityName": {
                        "type": "string"
                      },
                      "ids": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "entityId",
                      "entityName",
                      "ids"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "mode",
              "act",
              "matching",
              "taken",
              "eligible",
              "skipped",
              "figures",
              "authority",
              "blocked",
              "confirm",
              "handoff"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "const": "RUN"
              },
              "act": {
                "$ref": "#/components/schemas/Act"
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "outcome": {
                      "type": "string",
                      "enum": [
                        "DONE",
                        "REFUSED",
                        "NOT_ATTEMPTED"
                      ]
                    },
                    "code": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentence": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "href": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "outcome",
                    "code",
                    "sentence",
                    "href"
                  ],
                  "additionalProperties": false
                }
              },
              "done": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "refused": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "notAttempted": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "mode",
              "act",
              "rows",
              "done",
              "refused",
              "notAttempted"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Cap": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "sentToday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "remaining": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "timeZone": {
            "type": "string"
          }
        },
        "required": [
          "limit",
          "sentToday",
          "remaining",
          "timeZone"
        ],
        "additionalProperties": false
      },
      "Cells2": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 500
        }
      },
      "Closing": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "closesAt": {
                "type": "string",
                "minLength": 20
              },
              "closesOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "setBy": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "setAt": {
                "type": "string",
                "minLength": 20
              },
              "reason": {
                "type": "string"
              },
              "successor": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "address"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "closesAt",
              "closesOn",
              "setBy",
              "setAt",
              "reason",
              "successor"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "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."
      },
      "Contact": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "SEATED",
              "FELL_BACK",
              "NOBODY"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "telephone": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "state",
          "name",
          "telephone"
        ],
        "additionalProperties": false
      },
      "Counts3": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "clean": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "problems": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lowConfidence": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "applied": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "refused": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "records": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "clean": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "problems": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "applied": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "refused": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "total",
              "clean",
              "problems",
              "applied",
              "refused"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "rows",
          "clean",
          "problems",
          "lowConfidence",
          "applied",
          "refused"
        ],
        "additionalProperties": false
      },
      "CreateIntakeLinkResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "LIVE",
              "FULL",
              "EXPIRED",
              "REVOKED"
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "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"
              }
            ]
          },
          "revokeReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "acceptedToday": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "acceptedTotal": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "lastSubmittedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "state",
          "createdBy",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "revokedBy",
          "revokeReason",
          "acceptedToday",
          "acceptedTotal",
          "lastSubmittedAt",
          "url"
        ],
        "additionalProperties": false
      },
      "DocumentLabels": {
        "type": "object",
        "properties": {
          "en": {
            "$ref": "#/components/schemas/En"
          },
          "fr": {
            "$ref": "#/components/schemas/En"
          }
        },
        "required": [
          "en",
          "fr"
        ],
        "additionalProperties": false
      },
      "Domain": {
        "default": null,
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "En": {
        "type": "object",
        "propertyNames": {
          "$ref": "#/components/schemas/EnValue"
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 200
        }
      },
      "EnValue": {
        "type": "string",
        "enum": [
          "invoiceTitle",
          "creditMemoTitle",
          "statementTitle",
          "draftMark",
          "voidMark",
          "draftNoNumber",
          "billTo",
          "documentNumber",
          "issueDate",
          "dueDate",
          "paymentTerms",
          "currency",
          "memo",
          "reference",
          "colDescription",
          "colSupply",
          "colQuantity",
          "colUnitPrice",
          "colNet",
          "colTax",
          "unitPriceNotStated",
          "noLines",
          "supplyStandard",
          "supplyZeroRated",
          "supplyExempt",
          "supplyOutOfScope",
          "subtotal",
          "taxTotal",
          "total",
          "amountApplied",
          "amountDue",
          "taxSummaryHeading",
          "taxSummaryBase",
          "taxSummaryAmount",
          "taxUnnamed",
          "registrationHeading",
          "gstHstNumber",
          "qstNumber",
          "pstNumber",
          "customerNumbersHeading",
          "termsHeading",
          "termsNetDays",
          "termsDueOnReceipt",
          "termsEarlyPayment",
          "termsInterest",
          "paymentHeading",
          "paymentNotSet",
          "paymentPayOnline",
          "pageOf",
          "creditMemoStatement",
          "creditMemoAdjusts",
          "creditMemoAdjustment",
          "statementPeriod",
          "statementOpeningBalance",
          "statementClosingBalance",
          "statementColDate",
          "statementColDocument",
          "statementColCharge",
          "statementColCredit",
          "statementColBalance"
        ]
      },
      "Extraction": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "supplierName": {
                "type": "string"
              },
              "invoiceNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "invoiceDate": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "totalMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "duplicateVerdict": {
                "type": "string",
                "enum": [
                  "CLEAR",
                  "FLAG",
                  "HARD_STOP"
                ]
              },
              "proposalId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "vendorId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "vendorName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "billId": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "supplierName",
              "invoiceNumber",
              "invoiceDate",
              "currency",
              "totalMinor",
              "duplicateVerdict",
              "proposalId",
              "vendorId",
              "vendorName",
              "billId"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "GetInboundAddressResponse": {
        "type": "object",
        "properties": {
          "domain": {
            "$ref": "#/components/schemas/Domain"
          },
          "id": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "mailbox": {
            "type": "string",
            "enum": [
              "BILLS",
              "INVOICES"
            ]
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "REVOKED"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "createdByName": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokedByName": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokeReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "messageCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lastMessageAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorId": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorName": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorStatus": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "ARCHIVED"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "purpose": {
            "type": [
              "string",
              "null"
            ]
          },
          "watcherUserId": {
            "type": "string"
          },
          "watcherName": {
            "type": "string"
          },
          "watcherSeat": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ADMIN",
                  "APPROVER",
                  "PREPARER"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "senders": {
            "$ref": "#/components/schemas/Senders"
          },
          "senderDomainCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "replies": {
            "$ref": "#/components/schemas/Replies"
          },
          "reasonSharedWithSenders": {
            "type": "boolean"
          },
          "closing": {
            "$ref": "#/components/schemas/Closing"
          },
          "heldOpen": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "watcherTelephone": {
            "type": [
              "string",
              "null"
            ]
          },
          "submittedAs": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "fellBack": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "userId",
                  "name",
                  "fellBack"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "refusalCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "bindingSuggestion": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "type": "string"
                  },
                  "vendorName": {
                    "type": "string"
                  },
                  "billCount": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "firstApprovedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "lastApprovedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "windowDays": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "bills": {
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "number": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billDate": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "totalMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        }
                      },
                      "required": [
                        "id",
                        "number",
                        "billDate",
                        "totalMinor",
                        "currency"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "vendorId",
                  "vendorName",
                  "billCount",
                  "firstApprovedAt",
                  "lastApprovedAt",
                  "windowDays",
                  "bills"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "declinedSuggestion": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "type": "string"
                  },
                  "vendorName": {
                    "type": "string"
                  },
                  "declinedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "declinedByName": {
                    "type": "string"
                  }
                },
                "required": [
                  "vendorId",
                  "vendorName",
                  "declinedAt",
                  "declinedByName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "domain",
          "id",
          "address",
          "label",
          "mailbox",
          "entityId",
          "entityName",
          "status",
          "createdAt",
          "createdByName",
          "revokedAt",
          "revokedByName",
          "revokeReason",
          "messageCount",
          "lastMessageAt",
          "vendorId",
          "vendorName",
          "vendorStatus",
          "purpose",
          "watcherUserId",
          "watcherName",
          "watcherSeat",
          "contact",
          "entityTimeZone",
          "senders",
          "senderDomainCount",
          "replies",
          "reasonSharedWithSenders",
          "closing",
          "heldOpen",
          "watcherTelephone",
          "submittedAs",
          "refusalCount",
          "bindingSuggestion",
          "declinedSuggestion"
        ],
        "additionalProperties": false
      },
      "GetInboundEmailResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string",
            "minLength": 20
          },
          "entityTimeZone": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "addressId": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "addressLabel": {
            "type": "string"
          },
          "mailbox": {
            "type": "string",
            "enum": [
              "BILLS",
              "INVOICES"
            ]
          },
          "sender": {
            "type": "string"
          },
          "senderDomain": {
            "type": "string"
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "partCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reference": {
            "type": "string"
          },
          "partNames": {
            "maxItems": 60,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "READ",
              "IN_REVIEW",
              "BOOKED",
              "UNREADABLE",
              "NOT_A_BILL",
              "DUPLICATE",
              "HELD",
              "SLIP",
              "STATEMENT"
            ]
          },
          "stateSentence": {
            "type": "string"
          },
          "became": {
            "$ref": "#/components/schemas/Became2"
          },
          "reading": {
            "$ref": "#/components/schemas/Reading3"
          },
          "waiting": {
            "type": "boolean"
          },
          "auth": {
            "$ref": "#/components/schemas/Auth"
          },
          "forward": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "UNRECORDED",
                  "DIRECT",
                  "FORWARDED"
                ]
              },
              "basis": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "RESENT_HEADERS",
                      "AUTO_FORWARD_HEADERS",
                      "ATTACHED_MESSAGE",
                      "INLINE_BLOCK",
                      "SUBJECT_ONLY"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "forwardedBy": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "forwardedByName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "originalSender": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "state",
              "basis",
              "forwardedBy",
              "forwardedByName",
              "originalSender"
            ],
            "additionalProperties": false
          },
          "statement": {
            "$ref": "#/components/schemas/Statement"
          },
          "vendorQuery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "reference": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "reference"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "messageId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "rawDocument": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              },
              "sizeBytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "fileName",
              "sizeBytes"
            ],
            "additionalProperties": false
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "fileName": {
                  "type": "string"
                },
                "contentType": {
                  "type": "string"
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "BILL",
                    "RETAINED",
                    "DISCARDED"
                  ]
                },
                "reasons": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "stored": {
                  "type": "boolean"
                },
                "documentId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "notStoredSentence": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "index",
                "fileName",
                "contentType",
                "sizeBytes",
                "role",
                "reasons",
                "stored",
                "documentId",
                "notStoredSentence"
              ],
              "additionalProperties": false
            }
          },
          "selectionSummary": {
            "type": [
              "string",
              "null"
            ]
          },
          "deliverySlip": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "PROPOSED",
                      "NO_ORDER",
                      "SEVERAL_ORDERS",
                      "NOTHING_OUTSTANDING",
                      "NOT_A_SLIP",
                      "UNREADABLE",
                      "PAUSED",
                      "MODEL_FAILED"
                    ]
                  },
                  "sentence": {
                    "type": "string"
                  },
                  "orderReference": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "purchaseOrder": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "number"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "goodsReceipt": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "sequence": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PROPOSED",
                              "CONFIRMED",
                              "VOID",
                              "DISCARDED"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "sequence",
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "senderDomain": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "resumesOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "outcome",
                  "sentence",
                  "orderReference",
                  "purchaseOrder",
                  "goodsReceipt",
                  "senderDomain",
                  "resumesOn"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "causationName": {
            "type": "string"
          },
          "authResult": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "const": "UNRECORDED"
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "const": "NONE"
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "const": "POSTMARK"
                  },
                  "spf": {
                    "type": "string",
                    "enum": [
                      "PASS",
                      "FAIL",
                      "SOFTFAIL",
                      "NEUTRAL",
                      "NONE",
                      "TEMPERROR",
                      "PERMERROR",
                      "UNKNOWN"
                    ]
                  },
                  "spfAligned": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "dkim": {
                    "type": "string",
                    "enum": [
                      "PASS",
                      "FAIL",
                      "SOFTFAIL",
                      "NEUTRAL",
                      "NONE",
                      "TEMPERROR",
                      "PERMERROR",
                      "UNKNOWN"
                    ]
                  },
                  "dkimAligned": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "dmarc": {
                    "type": "string",
                    "enum": [
                      "PASS",
                      "FAIL",
                      "SOFTFAIL",
                      "NEUTRAL",
                      "NONE",
                      "TEMPERROR",
                      "PERMERROR",
                      "UNKNOWN"
                    ]
                  },
                  "tests": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 40,
                      "pattern": "^(?:SPF|DKIM|DMARC)_[A-Z0-9_]+$"
                    }
                  }
                },
                "required": [
                  "source",
                  "spf",
                  "spfAligned",
                  "dkim",
                  "dkimAligned",
                  "dmarc",
                  "tests"
                ],
                "additionalProperties": false
              }
            ]
          },
          "notABill": {
            "$ref": "#/components/schemas/NotABill"
          },
          "handled": {
            "$ref": "#/components/schemas/NotABill"
          },
          "sentToReader": {
            "$ref": "#/components/schemas/NotABill"
          },
          "hold": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "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"
                    ]
                  },
                  "reasonSentence": {
                    "type": "string"
                  },
                  "limit": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "measured": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "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"
                      }
                    ]
                  },
                  "policy": {
                    "type": "string",
                    "enum": [
                      "ACCEPT_ALL",
                      "QUARANTINE_UNAUTHENTICATED",
                      "KNOWN_SENDERS_ONLY"
                    ]
                  },
                  "heldAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "notified": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "names": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "at": {
                            "type": "string",
                            "minLength": 20
                          }
                        },
                        "required": [
                          "names",
                          "at"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "reason",
                  "stage",
                  "reasonSentence",
                  "limit",
                  "measured",
                  "setBy",
                  "setAt",
                  "policy",
                  "heldAt",
                  "notified"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "receivedAt",
          "entityTimeZone",
          "entityId",
          "entityName",
          "addressId",
          "address",
          "addressLabel",
          "mailbox",
          "sender",
          "senderDomain",
          "subject",
          "partCount",
          "reference",
          "partNames",
          "state",
          "stateSentence",
          "became",
          "reading",
          "waiting",
          "auth",
          "forward",
          "statement",
          "vendorQuery",
          "messageId",
          "sentAt",
          "rawDocument",
          "parts",
          "selectionSummary",
          "deliverySlip",
          "causationName",
          "authResult",
          "notABill",
          "handled",
          "sentToReader",
          "hold"
        ],
        "additionalProperties": false
      },
      "GetRecordImportResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind2"
          },
          "fileName": {
            "type": "string"
          },
          "format": {
            "type": "string",
            "enum": [
              "CSV",
              "XLSX",
              "IIF",
              "PDF",
              "IMAGE",
              "XML",
              "API"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "READING",
              "REVIEW",
              "APPLIED",
              "FAILED",
              "APPLYING",
              "REVERTED"
            ]
          },
          "counts": {
            "$ref": "#/components/schemas/Counts3"
          },
          "documentId": {
            "type": "string"
          },
          "uploadedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "approvedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "approvedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "failure": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceSystem": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "QUICKBOOKS_ONLINE",
                  "QUICKBOOKS_DESKTOP",
                  "XERO",
                  "SAGE_50",
                  "SPREADSHEET",
                  "OTHER"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceSystemLabel": {
            "type": [
              "string",
              "null"
            ]
          },
          "apply": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "jobId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "read": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "jobId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "objectKey": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "mapping": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "columns": {
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 199
                        },
                        "header": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "field": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64,
                              "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "by": {
                          "type": "string",
                          "enum": [
                            "HEADER",
                            "MODEL",
                            "PERSON"
                          ]
                        },
                        "confidenceBp": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000
                        }
                      },
                      "required": [
                        "index",
                        "header",
                        "field",
                        "by",
                        "confidenceBp"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "reading": {
                    "type": "object",
                    "properties": {
                      "format": {
                        "type": "string",
                        "enum": [
                          "CSV",
                          "XLSX",
                          "IIF",
                          "PDF",
                          "IMAGE",
                          "XML",
                          "API"
                        ]
                      },
                      "pages": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "promptVersion": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 40
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "modelUsed": {
                        "type": "boolean"
                      },
                      "note": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "format",
                      "pages",
                      "promptVersion",
                      "modelUsed",
                      "note"
                    ],
                    "additionalProperties": false
                  },
                  "heldBack": {
                    "default": {
                      "columns": [],
                      "rows": 0
                    },
                    "type": "object",
                    "properties": {
                      "columns": {
                        "readOnly": true,
                        "maxItems": 200,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "index": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 199
                            },
                            "header": {
                              "type": "string",
                              "maxLength": 200
                            },
                            "reason": {
                              "type": "string",
                              "enum": [
                                "VENDOR_BANKING",
                                "CONVERSION_NOT_POSTED"
                              ]
                            }
                          },
                          "required": [
                            "index",
                            "header",
                            "reason"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "rows": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "columns",
                      "rows"
                    ],
                    "additionalProperties": false
                  },
                  "sourceProposal": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "system": {
                            "type": "string",
                            "enum": [
                              "QUICKBOOKS_ONLINE",
                              "QUICKBOOKS_DESKTOP",
                              "XERO",
                              "SAGE_50",
                              "SPREADSHEET",
                              "OTHER"
                            ]
                          },
                          "basis": {
                            "type": "string",
                            "enum": [
                              "FORMAT",
                              "HEADERS",
                              "MODEL",
                              "CONNECTOR"
                            ]
                          },
                          "headers": {
                            "maxItems": 5,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 200
                            }
                          }
                        },
                        "required": [
                          "system",
                          "basis",
                          "headers"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "columns",
                  "reading",
                  "heldBack",
                  "sourceProposal"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "fillable": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
                },
                "empty": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "field",
                "empty"
              ],
              "additionalProperties": false
            }
          },
          "filter": {
            "type": "string",
            "enum": [
              "all",
              "problems",
              "low",
              "disagrees",
              "refused"
            ]
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RowsItem2"
            }
          },
          "rowsNextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "rowsTotal": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "priorSystem": {
            "default": {
              "recorded": null,
              "answeredBy": null,
              "answeredAt": null
            },
            "type": "object",
            "properties": {
              "recorded": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "answeredBy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "answeredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "recorded",
              "answeredBy",
              "answeredAt"
            ],
            "additionalProperties": false
          },
          "intakeSummary": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "papers": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "rowsWithPaper": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "rowsWithoutPaper": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "notAsked": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "waiting": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "read": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "notRead": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "stale": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "agrees": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "disagrees": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "unusedPapers": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ListBankingIntakeDocumentsResponseItem"
                    }
                  },
                  "lastRun": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "requestedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "requestedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "rowsRequested": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "requestedAt",
                          "requestedBy",
                          "rowsRequested"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "entityTimeZone": {
                    "type": "string"
                  }
                },
                "required": [
                  "papers",
                  "rowsWithPaper",
                  "rowsWithoutPaper",
                  "notAsked",
                  "waiting",
                  "read",
                  "notRead",
                  "stale",
                  "agrees",
                  "disagrees",
                  "unusedPapers",
                  "lastRun",
                  "entityTimeZone"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "entityTimeZone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "required": [
          "id",
          "kind",
          "fileName",
          "format",
          "status",
          "counts",
          "documentId",
          "uploadedBy",
          "createdAt",
          "approvedBy",
          "approvedAt",
          "failure",
          "apply",
          "read",
          "objectKey",
          "mapping",
          "fillable",
          "filter",
          "rows",
          "rowsNextCursor",
          "rowsTotal",
          "priorSystem",
          "intakeSummary",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "GetSearchSourceForDocumentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "document",
              "inbound-email",
              "record",
              "guide"
            ]
          },
          "title": {
            "type": "string"
          },
          "documentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "inboundEmailId": {
            "type": [
              "string",
              "null"
            ]
          },
          "recordType": {
            "type": [
              "string",
              "null"
            ]
          },
          "recordId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "preparing",
              "indexed",
              "not-indexed",
              "failed",
              "erased"
            ]
          },
          "notIndexedReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "too-large",
                  "too-many-pages",
                  "too-many-chunks",
                  "unsupported-type",
                  "no-text",
                  "kind-excluded",
                  "ocr-unavailable"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "failureCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "pages": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "chunkCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "language": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "en",
                  "fr",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "parser": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "docling",
                  "document-ai",
                  "email-text",
                  "record-fields",
                  "markdown"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "hiddenTextChars": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "redactions": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "pipelineVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "current": {
            "type": "boolean"
          },
          "indexedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "queuedAt": {
            "type": "string",
            "minLength": 20
          },
          "erased": {
            "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"
                  },
                  "requestReference": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "at",
                  "by",
                  "reason",
                  "requestReference"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "documentId",
          "inboundEmailId",
          "recordType",
          "recordId",
          "status",
          "notIndexedReason",
          "failureCode",
          "attempts",
          "pages",
          "chunkCount",
          "language",
          "parser",
          "hiddenTextChars",
          "redactions",
          "pipelineVersion",
          "current",
          "indexedAt",
          "queuedAt",
          "erased"
        ],
        "additionalProperties": false
      },
      "GetSendingSettingsResponse": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "senderAddress": {
            "type": "string"
          },
          "senderDisplayName": {
            "type": "string"
          },
          "ownDomain": {
            "type": "boolean"
          },
          "replyToEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentInstructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "template": {
            "$ref": "#/components/schemas/Template"
          },
          "templateIsDefault": {
            "type": "boolean"
          },
          "documentLabels": {
            "$ref": "#/components/schemas/DocumentLabels"
          },
          "cap": {
            "$ref": "#/components/schemas/Cap"
          },
          "capApplies": {
            "type": "boolean"
          },
          "breaker": {
            "$ref": "#/components/schemas/Breaker"
          },
          "transportReady": {
            "type": "boolean"
          },
          "labelKeys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnValue"
            }
          }
        },
        "required": [
          "entityId",
          "entityName",
          "senderAddress",
          "senderDisplayName",
          "ownDomain",
          "replyToEmail",
          "paymentInstructions",
          "template",
          "templateIsDefault",
          "documentLabels",
          "cap",
          "capApplies",
          "breaker",
          "transportReady",
          "labelKeys"
        ],
        "additionalProperties": false
      },
      "Held": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^(0|[1-9]\\d{0,18})$"
              },
              "since": {
                "type": "string",
                "minLength": 20
              },
              "code": {
                "type": "string"
              },
              "attempts": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "from",
              "since",
              "code",
              "attempts"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "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
      },
      "Job2": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Job"
          },
          {
            "type": "null"
          }
        ]
      },
      "Kind2": {
        "type": "string",
        "enum": [
          "CUSTOMER",
          "PRODUCT",
          "VENDOR",
          "FIXED_ASSET",
          "TAX_REGISTRATION",
          "CONTRACT",
          "CREDIT_MEMO",
          "JOURNAL_ENTRY",
          "BUDGET",
          "RULE",
          "HISTORY_AUDIT_LINE",
          "HISTORY_CONTROL_FIRING",
          "HISTORY_PERIOD_LOCK",
          "HISTORY_REPORT_PACK",
          "HISTORY_SLIP_FILE",
          "HISTORY_FX_RATE",
          "HISTORY_SCHEDULE",
          "HISTORY_QUEUE_DECISION",
          "HISTORY_TAX_OVERRIDE",
          "BILL",
          "RECEIPT",
          "APPROVAL_AUTHORITY",
          "VENDOR_CREDIT",
          "CUSTOMER_PRICE",
          "PURCHASE_ORDER",
          "OPEN_PAYABLE",
          "VENDOR_BANKING",
          "HISTORY_PAID_BILL",
          "HISTORY_VENDOR_PAYMENT",
          "CUSTOM_RECORD"
        ]
      },
      "Kind7": {
        "type": "string",
        "enum": [
          "BILL",
          "SALES_INVOICE",
          "RECORD_IMPORT",
          "VENDOR_BANKING_EVIDENCE",
          "VENDOR_REGISTRATION_EVIDENCE",
          "PAYMENT_BANK_NOTICE",
          "CUSTOMER_CREDIT_APPLICATION",
          "EXEMPTION_CERTIFICATE",
          "SALES_EVIDENCE",
          "VENDOR_PAPER",
          "SUPPLIER_QUOTE",
          "GOODS_RECEIPT_EVIDENCE",
          "RECORDS_DESTRUCTION_PERMISSION",
          "VENDOR_STATEMENT"
        ]
      },
      "LastReplayOption1": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "minLength": 20
          },
          "by": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "at",
          "by"
        ],
        "additionalProperties": false
      },
      "ListBankingIntakeDocumentsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "attachedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "attachedAt": {
            "type": "string",
            "minLength": 20
          },
          "usedByLines": {
            "type": "array",
            "items": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          }
        },
        "required": [
          "id",
          "documentId",
          "fileName",
          "mimeType",
          "sizeBytes",
          "attachedBy",
          "attachedAt",
          "usedByLines"
        ],
        "additionalProperties": false
      },
      "ListEvidenceResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "documentId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "byteSize": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "addedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "addedAt": {
            "type": "string",
            "minLength": 20
          },
          "retainUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "detached": {
            "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"
                  }
                },
                "required": [
                  "at",
                  "by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "documentId",
          "fileName",
          "contentType",
          "byteSize",
          "note",
          "addedBy",
          "addedAt",
          "retainUntil",
          "detached"
        ],
        "additionalProperties": false
      },
      "ListInboundAddressesResponseItem": {
        "type": "object",
        "properties": {
          "domain": {
            "$ref": "#/components/schemas/Domain"
          },
          "id": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "mailbox": {
            "type": "string",
            "enum": [
              "BILLS",
              "INVOICES"
            ]
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "REVOKED"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "createdByName": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokedByName": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokeReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "messageCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lastMessageAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorId": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorName": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorStatus": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "ARCHIVED"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "purpose": {
            "type": [
              "string",
              "null"
            ]
          },
          "watcherUserId": {
            "type": "string"
          },
          "watcherName": {
            "type": "string"
          },
          "watcherSeat": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ADMIN",
                  "APPROVER",
                  "PREPARER"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "senders": {
            "$ref": "#/components/schemas/Senders"
          },
          "senderDomainCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "replies": {
            "$ref": "#/components/schemas/Replies"
          },
          "reasonSharedWithSenders": {
            "type": "boolean"
          },
          "closing": {
            "$ref": "#/components/schemas/Closing"
          },
          "heldOpen": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "domain",
          "id",
          "address",
          "label",
          "mailbox",
          "entityId",
          "entityName",
          "status",
          "createdAt",
          "createdByName",
          "revokedAt",
          "revokedByName",
          "revokeReason",
          "messageCount",
          "lastMessageAt",
          "vendorId",
          "vendorName",
          "vendorStatus",
          "purpose",
          "watcherUserId",
          "watcherName",
          "watcherSeat",
          "contact",
          "entityTimeZone",
          "senders",
          "senderDomainCount",
          "replies",
          "reasonSharedWithSenders",
          "closing",
          "heldOpen"
        ],
        "additionalProperties": false
      },
      "ListInboxReplyStopsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "recipientEmail": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "stoppedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "stoppedAt": {
            "type": "string",
            "minLength": 20
          },
          "lifted": {
            "$ref": "#/components/schemas/Retired"
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "recipientEmail",
          "reason",
          "stoppedBy",
          "stoppedAt",
          "lifted",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "ListIntakeLinksResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "LIVE",
              "FULL",
              "EXPIRED",
              "REVOKED"
            ]
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "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"
              }
            ]
          },
          "revokeReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "acceptedToday": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "acceptedTotal": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "lastSubmittedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "label",
          "state",
          "createdBy",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "revokedBy",
          "revokeReason",
          "acceptedToday",
          "acceptedTotal",
          "lastSubmittedAt"
        ],
        "additionalProperties": false
      },
      "Names": {
        "type": "object",
        "properties": {
          "placed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "notFound": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "placed",
          "notFound"
        ],
        "additionalProperties": false
      },
      "NotABill": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "at": {
                "type": "string",
                "minLength": 20
              },
              "byName": {
                "type": "string"
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "at",
              "byName"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Pages": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "from": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "to": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "PassagesItem": {
        "type": "object",
        "properties": {
          "chunkId": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/Source2"
          },
          "pages": {
            "$ref": "#/components/schemas/Pages"
          },
          "span": {
            "$ref": "#/components/schemas/Span"
          },
          "sectionPath": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "header": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 2000
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "other"
            ]
          },
          "matchedBy": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "meaning",
                "words",
                "identifier"
              ]
            }
          },
          "score": {
            "type": "number"
          },
          "citation": {
            "type": "string"
          },
          "untrusted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "chunkId",
          "source",
          "pages",
          "span",
          "sectionPath",
          "header",
          "text",
          "language",
          "matchedBy",
          "score",
          "citation",
          "untrusted"
        ],
        "additionalProperties": false
      },
      "Preview": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          }
        },
        "required": [
          "subject",
          "body"
        ],
        "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
      },
      "ProjectionsItem": {
        "type": "object",
        "properties": {
          "projection": {
            "type": "string",
            "enum": [
              "entity-summary",
              "document-index",
              "webhooks",
              "workflow-trigger"
            ]
          },
          "position": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,18})$"
          },
          "behindBy": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "oldestWaitingAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "lastApplied": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "label": {
                    "type": "string"
                  },
                  "at": {
                    "type": "string",
                    "minLength": 20
                  }
                },
                "required": [
                  "position",
                  "label",
                  "at"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "held": {
            "$ref": "#/components/schemas/Held"
          },
          "failing": {
            "$ref": "#/components/schemas/Held"
          },
          "lastReplay": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LastReplayOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "verified": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "drift": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "at",
                  "drift"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "projection",
          "position",
          "behindBy",
          "oldestWaitingAt",
          "lastApplied",
          "held",
          "failing",
          "lastReplay",
          "verified"
        ],
        "additionalProperties": false
      },
      "Reading3": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "verdict": {
                "type": "string",
                "enum": [
                  "BILL",
                  "CORRESPONDENCE"
                ]
              },
              "decidedBy": {
                "type": "string",
                "enum": [
                  "RULE",
                  "MODEL",
                  "FALLBACK"
                ]
              },
              "reasonCode": {
                "type": "string",
                "enum": [
                  "NO_AMOUNT_NO_NUMBER",
                  "REPLY_WITHOUT_FIGURES",
                  "AMOUNT_AND_NUMBER",
                  "SENDER_READ_AS_BILL_BEFORE",
                  "READER_STOPPED_ON_THESE_BOOKS",
                  "INVOICE",
                  "PAYMENT_QUESTION",
                  "PAYMENT_REMINDER",
                  "STATEMENT",
                  "NOTICE",
                  "OTHER_MESSAGE",
                  "MODEL_REFUSED",
                  "MODEL_UNPARSABLE",
                  "MODEL_UNAVAILABLE",
                  "QUOTE_NOT_IN_TEXT",
                  "BUDGET",
                  "DISCLOSURE"
                ]
              },
              "sentence": {
                "type": "string"
              }
            },
            "required": [
              "verdict",
              "decidedBy",
              "reasonCode",
              "sentence"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Reason2": {
        "type": "string",
        "enum": [
          "REVOKED",
          "NO_CAUSATION_USER",
          "TOO_LARGE",
          "NOT_A_MESSAGE",
          "MULTIPART_WITHOUT_BOUNDARY",
          "TOO_DEEP",
          "TOO_MANY_PARTS",
          "NO_RECEIVABLE_ACCOUNT",
          "OVER_DAILY_LIMIT",
          "UNKNOWN_LOCAL_PART"
        ]
      },
      "Replies": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "enabledBy": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "enabledAt": {
                "type": "string",
                "minLength": 20
              },
              "expiresAt": {
                "type": "string",
                "minLength": 20
              },
              "inForce": {
                "type": "boolean"
              }
            },
            "required": [
              "enabledBy",
              "enabledAt",
              "expiresAt",
              "inForce"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "RequestFullExportResponse": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/RequestFullExportResponseOption1"
          },
          {
            "$ref": "#/components/schemas/UndoAgentBatchResponse"
          }
        ]
      },
      "RequestFullExportResponseOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "WAITING",
              "APPROVED",
              "DOWNLOADED",
              "DECLINED",
              "WITHDRAWN",
              "EXPIRED",
              "CANCELLED"
            ]
          },
          "path": {
            "type": "string",
            "enum": [
              "TWO_PERSON",
              "SOLE_ADMIN_OWNER_OVERRIDE"
            ]
          },
          "includeBankFiles": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "requestedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "requestedAt": {
            "type": "string"
          },
          "decideBy": {
            "type": "string"
          },
          "approvedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "approvedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "approvalNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "declinedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "declinedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "declineReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "withdrawnAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiredAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiredStage": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "DECISION",
                  "DOWNLOAD"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "downloadBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "downloadedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "overrideCapacity": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "OWN_ORGANIZATION",
                  "MANAGING_FIRM"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "overrideReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "facts": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requesterSeatSince": {
                    "type": "string"
                  },
                  "earlierRequests": {
                    "type": "object",
                    "properties": {
                      "downloaded": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "declined": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "expired": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "downloaded",
                      "declined",
                      "expired"
                    ],
                    "additionalProperties": false
                  },
                  "lastDecline": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "byName": {
                            "type": "string"
                          },
                          "on": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "byName",
                          "on",
                          "reason"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastDownload": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "byName": {
                            "type": "string"
                          },
                          "on": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "byName",
                          "on"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reasonAddressesApprover": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "requesterSeatSince",
                  "earlierRequests",
                  "lastDecline",
                  "lastDownload",
                  "reasonAddressesApprover"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "job": {
            "$ref": "#/components/schemas/Job2"
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "state",
          "path",
          "includeBankFiles",
          "reason",
          "requestedBy",
          "requestedAt",
          "decideBy",
          "approvedBy",
          "approvedAt",
          "approvalNote",
          "declinedBy",
          "declinedAt",
          "declineReason",
          "withdrawnAt",
          "expiredAt",
          "expiredStage",
          "downloadBy",
          "downloadedAt",
          "overrideCapacity",
          "overrideReason",
          "facts",
          "job",
          "entityTimeZone"
        ],
        "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"
          }
        ]
      },
      "RowsItem2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "lineNumber": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "cells": {
            "$ref": "#/components/schemas/Cells2"
          },
          "edits": {
            "$ref": "#/components/schemas/Cells2"
          },
          "values": {
            "$ref": "#/components/schemas/Cells2"
          },
          "confidenceBp": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
            },
            "additionalProperties": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            }
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^(?:[a-z][A-Za-z0-9]*|cf\\.[a-z][a-z0-9_]{0,39}|line\\.[a-z][a-z0-9_]{0,39})$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "message": {
                  "type": "string",
                  "maxLength": 1000
                },
                "group": {
                  "type": "boolean"
                }
              },
              "required": [
                "field",
                "message"
              ],
              "additionalProperties": false
            }
          },
          "hasProblem": {
            "type": "boolean"
          },
          "lowConfidence": {
            "type": "boolean"
          },
          "recordId": {
            "type": [
              "string",
              "null"
            ]
          },
          "refusal": {
            "type": [
              "string",
              "null"
            ]
          },
          "groupKey": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "groupLine": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "intake": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "vendor": {
                    "type": "object",
                    "properties": {
                      "state": {
                        "type": "string",
                        "enum": [
                          "MATCHED",
                          "NONE",
                          "AMBIGUOUS",
                          "ARCHIVED"
                        ]
                      },
                      "id": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "displayName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "state",
                      "id",
                      "displayName"
                    ],
                    "additionalProperties": false
                  },
                  "paper": {
                    "type": "object",
                    "properties": {
                      "state": {
                        "type": "string",
                        "enum": [
                          "ATTACHED",
                          "NONE",
                          "NAMED_BUT_MISSING",
                          "AMBIGUOUS"
                        ]
                      },
                      "by": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "CELL",
                              "NAME"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "documentId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "attachmentId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "fileName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "mimeType": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "state",
                      "by",
                      "documentId",
                      "attachmentId",
                      "fileName",
                      "mimeType"
                    ],
                    "additionalProperties": false
                  },
                  "checkState": {
                    "type": "string",
                    "enum": [
                      "NOT_ASKED",
                      "WAITING",
                      "READ",
                      "NOT_READ",
                      "STALE"
                    ]
                  },
                  "check": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "verdict": {
                            "type": "string",
                            "enum": [
                              "READ",
                              "NOT_READ"
                            ]
                          },
                          "notReadWhy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "NO_EVIDENCE",
                                  "UNREADABLE",
                                  "DISCLOSURE",
                                  "BUDGET",
                                  "PROVIDER",
                                  "UNPARSABLE",
                                  "REFUSED"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "documentKind": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "VOID_CHEQUE",
                                  "BANK_LETTER",
                                  "STATEMENT",
                                  "OTHER"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "legible": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "namesTheSupplier": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "holderNamePrinted": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 200
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "routing": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "AGREES",
                                  "DIFFERS",
                                  "NOT_FOUND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "holderVsFile": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "AGREES",
                                  "DIFFERS",
                                  "NOT_FOUND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "holderVsSupplier": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "AGREES",
                                  "DIFFERS",
                                  "NOT_FOUND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "printedAccountLast4": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "promptVersion": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "runId",
                          "createdAt",
                          "verdict",
                          "notReadWhy",
                          "documentKind",
                          "legible",
                          "namesTheSupplier",
                          "holderNamePrinted",
                          "routing",
                          "holderVsFile",
                          "holderVsSupplier",
                          "printedAccountLast4",
                          "promptVersion"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "notes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "DUPLICATE_IN_FILE",
                            "OPEN_CHANGE_EXISTS",
                            "SAME_AS_IN_FORCE",
                            "SHARED_WITH_OTHER",
                            "SAME_HAND",
                            "HOLDER_NOT_SUPPLIER"
                          ]
                        },
                        "sentence": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "sentence"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "vendor",
                  "paper",
                  "checkState",
                  "check",
                  "notes"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "lineNumber",
          "cells",
          "edits",
          "values",
          "confidenceBp",
          "problems",
          "hasProblem",
          "lowConfidence",
          "recordId",
          "refusal",
          "groupKey",
          "groupLine",
          "intake"
        ],
        "additionalProperties": false
      },
      "Senders": {
        "maxItems": 5,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "domain": {
              "type": "string"
            },
            "messageCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastMessageAt": {
              "type": "string"
            }
          },
          "required": [
            "domain",
            "messageCount",
            "lastMessageAt"
          ],
          "additionalProperties": false
        }
      },
      "Source2": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "document",
              "inbound-email",
              "record",
              "guide"
            ]
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "documentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "documentKind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Kind7"
              },
              {
                "type": "null"
              }
            ]
          },
          "inboundEmailId": {
            "type": [
              "string",
              "null"
            ]
          },
          "recordType": {
            "type": [
              "string",
              "null"
            ]
          },
          "recordId": {
            "type": [
              "string",
              "null"
            ]
          },
          "guideSlug": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "id",
          "title",
          "documentId",
          "documentKind",
          "inboundEmailId",
          "recordType",
          "recordId",
          "guideSlug"
        ],
        "additionalProperties": false
      },
      "Span": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "start": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "end": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "start",
              "end"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Statement": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "READING",
                  "IN_REVIEW",
                  "ACCEPTED"
                ]
              }
            },
            "required": [
              "id",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Template": {
        "type": "object",
        "properties": {
          "en": {
            "$ref": "#/components/schemas/Preview"
          },
          "fr": {
            "$ref": "#/components/schemas/Preview"
          }
        },
        "required": [
          "en",
          "fr"
        ],
        "additionalProperties": false
      },
      "Totals2": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "entityId": {
              "type": "string"
            },
            "entityName": {
              "type": "string"
            },
            "currency": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "minor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          "required": [
            "entityId",
            "entityName",
            "currency",
            "minor"
          ],
          "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
      }
    },
    "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"
        }
      }
    }
  }
}
