{
  "openapi": "3.1.1",
  "info": {
    "description": "The Syllevo API contract, version 1. Every route in it is explained, with examples, at https://syllevo.com/docs/api.\n\nEvery path carries its version, so a v2 would arrive beside v1 rather than replacing it. Any OpenAPI 3.1 tool can generate a client from this file.",
    "summary": "Collects invoices for accountants, so nobody has to chase them.",
    "title": "Syllevo API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.syllevo.com"
    }
  ],
  "security": [
    {
      "bearerAuth": [],
      "organizationId": []
    },
    {
      "bearerAuth": []
    },
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Accounts"
    },
    {
      "name": "Affiliates"
    },
    {
      "name": "Anomalies"
    },
    {
      "name": "ApiKeys"
    },
    {
      "name": "Billing"
    },
    {
      "name": "BillingWebhooks"
    },
    {
      "name": "Completeness"
    },
    {
      "name": "Connectors"
    },
    {
      "name": "DigestPreferences"
    },
    {
      "name": "Documents"
    },
    {
      "name": "EFactura"
    },
    {
      "name": "Exports"
    },
    {
      "name": "HandoverPacks"
    },
    {
      "name": "Ingestion"
    },
    {
      "name": "Invitations"
    },
    {
      "name": "Invoices"
    },
    {
      "name": "MyInvitations"
    },
    {
      "name": "Onboarding"
    },
    {
      "name": "OrganizationAccounts"
    },
    {
      "name": "OrganizationClosure"
    },
    {
      "name": "Organization"
    },
    {
      "name": "OrganizationMembers"
    },
    {
      "name": "Organizations"
    },
    {
      "name": "OrganizationSecuritySettings"
    },
    {
      "name": "OrganizationStats"
    },
    {
      "name": "OrganizationSuppliers"
    },
    {
      "name": "Predictions"
    },
    {
      "name": "ProfileAvatars"
    },
    {
      "name": "ProfileCompleteness"
    },
    {
      "name": "ProfileContacts"
    },
    {
      "name": "ProfileReminders"
    },
    {
      "name": "Profiles"
    },
    {
      "name": "ProfileStats"
    },
    {
      "name": "ProfileUploadLinks"
    },
    {
      "name": "Registry"
    },
    {
      "name": "Reminders"
    },
    {
      "name": "Review"
    },
    {
      "name": "SalesInvoiceDeliveries"
    },
    {
      "name": "SalesInvoices"
    },
    {
      "name": "SalesInvoiceSubmissions"
    },
    {
      "name": "Search"
    },
    {
      "name": "SetupChecklistPreferences"
    },
    {
      "name": "SpvMessages"
    },
    {
      "name": "SpvTransmissionConsent"
    },
    {
      "name": "Status"
    },
    {
      "name": "SupplierConnections"
    },
    {
      "name": "Suppliers"
    },
    {
      "name": "SupplierDirectory"
    },
    {
      "name": "UnfiledEmails"
    },
    {
      "name": "Uploads"
    },
    {
      "name": "Users"
    },
    {
      "name": "VatValidations"
    }
  ],
  "paths": {
    "/v1/accounts": {
      "get": {
        "description": "There is no permission attribute here and none is missing. The gate is View\nand the service applies it: it asks the authorization service which profile\nids the actor can see and narrows the query to those, so a member who is on\n3 of a firm's 40 clients gets those 3 clients' sources and a total of that\nmany.\n\nView, and the reason is the same one that used to be written here for\nManageSources: it is the permission the per-profile route asks for to READ, so the flat route can never answer\na question the nested route would refuse.\n\nRead and write are different questions on this resource, and only the read is\nhere. Seeing that a client has a Gmail inbox connected is part of seeing the\nclient; connecting, retagging, or disconnecting one changes where a firm's\ninvoices come from, so every mutation asks `ManageSources` and none of them asks View.\n\nTwo things would still be a widening. Moving either route's read gate without\nthe other, in either direction: the flat route alone makes this list the more\npermissive of the two doors, and the nested route alone makes it quietly\nnarrower than the sum of the per-profile pages, so a member reaches a client's\nsources by clicking into it while this roster says there are none. And letting\na secret-bearing field onto `AccountResponse`, which now reaches\nevery member who can view any client rather than only the ones trusted to\nchange a connection.\n\nA member whose visible clients have no sources connected gets an empty page,\nnot a 403, and so does an actor who can see no clients at all. That is\ndeliberate and should not later be \"fixed\" into a 403: a short portfolio is\nnot a forbidden question, and refusing would confirm there are rows behind the\nrefusal.\n\nEach row carries its `profileId`, which is what makes the grid groupable\nwithout a second lookup per row, and the page is ordered by profile so one\nclient's sources arrive together.",
        "operationId": "organizationAccountsList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client, and `tag` is the free-text label\n    filter the nested route takes, applied here across the portfolio. Both narrow\n    within the set the caller can already see; neither widens anything.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client, and `tag` is the free-text label\n    filter the nested route takes, applied here across the portfolio. Both narrow\n    within the set the caller can already see; neither widens anything.",
            "in": "query",
            "name": "Tag",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfAccountResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of the sources of every client this actor can see, grouped by client\ncompany.",
        "tags": [
          "OrganizationAccounts"
        ]
      }
    },
    "/v1/affiliate": {
      "get": {
        "description": "A GET that can create, which is unusual and deliberate: there is nothing to agree to\nand nothing to configure, so an Enroll button would be a screen that exists to be\ndismissed. It is idempotent in the way that matters - calling it twice gives the same\ncode, until somebody deliberately changes it through `RenameCode`.",
        "operationId": "affiliatesGet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AffiliateResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The organization's referral code, minting one the first time it is asked for. Owner\nonly.",
        "tags": [
          "Affiliates"
        ]
      }
    },
    "/v1/affiliate/code": {
      "put": {
        "description": "**The old code keeps working forever.** Every code an organization has ever\n        been on keeps resolving to it, so a link on a flyer, in a newsletter that already\n        went out, or sitting in somebody's bookmarks still credits the firm that shared\n        it. Nothing here can cost a referral.\n\nPUT rather than POST, and the same `AffiliateResponse` the GET\nreturns: this replaces one value on a resource that already exists, and the\ncaller's next move is to render the page it just changed.\n\n409 twice, with different codes on the body - `affiliate_code_taken` when\nsomebody already holds it, whether it is the code they use today or one they\nrenamed away from, and\n`affiliate_code_limit_reached` when this organization is out of renames. They\nare separate because the sentence under the field is different and only one of\nthem means \"try another code\".",
        "operationId": "affiliatesRenameCode",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RenameAffiliateCodeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameAffiliateCodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameAffiliateCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AffiliateResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Changes the code in this organization's referral link. Owner only.",
        "tags": [
          "Affiliates"
        ]
      }
    },
    "/v1/affiliate/commissions": {
      "get": {
        "description": "Never 404s. An organization that has referred nobody gets empty lists, which is the\nempty state most referrer pages will show most of the time. The response names no\nreferred customer, by name or by id.",
        "operationId": "affiliatesGetCommissions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AffiliateCommissionsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "What this organization's referrals have earned, with totals by state. Owner only.",
        "tags": [
          "Affiliates"
        ]
      }
    },
    "/v1/anomalies": {
      "get": {
        "description": "Without `profileId` this is the firm-wide view, narrowed in the query to\nthe clients the caller may see - so an actor with no grants gets an empty page\nrather than a 403, exactly as the invoice list does. With `profileId` that\nsame set is intersected down to the one client, so naming a client the caller\ncannot see is also an empty page rather than a 403. Each row carries the\nflagged invoice's number, supplier, date, total, and currency, so the screen\nrenders without a request per flag.",
        "operationId": "anomaliesList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client, `kind` to one detector's flags,\n    and `includeDismissed=true` adds the flags somebody already settled.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client, `kind` to one detector's flags,\n    and `includeDismissed=true` adds the flags somebody already settled.",
            "in": "query",
            "name": "Kind",
            "schema": {
              "$ref": "#/components/schemas/InvoiceAnomalyKind"
            }
          },
          {
            "description": "`profileId` narrows to one client, `kind` to one detector's flags,\n    and `includeDismissed=true` adds the flags somebody already settled.",
            "in": "query",
            "name": "IncludeDismissed",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfInvoiceAnomalyResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of flags, newest first. Open flags only, unless\n`includeDismissed=true` asks for history.",
        "tags": [
          "Anomalies"
        ]
      }
    },
    "/v1/anomalies/count": {
      "get": {
        "description": "Never 404s on a clean firm. Zero with an empty per-profile list is the empty\nstate, not a missing resource.",
        "operationId": "anomaliesCount",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceAnomalyCountResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The badge: how many flags still need a look, in total and per client, over the\nprofiles the caller may see.",
        "tags": [
          "Anomalies"
        ]
      }
    },
    "/v1/anomalies/{id}/dismiss": {
      "post": {
        "description": "200 with the flag as it now stands rather than 204, so the screen can show the\nsettled state without a second request. Idempotent: a flag somebody already\ndismissed keeps its first dismisser, and dismissing it again changes nothing.",
        "operationId": "anomaliesDismiss",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceAnomalyResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Marks one flag handled, forever - it never comes back, and detection never\nre-raises the same question on the same invoice. Requires View on the profile\nit belongs to.",
        "tags": [
          "Anomalies"
        ]
      }
    },
    "/v1/api-keys": {
      "get": {
        "operationId": "apiKeysList",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every key this organization has, newest first, revoked ones included. Requires\nthe organization role Admin. Never returns a secret - prefix, last four, scopes,\nand metadata are the whole of it.",
        "tags": [
          "ApiKeys"
        ]
      },
      "post": {
        "description": "The response carries the plaintext key ONCE. It is stored as a SHA-512 hash and\nnothing else, so there is no endpoint - here or anywhere - that can produce it\nagain. A client that does not persist it at this moment has to mint another.\n\n403 covers two different refusals: the caller is not an Admin\n(`forbidden`), or the scopes reached past their own access\n(`api_key_scope_escalation`). The code on the body separates them; the\nstatus does not, because both are the same answer to the caller.",
        "operationId": "apiKeysCreate",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Mints a key. Requires the organization role Admin, and the scopes asked for must\nbe a subset of what the caller holds themselves - including profile narrowing,\nwhere a key is limited to named clients.",
        "tags": [
          "ApiKeys"
        ]
      }
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "description": "Soft: the row stays so every audit entry naming that key id still resolves. \"Revoked\" is a state the key list shows, not a row that vanishes.\n\nA key belonging to another organization answers 404, exactly as a key that never\nexisted does. Revoking one that is already revoked answers 409 rather than\npretending it did something - somebody else got there first, and the caller's\nanswer is to reload.",
        "operationId": "apiKeysRevoke",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "No Content"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Revokes a key, immediately and permanently. Requires the organization role Admin.",
        "tags": [
          "ApiKeys"
        ]
      }
    },
    "/v1/billing": {
      "get": {
        "description": "Never 404s. An organization that has never bought anything gets a body with no\npackage, no subscription, and real usage counts - that is the empty state, not a\nmissing resource. Usage and entitlements are always there; the first two are the\nonly nullable halves.",
        "operationId": "billingGet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingStateResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The organization's billing state: package, subscription, this month's usage, and\nwhat the plan covers. Admin and above.",
        "tags": [
          "Billing"
        ]
      }
    },
    "/v1/billing/change-plan": {
      "post": {
        "description": "Not the same thing as `StartCheckout`, which BUYS a subscription and\ndoes not refuse an organization that has one. A switch sent through checkout is a\nsecond Stripe subscription and a second charge; this moves the existing one.\n\n409 with `billing_no_subscription` when there is nothing to move, and the\nscreen offers checkout instead. 409 with `billing_same_plan` for the package\nthey are already on. 409 with `billing_annual_term_running` when an annual\nsubscriber asks for a monthly package before the year they paid for has finished - that one is the single refusal on this controller that carries\n`details`, holding `currentPeriodEnd` so the screen can print the date\nthe move becomes possible.",
        "operationId": "billingChangePlan",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePlanRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePlanRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSessionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Moves the subscription this organization already has onto a different package, and\nanswers with the Stripe URL where the customer confirms it. Owner only.",
        "tags": [
          "Billing"
        ]
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "description": "Also how an upgrade is bought. Syllevo's pricing: upgrading always beats overflowing, and\nit is never forced - so this endpoint does not refuse a customer who already has a\nsubscription.",
        "operationId": "billingStartCheckout",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartCheckoutRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartCheckoutRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartCheckoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSessionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Starts a hosted Stripe Checkout and answers with the URL to send the browser to.\nOwner only.",
        "tags": [
          "Billing"
        ]
      }
    },
    "/v1/billing/closure": {
      "get": {
        "description": "Never 404s. An organization with nothing scheduled gets `state: \"none\"`.",
        "operationId": "organizationClosureGet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationClosureResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Whether the organization is scheduled for deletion, and when. Admin and above.",
        "tags": [
          "OrganizationClosure"
        ]
      },
      "post": {
        "description": "With a paid period running, the subscription is canceled at its end at Stripe\nand the answer is `state: \"pending\"` with `accessEndsAt`. Without one,\nthe export window starts at once and the answer is `state: \"scheduled\"`;\n`deleteAfter` is set when the first email goes out.\n\nIdempotent: closing twice answers with the same schedule. 409 with\n`billing_gateway_unavailable` when Stripe could not be reached to cancel\nthe subscription, and nothing was changed.",
        "operationId": "organizationClosureClose",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationClosureResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Closes the account. Owner only.",
        "tags": [
          "OrganizationClosure"
        ]
      }
    },
    "/v1/billing/portal": {
      "post": {
        "description": "409 with `billing_no_customer` when this organization has never subscribed.\nThere is nothing to manage yet, and the screen offers checkout instead.",
        "operationId": "billingOpenPortal",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OpenBillingPortalRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenBillingPortalRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenBillingPortalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSessionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Answers with a Stripe Customer Portal URL: payment methods, invoices, plan changes,\nand cancellation. Owner only.",
        "tags": [
          "Billing"
        ]
      }
    },
    "/v1/billing/refund-request": {
      "post": {
        "description": "202, not 200: the request is recorded and a human issues the refund in Stripe,\nso the money has not moved by the time this answers.\n\nNo 409 on this route, and that is the point of it. Syllevo's pricing puts nothing\nbetween the button and the confirmation - no eligibility check, no \"are you\nsure\", no retention offer - so there is nothing here that can refuse. The body\nhas one optional note field and it is never required.",
        "operationId": "billingRequestRefund",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RequestRefundRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestRefundRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestRefundRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundRequestAcceptedResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Asks for the 40-day money-back guarantee. Owner only.",
        "tags": [
          "Billing"
        ]
      }
    },
    "/v1/billing/sync": {
      "post": {
        "description": "What the screen calls when it comes back from Checkout, so that a payment which\nwent through is not left waiting on a webhook that may never arrive. Everything\nit imports is resolved from this organization's own billing customer row: the\nrequest has no body, and it will not grow one - a caller that could name a\nsession, a subscription, or a customer could have somebody else's subscription\nmirrored onto their organization.\n\nNever 404s and rarely refuses. An organization with nothing to reconcile, and a\ncustomer whose subscription has not appeared at Stripe yet, both get 200 and the\nstate as it stands - the second is what the first seconds after a payment\nlegitimately look like. 409 with `billing_gateway_unavailable` is the only\nrefusal, and it means Stripe could not be reached.\n\nRate limited by its own policy rather than the global per-organization budget,\nbecause every call is a live round trip to Stripe. Read\n`BillingSyncRateLimitServiceCollectionExtensions` for the number.",
        "operationId": "billingSync",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingStateResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Re-reads this organization's subscriptions from Stripe, mirrors what they say, and\nanswers with the same body as `Get`. Owner only.",
        "tags": [
          "Billing"
        ]
      }
    },
    "/v1/billing/webhooks/stripe": {
      "post": {
        "description": "200, not 202. Stripe reads any 2xx as delivered and stops retrying, and 200 is what\nits own tooling and dashboard expect; the distinction 202 would draw - \"accepted,\nnot yet acted on\" - is real but is not a distinction Stripe has any way to use.\n\n**It carries its own rate limit policy, and the global one lets it past.** With\n    no policy of its own this endpoint fell into the global limiter's per-address\n    branch at 200 a minute, the same bucket as sign-in and signup, which broke in both\n    directions: Stripe legitimately bursts, so a backlog replayed after an outage would\n    spend everybody's login budget, and a busy login minute would answer 429 to Stripe\n    and stall the subscription changes we are least able to reconstruct. The\n    `RateLimitPolicies.BILLING_WEBHOOK` policy replaces it: the processor\n    gets a volumetric fuse, everybody else gets a strict per-address window, and\n    Program.cs carves the policy out of the global limiter so the two do not stack.\n    Which side a request lands on is a cheap pre-filter on Stripe's published source\n    addresses, never authentication. The signature below is the authentication, and the\n    body limit is what bounds the cost of an unverified request.",
        "operationId": "billingWebhooksReceiveStripeEvent",
        "responses": {
          "200": {
            "content": {
              "application/json": {}
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payload Too Large"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "security": [
          {
            "stripeSignature": []
          }
        ],
        "summary": "Accepts one signed Stripe event. Anonymous, signature-verified, and never processed\ninline.",
        "tags": [
          "BillingWebhooks"
        ]
      }
    },
    "/v1/completeness": {
      "get": {
        "operationId": "completenessGet",
        "parameters": [
          {
            "description": "The calendar month as ISO 8601 year-month - \"2026-08\". Omitted means the month\nrunning now, because an accountant opening the dashboard means \"now\".",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompletenessSummaryResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The organization summary for one month, worst client first.",
        "tags": [
          "Completeness"
        ]
      }
    },
    "/v1/connectors": {
      "get": {
        "description": "Never 404s. A host with every connector switched off answers an empty list, which is\nthe empty state the connect screen renders rather than a missing resource.",
        "operationId": "connectorsCatalog",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ConnectorCatalogEntryResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every connector this host ships, and the inputs each one asks the client for.",
        "tags": [
          "Connectors"
        ]
      }
    },
    "/v1/connectors/accounts": {
      "get": {
        "description": "Never 404s on a client company with nothing connected. That is the empty state,\nnot a missing resource.\n\nThe client company is required, and a caller that leaves it out gets the 400 any\nother malformed request gets. Bound as nullable so that stays true: a plain\n`Guid` binds a missing value to `Guid.Empty`, which\nreaches the permission check and answers a 403 - telling somebody they are not\nallowed to see a client company they never named.",
        "operationId": "connectorsListAccounts",
        "parameters": [
          {
            "in": "query",
            "name": "profileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ConnectorAccountResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every supplier account connected for one client company. Requires View on the client\ncompany.",
        "tags": [
          "Connectors"
        ]
      }
    },
    "/v1/connectors/accounts/{accountId}": {
      "delete": {
        "description": "204 rather than 200 with the row: the account is gone, so a body describing it would\ndescribe something that no longer exists. Nothing already collected through it is\ntouched, because the never-lose-a-document rule has no exception for a disconnected source.",
        "operationId": "connectorsDisconnect",
        "parameters": [
          {
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "No Content"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Tells the supplier we are done and removes the source. Requires ManageSources on the\nclient company.",
        "tags": [
          "Connectors"
        ]
      }
    },
    "/v1/connectors/{slug}/callback": {
      "post": {
        "description": "POST with the state and the whole query in the body rather than a GET the\nsupplier redirects straight to, exactly like the e-Factura callback. The\nredirect lands in the accountant's browser on the web app, which posts it here\non the authenticated session, so the callback is checked against the person and\nthe firm that started it and nothing secret travels in a URL this API logs.\n\nThe query is forwarded whole. Every supplier spells its callback differently and\nthe connector behind the slug is the only thing that should know how this one\ndoes.",
        "operationId": "connectorsCallback",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteConnectorConnectRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteConnectorConnectRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteConnectorConnectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorAccountResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Finishes a redirect approval from what the supplier sent back. Requires\nManageSources on the client company.",
        "tags": [
          "Connectors"
        ]
      }
    },
    "/v1/connectors/{slug}/connect": {
      "post": {
        "description": "Open the URL in a top level tab. Suppliers put their consent pages behind frame\nbusting headers, so an iframe shows the accountant a blank rectangle.",
        "operationId": "connectorsConnect",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BeginConnectorConnectRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BeginConnectorConnectRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BeginConnectorConnectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorAuthorizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Starts a redirect approval and answers with the URL to open. Requires ManageSources\non the client company.",
        "tags": [
          "Connectors"
        ]
      }
    },
    "/v1/connectors/{slug}/credentials": {
      "post": {
        "description": "The submitted fields are never logged, never audited, and never echoed back, not\neven on a refusal. A value that reached a browser once is in a support\nticket forever.",
        "operationId": "connectorsSubmitCredentials",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitConnectorCredentialsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitConnectorCredentialsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitConnectorCredentialsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectorAccountResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Connects a supplier from a secret the client pasted, once the connector has proved\nit works. Requires ManageSources on the client company.",
        "tags": [
          "Connectors"
        ]
      }
    },
    "/v1/digest-preferences": {
      "get": {
        "description": "Never 404s. Somebody who has never opened the setting has no row and is on the\nweekly default, which is what this returns - a missing row is an answer, not a\nmissing resource.",
        "operationId": "digestPreferencesGet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DigestPreferenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The caller's own frequency in the current organization.",
        "tags": [
          "DigestPreferences"
        ]
      },
      "put": {
        "description": "An upsert, so the screen can save without knowing whether a row exists, and\nidempotent, so a double-click leaves one row rather than two settings that\ndisagree. `Off` is the opt-out and is honored before the pass reads\nanything else.",
        "operationId": "digestPreferencesUpdate",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDigestPreferenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDigestPreferenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDigestPreferenceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DigestPreferenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Sets the caller's own frequency in the current organization, and returns it.",
        "tags": [
          "DigestPreferences"
        ]
      }
    },
    "/v1/documents": {
      "get": {
        "description": "Without `profileId` this is the firm-wide view, narrowed in the query to the\nclients the caller may see - so an actor with no grants gets an empty page rather\nthan a 403, exactly as the profile list does. With `profileId` that same set\nis intersected down to the one client: the parameter narrows and never widens, so\nnaming a client the caller cannot see is an empty page too, not a 403.",
        "operationId": "documentsList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "Status",
            "schema": {
              "$ref": "#/components/schemas/DocumentStatus"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "Period",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "SupplierId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "Source",
            "schema": {
              "$ref": "#/components/schemas/DocumentSourceKind"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "Filing",
            "schema": {
              "$ref": "#/components/schemas/DocumentFilingFilter"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "From",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "To",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "SortBy",
            "schema": {
              "$ref": "#/components/schemas/DocumentSortField"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "SortDirection",
            "schema": {
              "$ref": "#/components/schemas/SortDirection"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "Trashed",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "`profileId` narrows to one client. `status` is how the dashboard asks\n    what is still waiting to be read, and `period` (`YYYY-MM`) narrows to\n    the month a document ARRIVED in - arrival and not issue date, because \"what came\n    in for October\" is the question month-end asks of a collected original.\n    `supplierId` keeps only documents that evidence an invoice from that company,\n    and `from`/`to` are inclusive arrival days for a range that is not a\n    whole month. Sending a period and a range together means the overlap of the two.\n    `sortBy` and `sortDirection` order the whole filtered set before it is\n    paged, so sorting a column moves rows between pages rather than shuffling the page\n    on screen.",
            "in": "query",
            "name": "Direction",
            "schema": {
              "$ref": "#/components/schemas/InvoiceDirection"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfDocumentResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of collected documents, newest arrival first.",
        "tags": [
          "Documents"
        ]
      },
      "post": {
        "description": "A multipart form with one file part named `file` and one `profileId`\nfield. The file's declared type is checked against its own leading bytes before\nanything is stored, and the original is written to immutable\nstorage before any row exists.\n\n201 for a document we did not have. 200 when these exact bytes were already\ncollected for this profile: the upload merged its arrival onto the existing\ndocument and created nothing, which is what\n`DocumentUploadResponse.Duplicate` says. That is a success, not an\nerror - the accountant asked us to make sure we had it, and we do.\n\nThis action is\ngoverned by the global limiter's `org:` partition, which is what an\nauthenticated multi-tenant endpoint needs: a budget keyed on the organization\ndoing the uploading. It briefly carried the `\"ingestion\"` policy, which\nreads like strictness and is the opposite - that policy is ONE window\npartitioned by nothing, so it would have let one firm's month-end upload run\nspend every other firm's budget, and would have put those uploads in\ncontention with inbound mail at exactly the moment both peak. The fuse's\nreasons do not reach here either: there is no HMAC to protect, and the body is\nalready bounded by the two attributes below.\n\nThe rule, because this is where someone will be tempted: an authenticated,\nmulti-tenant endpoint NEVER sits behind an unpartitioned bucket. Whatever the\nnumber is, it is keyed on the organization.",
        "operationId": "documentsUpload",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "properties": {
                      "profileId": {
                        "format": "uuid",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    },
                    "type": "object"
                  }
                ],
                "required": [
                  "profileId",
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUploadResponse"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUploadResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Drops a document in by hand - the invoice a client handed over on paper, or the\none that arrived outside every connected source. Requires ManageDocuments on the\nprofile.",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/facets": {
      "get": {
        "description": "Same query, same visibility rule, and the same empty-rather-than-refused\nanswer as the list. Each set of counts ignores the filter it is offering - the\nstatus counts ignore `status`, the month counts ignore `period` -\nwhich is what makes a number next to a filter value mean \"this is what you\nwould get if you picked this\". Every other filter still applies to both.\n\nSorting is accepted and ignored, because the query is the list's query and a\ncount has no order.",
        "operationId": "documentsFacets",
        "parameters": [
          {
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "Status",
            "schema": {
              "$ref": "#/components/schemas/DocumentStatus"
            }
          },
          {
            "in": "query",
            "name": "Period",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "SupplierId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "Source",
            "schema": {
              "$ref": "#/components/schemas/DocumentSourceKind"
            }
          },
          {
            "in": "query",
            "name": "Filing",
            "schema": {
              "$ref": "#/components/schemas/DocumentFilingFilter"
            }
          },
          {
            "in": "query",
            "name": "From",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "To",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "SortBy",
            "schema": {
              "$ref": "#/components/schemas/DocumentSortField"
            }
          },
          {
            "in": "query",
            "name": "SortDirection",
            "schema": {
              "$ref": "#/components/schemas/SortDirection"
            }
          },
          {
            "in": "query",
            "name": "Trashed",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "Direction",
            "schema": {
              "$ref": "#/components/schemas/InvoiceDirection"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentFacetsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "How many documents sit behind each choice on the list's filters.",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}": {
      "delete": {
        "description": "Nothing is destroyed here, which is why a product that promises never to lose a\ndocument can offer a delete button at all. The original, the extracted text, and\nthe invoice links all stay; the document disappears from lists, facets, exports,\nhandover packs, and completeness counts, and it can be brought back for sixty\ndays. After that a daily job removes it for good.\n\n204 whether or not the document was already in the trash. A double-clicked\nbutton and a retried request are the same act, and the second one must not move\nthe clock somebody is counting down from.\n\n`driveTrashBehavior` carries the answer the confirm dialog\n    collected about the copy in the firm's Google Drive, and only the FIRST answer\n    counts: it is saved as the firm's setting when none is stored yet and ignored\n    after that, because changing it belongs on the Google Drive settings screen where\n    the three choices are written out. Omit it - which every other caller does - and\n    the firm's stored answer decides, with \"leave it alone\" for a firm nobody has\n    asked. A value outside the three is a 400, and nothing about Drive can fail the\n    removal itself.",
        "operationId": "documentsDelete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "driveTrashBehavior",
            "schema": {
              "$ref": "#/components/schemas/FilingTrashBehavior"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "No Content"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Moves a document to the trash. Requires ManageDocuments on the profile it belongs\nto.",
        "tags": [
          "Documents"
        ]
      },
      "get": {
        "description": "Provenance is here and not on the list for a reason: it is the answer to \"where\ndid this come from\", which is a question asked about one document at a time, and\nit grows with every source the same invoice reached us through.",
        "operationId": "documentsGet",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDetailResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One document and every arrival it has had. Requires View on the profile it\nbelongs to.",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/download": {
      "get": {
        "description": "The response is a URL, not the file: documents never stream through the API when\na presigned URL will do. The link is a bearer credential for that\none document and expires within minutes, so clients fetch it and follow it rather\nthan saving it. Every issued link is an audit entry.",
        "operationId": "documentsDownload",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDownloadResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "A short-lived link to the stored original. Requires View on the profile.",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/documents/{id}/restore": {
      "post": {
        "description": "POST rather than DELETE-with-a-flag, and it returns the document rather than 204,\nbecause the screen this serves puts the row straight back in the list it came from\nand would otherwise have to fetch it again to draw it. Idempotent: restoring a\ndocument that is already live returns it unchanged.",
        "operationId": "documentsRestore",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDetailResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Brings a document back out of the trash. Requires ManageDocuments on the profile.",
        "tags": [
          "Documents"
        ]
      }
    },
    "/v1/efactura/callback": {
      "post": {
        "description": "POST with the code and the state in the body rather than a GET ANAF redirects\nstraight to. The redirect lands in the accountant's browser on the web app,\nwhich posts it here on the authenticated session - so the callback can be checked\nagainst the person and the firm that started it, and the code never travels in a\nURL this API logs.\n\n409 with `efactura-state-invalid` when the state does not check out, and\nwith `efactura-invalid-grant` when the sixty seconds ran out. Both mean the\nsame thing to the screen: start again, the USB token is still in your hand.",
        "operationId": "eFacturaCallback",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteEFacturaConnectRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteEFacturaConnectRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteEFacturaConnectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EFacturaConnectionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Finishes a connect: trades the authorization code for a token pair and stores the\ngrant. Admin and above.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/efactura/connect": {
      "post": {
        "description": "The response carries a translation key for the browser warning as well as the\nURL, and the screen has to render it: ANAF does not support the certificate step\nin Firefox, where the page loads and the certificate picker simply never appears.\n\n409 with `efactura-not-configured` when the state could not be parked in the\nshared cache. Nothing is worth sending the accountant to the USB token for if the\ncallback cannot be completed afterwards.",
        "operationId": "eFacturaConnect",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EFacturaAuthorizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Starts a connect and answers with the URL to send the browser to. Admin and above.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/efactura/connections": {
      "get": {
        "description": "Never 404s on an empty firm. A firm that has never connected a certificate gets an\nempty list - that is the empty state, not a missing resource.",
        "operationId": "eFacturaListConnections",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EFacturaConnectionResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every grant this firm holds, disconnected and expired ones included. Admin and above.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/efactura/connections/{id}": {
      "delete": {
        "description": "200 with the disconnected grant rather than 204, so the screen can show what it now\nis without a second request. Nothing already collected through it is touched -\nthe never-lose-a-document rule has no exception for a disconnected source.",
        "operationId": "eFacturaDisconnect",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EFacturaConnectionResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Hands a grant back to ANAF and marks it disconnected here. Admin and above.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/efactura/connections/{id}/companies": {
      "get": {
        "description": "What the picker on \"add an e-Factura source\" is built from, so the person adding\na client chooses a company instead of typing a fiscal code from memory.\n\n**`status: 0` is a normal answer, not an error.** ANAF publishes no\n    endpoint that lists a certificate's companies - the list only appears on a\n    message listing that actually carried messages - so a firm whose clients have\n    been quiet has nothing to show yet. The screen falls back to an input box and\n    says so in one line. ANAF being unreachable or rate limited reads the same way,\n    deliberately: a slow tax authority must not become a page nobody can add a client\n    on.\n\n`profileId` is required and 400 without it. It is the profile\n    `ManageSources` is checked against - the same gate as the enrollment this\n    feeds - and what decides which companies come back marked as already added.",
        "operationId": "eFacturaListCompanies",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "profileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EFacturaCompaniesResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The client companies this grant's certificate may collect for. Requires\nManageSources on `profileId`.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/efactura/enrollments": {
      "post": {
        "description": "The response carries `rightsStatus: Unknown` on the day of enrollment, and that\nis the correct answer rather than a pending one: ANAF activates SPV rights for a new\ndelegation in a nightly batch, so nothing can be known about them until tomorrow.",
        "operationId": "eFacturaEnroll",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEFacturaEnrollmentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEFacturaEnrollmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEFacturaEnrollmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EFacturaEnrollmentResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Enrolls one client company's fiscal code against a grant. Requires ManageSources on\nthe profile.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/efactura/enrollments/{accountId}/scope": {
      "put": {
        "operationId": "eFacturaSetScope",
        "parameters": [
          {
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEFacturaScopeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEFacturaScopeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEFacturaScopeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EFacturaEnrollmentResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Changes what one enrollment files. Requires ManageSources on the profile. Widening\nto Everything also queues every held invoice for filing.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/efactura/profiles/{profileId}/enrollments": {
      "get": {
        "operationId": "eFacturaListEnrollments",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EFacturaEnrollmentResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every client company enrolled on one profile, and where each cursor stands. Requires\nView on the profile.",
        "tags": [
          "EFactura"
        ]
      }
    },
    "/v1/exports/organization": {
      "get": {
        "description": "The archive is streamed as it is built, so the response starts immediately and\nnothing is buffered on either side. A firm with three hundred clients gets one\nfile; there is no paging and no job to poll.",
        "operationId": "exportsOrganization",
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Everything the organization holds: every client, every document original, and all\nthe structured data as JSON and CSV. Admin and above.",
        "tags": [
          "Exports"
        ]
      }
    },
    "/v1/exports/profiles/{id}": {
      "get": {
        "description": "The export half of profile offboarding: a firm that has lost a\nclient hands this file over, or keeps it, before the profile is deleted or\ntransferred.",
        "operationId": "exportsProfile",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Everything Syllevo holds for one client company. Requires View on the profile.",
        "tags": [
          "Exports"
        ]
      }
    },
    "/v1/ingestion/email": {
      "post": {
        "description": "202, not 201 and not 200. The message is stored and queued; whether it becomes a\ndocument depends on parsing that has not happened yet, and telling the edge\n\"created\" would be claiming more than is true. A quarantined message - one no\naddress claimed - is a 202 as well: the edge did its job, and Syllevo refuses\nto let a misdirected invoice be dropped just because we cannot file it yet.",
        "operationId": "ingestionReceiveEmail",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailIngestionAcceptedResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payload Too Large"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "security": [
          {
            "ingestionSignature": []
          }
        ],
        "summary": "Accepts one inbound email. Anonymous, HMAC-verified, and rate limited by the\nstrictest policy this API has.",
        "tags": [
          "Ingestion"
        ]
      }
    },
    "/v1/ingestion/unfiled": {
      "get": {
        "description": "Narrowed in the query to the clients the caller may manage sources for, so an\nactor with no such grant gets an empty page rather than a 403 - the same answer\nthe firm-wide source list gives. `profileId` and `accountId` are\nfilters inside that set, never a way to reach a client outside it.\n\nEvery link on every item carries the API's own ruling, and the API is where that\ndecision is made. The verdict says whether Syllevo recognizes the sender and the\nhost together; it never says a link is safe, and nothing rendering this may\neither.",
        "operationId": "unfiledEmailsList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client, `accountId` to one source, and\n    `unresolvedOnly=true` to what nobody has dealt with yet.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client, `accountId` to one source, and\n    `unresolvedOnly=true` to what nobody has dealt with yet.",
            "in": "query",
            "name": "AccountId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client, `accountId` to one source, and\n    `unresolvedOnly=true` to what nobody has dealt with yet.",
            "in": "query",
            "name": "UnresolvedOnly",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfUnfiledEmailResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of unfiled mail, newest arrival first.",
        "tags": [
          "UnfiledEmails"
        ]
      }
    },
    "/v1/ingestion/unfiled/{id}/resolve": {
      "post": {
        "description": "One verb for both readings, and dismissing is not a second endpoint. The record\ncarries a single resolved timestamp, and the forward budget, the source's health\npill, and the retention clock all read it the same way whichever the person\nmeant - so a \"dismiss\" route would be a second name for one write. Label the\nbutton whichever way the screen needs.\n\n200 with the item as it now stands rather than 204, so the screen can show the\nsettled state without a second request. Idempotent: an item somebody already\nclosed keeps its first resolver, and pressing again changes nothing.",
        "operationId": "unfiledEmailsResolve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnfiledEmailResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Closes one item: the invitation was accepted, the code was used, or the mail was\nnoise. Requires ManageSources on the client the source belongs to.",
        "tags": [
          "UnfiledEmails"
        ]
      }
    },
    "/v1/invitations": {
      "get": {
        "description": "Invitations that have run out are included, with `expired` set, because the\nanswer on the settings screen has to be \"expired, resend\" rather than the row\nquietly disappearing and the accountant wondering whether they ever sent it.",
        "operationId": "invitationsList",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every invitation this firm still has open, newest first. Requires the organization\nrole Admin.",
        "tags": [
          "Invitations"
        ]
      },
      "post": {
        "description": "An Admin may invite a Member; the Owner may invite an Admin or a Member\n(`invitation_role_not_allowed`). Nobody invites an Owner: a firm has one,\nand it changes hands through the members surface rather than by mail to an\naddress nobody has verified.\n\n201 even when the email did not go out. The row is stored either way and comes\nback with `emailSent` false, because the accountant can act on that: read\nthe address back, fix it, resend. Nobody can act on a 500.\n\n409 when the address already belongs to somebody in this firm\n(`invitation_already_member`), and 404 naming a profile id when the grants\nname a client this organization does not own.",
        "operationId": "invitationsCreate",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Invites an address, or renews and resends the invitation that address already has.\nRequires the organization role Admin.",
        "tags": [
          "Invitations"
        ]
      }
    },
    "/v1/invitations/{invitationId}": {
      "delete": {
        "description": "DELETE, and the row stays. What is deleted is the offer, not the record of it: the\ninvitation is marked revoked, which is the trail entry answering \"somebody was\ngiven access to this firm and it was taken back before they used it\". 204 rather\nthan the revoked row, because there is nothing on it a screen needs once the list\nrefreshes.",
        "operationId": "invitationsRevoke",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "No Content"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Withdraws an invitation. Requires the organization role Admin.",
        "tags": [
          "Invitations"
        ]
      }
    },
    "/v1/invitations/{invitationId}/resend": {
      "post": {
        "description": "The renewal is the point. Somebody who has to be asked twice was asked too early\nrather than too late, and an invitation that arrives with two days left on it is\none more thing for the accountant to chase. 409 when the row is no longer pending\n(`invitation_not_pending`), and 200 with `emailSent` false when the send\nitself failed.",
        "operationId": "invitationsResend",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Sends the invitation again and puts its clock back to a full lifetime. Requires the\norganization role Admin.",
        "tags": [
          "Invitations"
        ]
      }
    },
    "/v1/invoices": {
      "get": {
        "description": "Without `profileId` this is the firm-wide view, narrowed in the query to the\nclients the caller may see - so an actor with no grants gets an empty page rather\nthan a 403, exactly as the profile list does. With `profileId` that same set\nis intersected down to the one client: the parameter narrows and never widens, so\nnaming a client the caller cannot see is an empty page too, not a 403.\n\nEvery invoice carries the series and sequence read off its number\n(`numberSeries`, `numberSequence`). `sortBy=number` orders by\nthem: series first with numbers that have no series last, then the client, the\nyear of issue, and the sequence as a number, so \"SYL 9\" comes before \"SYL 10\".",
        "operationId": "invoicesList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "From",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "To",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "Direction",
            "schema": {
              "$ref": "#/components/schemas/InvoiceDirection"
            }
          },
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "Series",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "WithoutSeries",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "SortBy",
            "schema": {
              "$ref": "#/components/schemas/InvoiceSortField"
            }
          },
          {
            "description": "`profileId` narrows to one client. `from` and `to` bound the ISSUE\n    date and are both INCLUSIVE, because an accountant asking for the 1st to the 31st\n    means the 31st - the issue date, not the arrival date, is what decides which\n    month a document belongs to. `series` narrows to one numbering series and\n    `withoutSeries=true` to the numbers with none; sending both is a 400.",
            "in": "query",
            "name": "SortDirection",
            "schema": {
              "$ref": "#/components/schemas/SortDirection"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfInvoiceResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of invoices, newest issue date first unless `sortBy` asks otherwise.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/v1/invoices/facets": {
      "get": {
        "description": "Same visibility rule, and the same empty-rather-than-refused answer, as the list.\nEach set ignores the filter it is offering, so a number beside a choice means\n\"this is what you would get if you picked it\": the month counts ignore\n`from` and `to`, the series counts ignore `series` and\n`withoutSeries`. Every other filter applies to both.\n\nMonths come oldest first and only when they hold an invoice. Series come per\nclient, ordered by series with the numbers that have none last, then by client.",
        "operationId": "invoicesFacets",
        "parameters": [
          {
            "description": "The list's filters, without paging and order.",
            "in": "query",
            "name": "Direction",
            "schema": {
              "$ref": "#/components/schemas/InvoiceDirection"
            }
          },
          {
            "description": "The list's filters, without paging and order.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The list's filters, without paging and order.",
            "in": "query",
            "name": "From",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "The list's filters, without paging and order.",
            "in": "query",
            "name": "To",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "The list's filters, without paging and order.",
            "in": "query",
            "name": "Series",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The list's filters, without paging and order.",
            "in": "query",
            "name": "WithoutSeries",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceFacetsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "How many invoices sit behind each choice on the list's filters: each month of issue\ndate, and each client's numbering series.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/v1/invoices/number-gaps": {
      "get": {
        "description": "Sales only. Numbers are compared per client, series, and year of issue, because\nmost series restart every January. A number on several invoices counts once, so a\nduplicate is never a gap, and nothing is claimed below the first number on file or\nabove the last.\n\n`from` and `to` pick which gaps are listed, not which sales are read: a\n    gap is listed when the sale on either side of it was issued inside the range, and\n    those sales are found over the whole year. `series` and `withoutSeries`\n    narrow which series are looked at.\n\nSame visibility rule, and the same empty-rather-than-refused answer, as the list.\nAt most 200 gaps come back, ordered by series with the numbers that have none last,\nthen by client, year, and the number before the gap; the totals count every gap.",
        "operationId": "invoicesNumberGaps",
        "parameters": [
          {
            "description": "The client, the issue-date range, and the series to look at.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The client, the issue-date range, and the series to look at.",
            "in": "query",
            "name": "From",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "The client, the issue-date range, and the series to look at.",
            "in": "query",
            "name": "To",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "The client, the issue-date range, and the series to look at.",
            "in": "query",
            "name": "Series",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The client, the issue-date range, and the series to look at.",
            "in": "query",
            "name": "WithoutSeries",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceNumberGapsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Where the sales numbering skips: \"SYL 0041\" and then \"SYL 0044\" means two sales the\nbusiness issued are not in Syllevo yet.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/v1/invoices/{id}": {
      "get": {
        "description": "The links are ids, not files. Fetching an original goes through the documents\nendpoints, where the short-lived download link and its audit entry live - one\ndoor out for a stored document, not two.",
        "operationId": "invoicesGet",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One invoice with the documents that evidence it, most trusted first. Requires\nView on the profile it belongs to.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/v1/me/invitations": {
      "get": {
        "description": "Never 404s and never 403s. Somebody nobody invited gets an empty list, which is the\nordinary answer. Invitations that have run out are left out here rather than shown\nas expired: the only two buttons on this screen are accept and decline, and a card\noffering neither is a card nobody can act on. The same list is on the sign-in\nresponse, so an invited person lands on the firm that asked for them instead of on\na create-a-firm form.",
        "operationId": "myInvitationsList",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PendingInvitationResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every firm waiting for this person, newest first.",
        "tags": [
          "MyInvitations"
        ]
      }
    },
    "/v1/me/invitations/{invitationId}/accept": {
      "post": {
        "description": "The response is the switcher row on purpose: the client can put the new firm\nstraight into the switcher and send its id in `X-Organization-Id` on the\nvery next request, with no second round trip to find out what it just joined.\n\nIdempotent for somebody who is already a member: the invitation is marked\naccepted and the membership they have comes back. Two clicks on the same button\nmust not tell a person who just joined that something went wrong.\n\n409 with `invitation_expired` when it has run out, which is a state the\nscreen can act on by asking for a new one.",
        "operationId": "myInvitationsAccept",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMembershipResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Joins the firm, and hands back the membership in the shape the organization\nswitcher reads.",
        "tags": [
          "MyInvitations"
        ]
      }
    },
    "/v1/me/invitations/{invitationId}/decline": {
      "post": {
        "description": "The firm sees the row as declined rather than as pending forever, which is the\npoint: an accountant who knows the answer was no can invite the right address\ninstead of waiting out fourteen days. 204, because there is nothing left on the\ncard once the list refreshes.",
        "operationId": "myInvitationsDecline",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "No Content"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Turns the offer down.",
        "tags": [
          "MyInvitations"
        ]
      }
    },
    "/v1/members": {
      "get": {
        "description": "The grant count is distinct PROFILES, not permission rows, and it comes with\n`hasOrganizationWideAccess` next to it. Read the count alone and an Owner\nwith no grant rows looks like somebody who can see nothing, when in fact they\nreach every client the firm has.",
        "operationId": "organizationMembersList",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OrganizationMemberResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Everyone in the organization, alphabetically by email, with how many client\nprofiles each of them has been granted. Requires the organization role Admin.",
        "tags": [
          "OrganizationMembers"
        ]
      }
    },
    "/v1/members/{memberId}": {
      "delete": {
        "description": "The membership row goes and its client access goes with it, so the firm leaves\nthat person's switcher on their next request. The person stays: their user row\nis untouched, every audit entry naming them still resolves, and every document\nthey filed still says who filed it. That is the difference between taking away\n\"may act here\" and erasing \"this happened\", and only the first is a thing a\nsettings screen should be able to do.\n\nRefused for the caller themselves (`member_self_grant_change`) because\nnobody should be able to lock themselves out of the firm they administer, for\nthe Owner (`member_owner_protected`) because an account with no owner is a\nstate nothing here can resolve, and for anybody not below the caller\n(`member_role_not_below_caller`).",
        "operationId": "organizationMembersRemove",
        "parameters": [
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "No Content"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Takes a colleague out of the organization. Requires the organization role Admin.",
        "tags": [
          "OrganizationMembers"
        ]
      }
    },
    "/v1/members/{memberId}/grants": {
      "get": {
        "description": "A member id belonging to another firm answers 404, exactly as one that never\nexisted does. Distinguishing them would let one firm enumerate another's staff by\nreading status codes.",
        "operationId": "organizationMembersGetGrants",
        "parameters": [
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberGrantsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One member's profile-access grid. Requires the organization role Admin.",
        "tags": [
          "OrganizationMembers"
        ]
      },
      "put": {
        "description": "PUT, and replace-set, because the screen is a grid saved as a whole. The same\nbody twice leaves the same access, writes nothing the second time, and adds no\nsecond entry to the audit trail. An empty list is a legitimate save: it means\nthis person is granted no clients.\n\n403 covers three different refusals and the code on the body separates them:\nthe caller is not an Admin (`forbidden`), the grid being saved is their\nown (`member_self_grant_change`), or it belongs to a colleague at their\nown role or above (`member_role_not_below_caller`). The second is a\nlockout guard - the person saving is the person who would lose the client list\nthey need in order to put it back, so a colleague makes that change instead.\nThe third is the role ladder: an Owner may edit an Admin, an Admin may edit a\nmember, and nobody edits sideways.\n\nA profile id that is not one of this organization's answers 404, naming that id.\nThe caller is an Admin of this firm asking about this firm's clients, so the id\nis the actionable part rather than something to hide.",
        "operationId": "organizationMembersReplaceGrants",
        "parameters": [
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceMemberGrantsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceMemberGrantsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceMemberGrantsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberGrantsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Saves the member's whole access grid, replacing whatever was there. Requires the\norganization role Admin.",
        "tags": [
          "OrganizationMembers"
        ]
      }
    },
    "/v1/members/{memberId}/role": {
      "put": {
        "description": "Owner rather than Admin, and that is the design rather than caution. Admin is\norganization-wide access to every client the firm has, so an Admin able to\npromote would be an Admin able to hand that access to anyone, and a firm would\nbe one compromised office account away from giving its whole client list to a\nstranger. The person who owns the account decides who gets the keys to all of\nit.\n\n403 covers three refusals and the code on the body separates them: the caller\nis not the Owner (`forbidden`), the row is their own\n(`member_self_grant_change`), or it is the Owner row\n(`member_owner_protected`, because there is one Owner and it moves through\nthe transfer below). A role that is neither Admin nor Member is\n`member_role_not_allowed`. Sending the role the member already has is a\n200 that changed nothing and wrote no trail entry.",
        "operationId": "organizationMembersChangeRole",
        "parameters": [
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeMemberRoleRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeMemberRoleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeMemberRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Moves a colleague between Admin and Member. Requires the organization role Owner.",
        "tags": [
          "OrganizationMembers"
        ]
      }
    },
    "/v1/members/{memberId}/transfer-ownership": {
      "post": {
        "description": "Its own route rather than a role change to Owner, because a firm has exactly\none Owner and a screen that let somebody set a second would produce a state\nnothing here knows how to resolve. Both rows move together or neither does.\n\nThe one operation in the product that takes authority away from the person\nasking for it, which is why the client should confirm it out loud before\ncalling: after this the caller is an Admin, and getting the account back is\nsomething only the new Owner can do. The new Owner is told by email, and a mail\nserver that is down does not undo the handover.",
        "operationId": "organizationMembersTransferOwnership",
        "parameters": [
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Hands the account to somebody else: the target becomes Owner and the caller becomes\nAdmin, in one transaction. Requires the organization role Owner, and answers with\nthe new Owner.",
        "tags": [
          "OrganizationMembers"
        ]
      }
    },
    "/v1/onboarding/session": {
      "post": {
        "description": "**Idempotent, and meant to be called on every sign-in** rather than only on\n        the first one. Calling it twice resolves the same row; two tabs calling it at\n        the same moment converge on one.\n\nA POST rather than a GET because it can create a row, which is exactly what it\nis for. It is not cacheable and must not be treated as safe.",
        "operationId": "onboardingStartSession",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/OnboardingSessionRequest"
                  }
                ]
              }
            },
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/OnboardingSessionRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/OnboardingSessionRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingSessionResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Announces a sign-in: creates this person's row if it is their first time, and\nanswers with who they are, which firms they can act in, and what is waiting for\nthem.",
        "tags": [
          "Onboarding"
        ]
      }
    },
    "/v1/organization": {
      "get": {
        "description": "No role attribute and none is missing. Every member sees the firm's name and logo\nin the header of every screen; requiring Admin would hide the product's own\nbranding from the people using it. Changing either is a different matter - see\nthe two actions below.",
        "operationId": "organizationGet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The firm this request is acting in: its name, its locale, and its logo links.",
        "tags": [
          "Organization"
        ]
      },
      "put": {
        "description": "PUT and the whole shape every time, matching\n`PUT /v1/organization/settings` next door. Two fields, both of which the\nsignup form already asked for, so there is no partial update to express and no\nsecond meaning for an absent field.\n\nStill no id in the path, for the reason at the top of this class. Renaming acts\non the firm the `X-Organization-Id` header names and the actor was already\nvalidated against, so there is no path segment a caller could edit to rename\nsomebody else's firm.\n\nAnswers with the whole organization, logo links included, so the settings screen\nthat just saved can redraw its own header without a second call.",
        "operationId": "organizationUpdate",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Renames the firm and sets the language it works in. Requires the organization role\nAdmin, enforced in the service.",
        "tags": [
          "Organization"
        ]
      }
    },
    "/v1/organization/avatar": {
      "delete": {
        "operationId": "organizationDeleteAvatar",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Removes the firm's logo. Admin, and idempotent: removing one that is already gone\nanswers 200 with the organization rather than 404.",
        "tags": [
          "Organization"
        ]
      },
      "post": {
        "description": "The two limits below are a pair. `RequestFormLimits` caps the FILE part so an\noversized upload is refused as it streams; `RequestSizeLimit` caps the whole\nbody a megabyte higher, so a file exactly at the limit is not killed for the\nmultipart framing around it. The validator's ceiling runs first on the length the\nreader measured, which is what makes \"too big\" a translated 400 rather than a bare\n413.",
        "operationId": "organizationSetAvatar",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Sets or replaces the firm's logo. Requires the organization role Admin, enforced\nin the service.",
        "tags": [
          "Organization"
        ]
      }
    },
    "/v1/organization/settings": {
      "get": {
        "description": "A firm that has never saved gets the shipped defaults with `isDefaulted` true\nand no id. Reading settings never creates a row - the first PUT does.",
        "operationId": "organizationSecuritySettingsGetSettings",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationSecuritySettingsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The firm's security toggles. Requires the Admin organization role.",
        "tags": [
          "OrganizationSecuritySettings"
        ]
      },
      "put": {
        "description": "The whole row is sent every time. An Admin may re-send the stored\n`enforceTwoFactor` value unchanged - only MOVING it needs an Owner, so\nsaving the MCP toggle is not accidentally an Owner-only act.\n\nSwitching `mcpEnabled` off closes the MCP door for the whole firm on the\nnext tool call. It cannot switch it on beyond what the package and the deployment\nalready allow: the firm's toggle is ANDed with those two, never ORed.",
        "operationId": "organizationSecuritySettingsUpdateSettings",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationSecuritySettingsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationSecuritySettingsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationSecuritySettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationSecuritySettingsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Replaces the firm's security toggles. Requires the Admin organization role, and the\nOwner role to change `enforceTwoFactor`.",
        "tags": [
          "OrganizationSecuritySettings"
        ]
      }
    },
    "/v1/organization/stats": {
      "get": {
        "description": "No role attribute and none is missing. Every member gets these numbers for their\nown portfolio: a member holding 30 of the firm's 200 clients is told about those\n30, so there is no wider answer to gate. The archived count is the one number that\ncovers clients outside the working set, and it is a count with no names in it.",
        "operationId": "organizationStatsGetStats",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationStatsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "How many clients the firm works with, how many it has archived, and how much has\nbeen collected for the ones it works with.",
        "tags": [
          "OrganizationStats"
        ]
      }
    },
    "/v1/organization/suppliers": {
      "get": {
        "description": "There is no permission attribute here and none is missing. The gate is View\nand the service applies it: it asks the authorization service which profile\nids the actor can see and narrows the query to those, so a member who is on\n3 of a firm's 40 clients gets those 3 clients' suppliers and a total of that\nmany.\n\nView, and the reason is that it is the permission the per-client route asks\nfor to read the same rows, so the roster can never answer a question\nthe per-client route would refuse. Moving either route's gate without the\nother is a widening in one direction or a quiet narrowing in the other: the\nroster alone makes this the more permissive of the two doors, and the\nper-client route alone makes the roster claim a client has no suppliers while\nclicking into it shows them.\n\nRead only, and there is nothing to pair it with. Supplier rows are created and\nmerged by the ingestion pipeline, which owns the dedupe rule, and the one place\na person adds one by hand is the directory path - which runs that same rule rather\nthan a second one.\n\nA member whose visible clients have no suppliers gets an empty page, not a 403,\nand so does an actor who can see no clients at all. That is deliberate and\nshould not later be \"fixed\" into a 403: a short portfolio is not a forbidden\nquestion, and refusing would confirm there are rows behind the refusal.\n\nEach row carries its `profileId`, which is what makes the roster groupable\nwithout a second lookup per row, and the page is ordered by profile so one\nclient's suppliers arrive together.",
        "operationId": "organizationSuppliersList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client, and `search` is the case-insensitive\n    name match the per-client route takes, applied here across the portfolio. Both\n    narrow within the set the caller can already see; neither widens anything, and a\n    client the caller cannot see is an empty page rather than a refusal.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client, and `search` is the case-insensitive\n    name match the per-client route takes, applied here across the portfolio. Both\n    narrow within the set the caller can already see; neither widens anything, and a\n    client the caller cannot see is an empty page rather than a refusal.",
            "in": "query",
            "name": "Search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfSupplierResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of the suppliers of every client this actor can see, grouped by client\ncompany.",
        "tags": [
          "OrganizationSuppliers"
        ]
      }
    },
    "/v1/organization/trend": {
      "get": {
        "description": "Days are UTC days and count ARRIVALS - a document by when it reached Syllevo,\nan invoice by when its record was made - not the issue date printed on the\npaper. The graph answers \"what came in this month\", which the invoice list\ndeliberately does not.\n\nThere is no `days` or `preset` parameter, on purpose. The client's\n7d/14d/30d selector computes both dates, and a second way to say the same\nrange is how a graph and its own axis label end up disagreeing.\n\nArchived clients are out of this series, the way they are out of the totals\nabove: the line shows what the firm is collecting now, and a client that left\nin June would put a bump in the spring nobody can act on.",
        "operationId": "organizationStatsGetTrend",
        "parameters": [
          {
            "description": "The window, as two ISO 8601 dates, BOTH INCLUSIVE. Omit both for the last 30 days;\nomit `from` for the 30 days ending at `to`; omit `to` for everything\nsince `from`, up to today. A backwards range and a range longer than 366 days\nare both 400.",
            "in": "query",
            "name": "From",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "The window, as two ISO 8601 dates, BOTH INCLUSIVE. Omit both for the last 30 days;\nomit `from` for the 30 days ending at `to`; omit `to` for everything\nsince `from`, up to today. A backwards range and a range longer than 366 days\nare both 400.",
            "in": "query",
            "name": "To",
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Invoices and documents that arrived per day, one point per day with none missing.",
        "tags": [
          "OrganizationStats"
        ]
      }
    },
    "/v1/organizations": {
      "get": {
        "description": "Never 404s and never 403s. Somebody who belongs to no firm gets an empty list,\nwhich is the state the create-a-firm screen exists for.",
        "operationId": "organizationsList",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OrganizationMembershipResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The firms this person may act in, with their role, their package, and how many\nclient companies they can see in each.",
        "tags": [
          "Organizations"
        ]
      },
      "post": {
        "operationId": "organizationsCreate",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMembershipResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Creates a firm and makes the caller its Owner.",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/predictions/missing": {
      "get": {
        "description": "Without `profileId` this is the firm-wide view, narrowed to the clients\nthe caller may see - so an actor with no grants gets an empty page rather\nthan a 403, exactly as the invoice and anomaly lists do. With\n`profileId` that same set is intersected down to the one client, so\nnaming a client the caller cannot see is an empty page as well, never a\n403.\n\nThe list is deliberately short. A supplier appears only when it invoiced in\nmost of the last six months, when the day it usually bills by has passed\nwith a grace period on top, and when nothing from it has arrived this month\nat all. An empty page is the ordinary answer for a firm that is up to date,\nnot a missing resource.\n\nEach row carries numbers and no sentences: the usual day, the day the grace\nperiod ran out, how many months the pattern rests on, and what the supplier\nlast billed. The screen writes the sentence, in the reader's language.",
        "operationId": "predictionsMissing",
        "parameters": [
          {
            "description": "`profileId` narrows to one client.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfMissingInvoicePredictionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of suppliers that are overdue by their own pattern, most overdue\nfirst.",
        "tags": [
          "Predictions"
        ]
      }
    },
    "/v1/profiles": {
      "get": {
        "description": "There is no permission attribute here and none is missing. Visibility IS the\ngate: the service asks the authorization service which profile ids the actor may\nsee, and an actor with no grants gets an empty page rather than a 403. A firm\nemployee asking for their client list has not done anything forbidden by having\na short one.",
        "operationId": "profilesList",
        "parameters": [
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Optional. Matches anywhere in the client company's name, case-insensitively, and is\napplied inside the query - so the total counts the matches rather than the\nportfolio.",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Whether archived client companies are included. Defaults to false, which is the\nanswer every screen except the restore one wants: an archived profile is out of the\nfirm's working set, and this list is what month-end is organized around. A client\nthat omits it gets the working set.",
            "in": "query",
            "name": "includeArchived",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfProfileResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The profiles this actor can see, and only those. A firm employee handling 30 of\nthe firm's 200 clients gets 30 rows and a total of 30 - the narrowing happens in\nthe query, not on the page that came back.",
        "tags": [
          "Profiles"
        ]
      },
      "post": {
        "operationId": "profilesCreate",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Adds a client company. Requires the organization role Admin.",
        "tags": [
          "Profiles"
        ]
      }
    },
    "/v1/profiles/{id}": {
      "get": {
        "description": "Answers for an ARCHIVED profile too, deliberately. A direct link to a client the\nfirm archived has to work and its page has to render - the unarchive route below is\nreached from that page, so a 404 here would make archiving one-way. The response\ncarries `archivedAt` so the page can say which state it is showing.",
        "operationId": "profilesGet",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One profile. Requires View on that profile.",
        "tags": [
          "Profiles"
        ]
      },
      "put": {
        "description": "PUT, and the whole shape every time, matching\n`PUT /v1/organization/settings`. The three optional fields are cleared by\nsending them null, not by leaving them out, so there is one meaning for an\nabsent field rather than two nobody can tell apart on the wire.\n\nManageSettings rather than the organization Admin that\n`Create` takes: creating a client company happens before there is\na profile to hold a permission, and renaming one is a per-client setting held\nby whoever handles that client.",
        "operationId": "profilesUpdate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Changes a client company's name, tax identifier, country, and locale. Requires\nManageSettings on the profile.",
        "tags": [
          "Profiles"
        ]
      }
    },
    "/v1/profiles/{id}/archive": {
      "post": {
        "description": "**Nothing is deleted.** Every document, invoice, supplier, account, and\n        contact stays exactly where it is and stays in every export - the never-lose-a-document rule, and the reason this product has no hard delete at all. What stops\n        is chasing, completeness, the default profile list, and the billing count.\n        `Get` still answers for it.\n\n**POST rather than DELETE, and that is not a hedge.** DELETE would promise\n        the thing this route exists to avoid, and would leave no verb for the route\n        beneath it: archiving is reversible, and a resource you can un-DELETE is not a\n        resource that was deleted.\n\n**Idempotent.** Archiving one that is already archived answers 200 with the\n        profile rather than 409, the same way the avatar deletes answer 200 for a logo\n        that is already gone.",
        "operationId": "profilesArchive",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Takes a client company out of the firm's working set. Requires the organization\nrole Admin.",
        "tags": [
          "Profiles"
        ]
      }
    },
    "/v1/profiles/{id}/avatar": {
      "delete": {
        "operationId": "profileAvatarsDeleteAvatar",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Removes this client company's logo. Requires ManageSettings, and is idempotent:\nremoving one that is already gone answers 200 with the profile rather than 404.",
        "tags": [
          "ProfileAvatars"
        ]
      },
      "post": {
        "description": "The two limits below are a pair and neither is decoration.\n`RequestFormLimits` caps the FILE part, so a six-megabyte upload is\nrefused as it streams rather than after it has all arrived;\n`RequestSizeLimit` caps the whole body and sits a megabyte higher, so a\nfile exactly at the limit is not killed for the multipart framing around it.\nThe validator's own ceiling runs first on the length the reader measured, which\nis what turns \"too big\" into a translated 400 instead of a bare 413.\n\nThe response is the whole profile, not just the links. The screen that just\nuploaded a logo is showing a client company, and handing back the row it is\nshowing saves it a re-fetch it would otherwise have to make against a cache\nthis write just invalidated.",
        "operationId": "profileAvatarsSetAvatar",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Sets or replaces this client company's logo. Requires ManageSettings on the\nprofile.",
        "tags": [
          "ProfileAvatars"
        ]
      }
    },
    "/v1/profiles/{id}/unarchive": {
      "post": {
        "description": "Nothing is restored because nothing was removed. The profile comes back with every\ndocument it had - including any that arrived WHILE it was archived, because\ningestion never stopped: a late invoice from a client the firm archived in March is\nstill that client's invoice, and dropping it on the floor is the one failure\nthe never-lose-a-document rule will not accept.",
        "operationId": "profilesUnarchive",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Puts an archived client company back into the firm's working set. Admin, and\nidempotent, symmetrically with `Archive`.",
        "tags": [
          "Profiles"
        ]
      }
    },
    "/v1/profiles/{profileId}/accounts": {
      "get": {
        "operationId": "accountsList",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The free-text label, e.g. \"office inbox\". Filtering by tag works everywhere\naccounts appear, and this is that filter on the API side.",
            "in": "query",
            "name": "tag",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AccountResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every source on this profile, optionally narrowed to one tag. Requires View -\nseeing that a client has an inbox connected is part of seeing the client, and\nthis is the gate `GET /v1/accounts` scopes its firm-wide page on so the two\nroutes answer the same question.",
        "tags": [
          "Accounts"
        ]
      },
      "post": {
        "operationId": "accountsCreate",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Connects a source. Requires ManageSources on the profile.\nCredentials are encrypted before they reach the database and are not echoed back.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/v1/profiles/{profileId}/accounts/sync": {
      "post": {
        "description": "Never refuses over one member of the set. A portfolio always holds a mix, and\nrefusing the whole request over part of it would refuse the only thing that was\nasked for.",
        "operationId": "accountsSyncAll",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBulkSyncResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Checks every source on this profile that can be checked. Requires ManageSources on\nthe profile.\nAnswers 200 with counts rather than 202 with a list: the client asked one question\nabout a whole client company, and what it needs back is how many were queued, how\nmany were checked too recently, and how many have nothing to pull.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/v1/profiles/{profileId}/accounts/{id}": {
      "delete": {
        "operationId": "accountsDelete",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {}
            },
            "description": "No Content"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Disconnects a source. Requires ManageSources on the profile.\nNothing already collected through it is touched - the never-lose-a-document rule.",
        "tags": [
          "Accounts"
        ]
      },
      "get": {
        "operationId": "accountsGet",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One source. Requires View on the profile, like the list above.",
        "tags": [
          "Accounts"
        ]
      },
      "put": {
        "operationId": "accountsUpdate",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Retags a source, and rotates its credentials when a config is sent. Requires\nManageSources on the profile.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/v1/profiles/{profileId}/accounts/{id}/sync": {
      "post": {
        "description": "Refused with 409 for a source there is nothing to ask - an inbox, a manual upload,\nor one waiting on a reconnect - and for one checked inside the last fifteen minutes,\nwhich carries `availableAt` in the error details.",
        "operationId": "accountsSync",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSyncResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Checks this source now instead of waiting for its schedule. Requires ManageSources\non the profile.\nAccepted rather than performed: the check runs on a background job, so 202 is the honest\nanswer and the response carries when the request was taken.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/v1/profiles/{profileId}/completeness": {
      "get": {
        "operationId": "profileCompletenessGet",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The calendar month as ISO 8601 year-month - \"2026-08\". Omitted means the month\nrunning now.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileCompletenessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "This client's month, with the missing list. Requires View on the profile.",
        "tags": [
          "ProfileCompleteness"
        ]
      }
    },
    "/v1/profiles/{profileId}/completeness/expected": {
      "post": {
        "description": "201, like every other creating route in this API, with the expectation in the\nbody. It does not always create - marking a supplier the recurring rule\nalready guessed takes over that row instead of adding a second one - and 201\nis still the honest answer, because either way the row named in the body is\nnow standing and was not before the request.\n\nLocation names the month this expectation belongs to rather than the row\nitself, because no route reads a single expectation: the list lives inside the\nprofile's completeness for a period, which is where a caller that wants to see\nwhat it just created has to look. `CreatedAtAction` rather than a\nhand-built path, so the version segment is filled from the current request's\nown route values.",
        "operationId": "profileCompletenessMarkExpected",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MarkExpectedRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkExpectedRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkExpectedRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpectedDocumentResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Adds an expectation by hand - \"this client gets a rent invoice every month,\nchase it\". Requires ManageDocuments on the profile.",
        "tags": [
          "ProfileCompleteness"
        ]
      }
    },
    "/v1/profiles/{profileId}/completeness/expected/{id}/waive": {
      "post": {
        "description": "A POST rather than a DELETE: the row is kept, with who waived it and why. The\naccountant asking in December why October closed without an invoice from a\nsupplier gets an answer.",
        "operationId": "profileCompletenessWaive",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WaiveExpectedDocumentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WaiveExpectedDocumentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WaiveExpectedDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpectedDocumentResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Says a document is not coming, so it stops appearing as missing. Requires\nManageDocuments on the profile.",
        "tags": [
          "ProfileCompleteness"
        ]
      }
    },
    "/v1/profiles/{profileId}/completeness/recompute": {
      "post": {
        "description": "The explicit door for what a scheduled job will do on its own. It is a POST and\nnot part of the GET on purpose: a read that quietly writes cannot be cached,\nretried, or reasoned about.",
        "operationId": "profileCompletenessRecompute",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileCompletenessResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Works out this client's month again from invoice history, standing marks, and\nconnected-source activity, and answers with the result. Requires ManageDocuments\non the profile.",
        "tags": [
          "ProfileCompleteness"
        ]
      }
    },
    "/v1/profiles/{profileId}/contacts": {
      "get": {
        "description": "The bounced rows are the point of the screen, not noise on it: the accountant is\nthe only person who can fix a dead address, and they cannot fix what they cannot\nsee.",
        "operationId": "profileContactsList",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProfileContactResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every contact this client has, hard-bounced ones included. Requires SendReminders\non the profile.",
        "tags": [
          "ProfileContacts"
        ]
      },
      "post": {
        "operationId": "profileContactsCreate",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileContactRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileContactRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileContactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileContactResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Adds somebody to this client's reminder list. Requires SendReminders on the\nprofile.",
        "tags": [
          "ProfileContacts"
        ]
      }
    },
    "/v1/profiles/{profileId}/contacts/{contactId}": {
      "patch": {
        "description": "PATCH rather than PUT, and the omissions mean \"leave it alone\": a blank locale\nkeeps the language this client's reminders are already written in rather than\nquietly resetting it to English.\n\nWhich is exactly why erasing the greeting name needs its own boolean. Over JSON\nan omitted name and a name explicitly set to null arrive identically, so\n`clearDisplayName` is the only way to say \"there is no name for this person\"\nand mean it. Sending both it and a name is refused rather than guessed at.",
        "operationId": "profileContactsUpdate",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileContactRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileContactRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileContactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileContactResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Edits one contact. Requires SendReminders on the profile.",
        "tags": [
          "ProfileContacts"
        ]
      }
    },
    "/v1/profiles/{profileId}/efactura/transmission-consent": {
      "get": {
        "operationId": "spvTransmissionConsentGet",
        "parameters": [
          {
            "description": "The business.",
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpvTransmissionConsentResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The switch, whether the firm has transmission on, whether the caller may turn it on,\nand when not, why (`lockedReason`).",
        "tags": [
          "SpvTransmissionConsent"
        ]
      },
      "put": {
        "operationId": "spvTransmissionConsentPut",
        "parameters": [
          {
            "description": "The business.",
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpvTransmissionConsentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSpvTransmissionConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpvTransmissionConsentResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Turns the switch on or off. 403 `spv_consent_not_connection_holder` when anyone\nbut the person who connected e-Factura turns it on; 422 `spv_not_enrolled`\nwhen the business is not connected to e-Factura.",
        "tags": [
          "SpvTransmissionConsent"
        ]
      }
    },
    "/v1/profiles/{profileId}/handover-pack": {
      "get": {
        "description": "The cancellation token sits ahead of the optional query values because C# wants\nevery parameter with a default last, and it has none.",
        "operationId": "handoverPacksGet",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "One calendar month as ISO 8601 year-month - \"2026-08\". Omitted means the month\nrunning now. Sending this together with `months` answers 400.",
            "in": "query",
            "name": "month",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repeatable - `?months=2026-07&months=2026-09` - for a pack covering\nseveral months, at most twelve, none repeated. Each month gets a folder of its own\ninside the ZIP.",
            "in": "query",
            "name": "months",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Which arrivals the pack holds: the ones e-Factura brought in, or everything else.\nOmitted means every source.",
            "in": "query",
            "name": "source",
            "schema": {
              "$ref": "#/components/schemas/DocumentSourceKind"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/FileResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The pack for one calendar month, or for several. Requires View on the profile.",
        "tags": [
          "HandoverPacks"
        ]
      }
    },
    "/v1/profiles/{profileId}/reminders": {
      "get": {
        "operationId": "profileRemindersGet",
        "parameters": [
          {
            "description": "The client.",
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The calendar month as ISO 8601 year-month - \"2026-08\". Omitted answers the most\nrecent sequence rather than the current month, so a firm looking at a client\nmid-close sees the sequence that is actually running.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileReminderStateResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "This client's reminder state for one month: the sequence, every touch with its\noutcome and scheduled time, why it is paused if it is, how much out-of-office\nshift is left, and whether escalation is configured. Requires View on the profile.",
        "tags": [
          "ProfileReminders"
        ]
      }
    },
    "/v1/profiles/{profileId}/reminders/history": {
      "get": {
        "operationId": "profileRemindersHistory",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileReminderHistoryResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every sequence this client has ever had, newest first, one summary each. Requires\nView on the profile.",
        "tags": [
          "ProfileReminders"
        ]
      }
    },
    "/v1/profiles/{profileId}/reminders/pause": {
      "post": {
        "description": "Refused with `reminder_sequence_not_active` when the sequence is not in a\nstate a pause can act on, which is what the UI shows instead of a stack trace.",
        "operationId": "profileRemindersPause",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PauseRemindersRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseRemindersRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseRemindersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderSequenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Holds the chasing. Requires SendReminders on the profile. The pause is recorded as\nthe accountant's, not the client's - a client asking for quiet is a different\nreason with a different audit trail.",
        "tags": [
          "ProfileReminders"
        ]
      }
    },
    "/v1/profiles/{profileId}/reminders/resume": {
      "post": {
        "operationId": "profileRemindersResume",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderSequenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Starts the chasing again. Requires SendReminders on the profile. Refused with\n`reminder_sequence_not_paused` when there is nothing to resume.",
        "tags": [
          "ProfileReminders"
        ]
      }
    },
    "/v1/profiles/{profileId}/reminders/send-now": {
      "post": {
        "description": "Schedules a touch rather than putting an email on the wire: the send window, the\ndaily cap, and the missing list are all still consulted, so \"now\" means \"as soon\nas the rules allow\" and the accountant is never the reason a client gets a\nreminder at 3am.\n\nThe engine's refusals are surfaced as distinct codes rather than swallowed -\n`reminder_nothing_missing`, `reminder_no_usable_contact`,\n`reminder_touch_already_pending`, `reminder_sequence_not_chasing`. An\nalready-pending touch also carries `pendingTouchAt`, so the screen can say\nwhen the reminder they just asked for is already going out.",
        "operationId": "profileRemindersSendNow",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManualSendResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManualSendRefusedResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Sends one reminder now, outside the schedule. Requires SendReminders on the\nprofile.",
        "tags": [
          "ProfileReminders"
        ]
      }
    },
    "/v1/profiles/{profileId}/reminders/settings": {
      "delete": {
        "operationId": "profileRemindersRemoveSettings",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileReminderSettingsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Drops this client's override, putting them back on the firm's default. Requires\nManageSettings on the profile. Answers the settings that now stand, so the screen\ndoes not have to ask again.",
        "tags": [
          "ProfileReminders"
        ]
      },
      "get": {
        "operationId": "profileRemindersGetSettings",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileReminderSettingsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "This client's schedule: the override if the firm set one, and the effective values\nthe engine will actually use. Requires ManageSettings on the profile.",
        "tags": [
          "ProfileReminders"
        ]
      },
      "put": {
        "description": "Same escalation rule as the firm default: the first time escalation is switched on\nfor this client, the request is refused with\n`reminder_escalation_confirmation_required` until it carries\n`confirmEscalation`, and nothing is written in the meantime.",
        "operationId": "profileRemindersUpdateSettings",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderSettingsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderSettingsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileReminderSettingsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Overrides the firm's schedule for this one client - the per-client customization\nan accountant asks for. Requires ManageSettings on the profile.",
        "tags": [
          "ProfileReminders"
        ]
      }
    },
    "/v1/profiles/{profileId}/sales-invoices": {
      "post": {
        "description": "Parts: `xml` (UBL 2.1 or CIUS-RO) and/or `pdf`. With XML, every fact\nis read from it and any metadata field sent alongside must agree, or the answer\nis 400 `sales_invoice_metadata_mismatch` with each disagreeing field and\nwhat the XML says in `details`. With only a PDF, `number`,\n`issueDate`, `currency`, `netAmount`, `vatAmount`, and\n`totalAmount` are required.\n\n400 `sales_invoice_xml_unreadable` when the XML is not an invoice we can read,\nor when it states a value no invoice can hold (a buyer country that is not two\nletters, a buyer name past 256 characters, a buyer tax id past 32, a number past\n64, a currency that is not three letters, an amount past 14 digits). The second\ncase names each field in `errors` and the first in `details.field`.\nNothing is stored either way.\n\n201 with the new invoice. 200 with `duplicate: true` when the same files\nwere already imported under this number and issue date. 409\n`invoice_number_exists` when a different invoice already holds them, with\n`details.existingInvoiceId`: an issued invoice is never overwritten.\n\nNothing is emailed unless the form carries `emailTo` (repeated, or a comma\nlist, up to 10 addresses). Then the invoice's PDF is emailed to each address once\nthe import succeeds, and `deliveries` on the answer says where each one\nstands. That needs the `pdf` part (422 `sales_invoice_pdf_missing`\notherwise) and TransmitInvoices on the profile, both checked before anything is\nimported.\n\nNothing is sent to SPV unless the form carries `submit=true`. Then the\n`xml` part is required (422 `spv_xml_missing` otherwise, before anything\nis imported), and once the import succeeds the invoice is queued for upload\nexactly as `POST /v1/sales-invoices/{id}/submission` would. A refusal there\nnever fails the import: `submission` carries the queued (or existing)\nsubmission, and `submissionError` says why nothing was queued.",
        "operationId": "salesInvoicesImport",
        "parameters": [
          {
            "description": "The business that issued the invoice.",
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Any string up to 255 visible ASCII characters, unique per request you mean. A\nretry with the same key and the same body gets the first answer back.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "properties": {
                      "xml": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "pdf": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "number": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "issueDate": {
                        "format": "date",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "dueDate": {
                        "format": "date",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "currency": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "netAmount": {
                        "format": "double",
                        "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
                        "type": [
                          "number",
                          "string"
                        ]
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "vatAmount": {
                        "format": "double",
                        "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
                        "type": [
                          "number",
                          "string"
                        ]
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "totalAmount": {
                        "format": "double",
                        "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
                        "type": [
                          "number",
                          "string"
                        ]
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "customerName": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "customerTaxId": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "customerCountry": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "properties": {
                      "emailTo": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  }
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportSalesInvoiceResponse"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportSalesInvoiceResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the thing that was just created can be read, as an absolute URL.",
                "required": true,
                "schema": {
                  "format": "uri",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Imports one sales invoice. Requires ManageDocuments on the profile and an\n`Idempotency-Key` header.",
        "tags": [
          "SalesInvoices"
        ]
      }
    },
    "/v1/profiles/{profileId}/stats": {
      "get": {
        "description": "Answered for an ARCHIVED client too, deliberately, the way\n`GET /v1/profiles/{id}` is. A direct link to a client the firm archived has\nto render, and cards that came back empty would read as lost data rather than as\nan archived client - nothing was deleted when it was archived.",
        "operationId": "profileStatsGetStats",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileStatsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "What Syllevo holds for this client: invoices, suppliers, and document originals.\nRequires View on the profile.",
        "tags": [
          "ProfileStats"
        ]
      }
    },
    "/v1/profiles/{profileId}/trend": {
      "get": {
        "description": "Days are UTC days and count ARRIVALS - a document by when it reached Syllevo, an\ninvoice by when its record was made - not the issue date on the paper. The\nfirm-wide series on `GET /v1/organization/trend` is the same measurement at\nthe other scope, so the two graphs can be read side by side.",
        "operationId": "profileStatsGetTrend",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The window, as two ISO 8601 dates, BOTH INCLUSIVE. Omit both for the last 30 days.\nA backwards range and a range longer than 366 days are both 400.",
            "in": "query",
            "name": "From",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "The window, as two ISO 8601 dates, BOTH INCLUSIVE. Omit both for the last 30 days.\nA backwards range and a range longer than 366 days are both 400.",
            "in": "query",
            "name": "To",
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Invoices and documents that arrived for this client per day, one point per day\nwith none missing. Requires View on the profile.",
        "tags": [
          "ProfileStats"
        ]
      }
    },
    "/v1/profiles/{profileId}/upload-links": {
      "get": {
        "operationId": "profileUploadLinksList",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UploadLinkSummaryResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every link issued for this client, newest first, dead ones included. Requires\nSendReminders on the profile.",
        "tags": [
          "ProfileUploadLinks"
        ]
      }
    },
    "/v1/profiles/{profileId}/upload-links/{linkId}/revoke": {
      "post": {
        "description": "POST rather than DELETE: the row survives, because the audit trail has to keep\nanswering which link an upload came through long after the link stops working.\n\nRevoking a link that is already revoked answers the original revocation rather\nthan an error, and does not move its timestamp. A link id belonging to another\nclient - or to another firm - answers 404, the same as one that never existed.",
        "operationId": "profileUploadLinksRevoke",
        "parameters": [
          {
            "in": "path",
            "name": "profileId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "linkId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeUploadLinkResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Kills one link. Requires SendReminders on the profile.",
        "tags": [
          "ProfileUploadLinks"
        ]
      }
    },
    "/v1/registry/company": {
      "get": {
        "description": "Rate limited per caller. The registry client already holds ANAF's own\none-request-per-second limit process-wide, so the policy here is not protecting\nANAF - it is protecting the queue in front of that limiter from one caller\nlooping over a client list while everybody else's form waits behind them.\n\nNever 404s. A code nobody recognizes is a 200 the screen can render, and a 404\nwould read as \"that route is gone\" to a client that has to tell the two apart.",
        "operationId": "registryLookupCompany",
        "parameters": [
          {
            "in": "query",
            "name": "cui",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryCompanyResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Looks one fiscal code up in ANAF's public registers, as of today.",
        "tags": [
          "Registry"
        ]
      }
    },
    "/v1/reminders/sending-today": {
      "get": {
        "description": "Filtered to the profiles this user can see, so an accountant who holds three\nclients sees three clients' worth. No permission is required beyond that: a user\nwith no visible profiles gets an empty day rather than a 403.",
        "operationId": "remindersSendingToday",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemindersSendingTodayResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every reminder scheduled to go out during the firm's local day, grouped by client.\nThe answer to \"what are we about to send in my name\", which is the question an\naccountant asks before they trust the thing to send anything at all.",
        "tags": [
          "Reminders"
        ]
      }
    },
    "/v1/reminders/settings": {
      "get": {
        "description": "A firm that has never saved gets the shipped defaults with `isDefaulted` true\nand no id. Reading settings never creates a row - the first PUT does.",
        "operationId": "remindersGetSettings",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderSettingsResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The firm's default reminder schedule, inherited by every client without an\noverride. Requires the Admin organization role.",
        "tags": [
          "Reminders"
        ]
      },
      "put": {
        "description": "Switching escalation on for the first time is refused with\n`reminder_escalation_confirmation_required` until the request carries\n`confirmEscalation`. Nothing is written on that refusal, so the screen can\nshow what escalation does and re-send the same body with the flag set.",
        "operationId": "remindersUpdateSettings",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderSettingsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderSettingsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReminderSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReminderSettingsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Replaces the firm's default schedule. Requires the Admin organization role: this\nchanges how every client of the firm is chased, so it is the organization's\ndecision rather than any one client's.",
        "tags": [
          "Reminders"
        ]
      }
    },
    "/v1/review": {
      "get": {
        "operationId": "reviewList",
        "parameters": [
          {
            "description": "One client, or omitted for everything the caller can see. Visibility is the gate\neither way: a named profile is intersected with the clients the caller may see\nrather than checked against them, so an actor with no grants and an actor naming a\nclient they cannot see both get an empty page rather than a 403 - asking what is\nwaiting is not a forbidden question because your portfolio is empty.",
            "in": "query",
            "name": "profileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfReviewQueueItemResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of the review queue, newest arrival first. Requires View.",
        "tags": [
          "Review"
        ]
      }
    },
    "/v1/review/count": {
      "get": {
        "description": "No parameters, on purpose. One row per client comes back with the total, so a\nscreen following a client picker reads the row it needs out of a response it\nalready holds rather than asking again on every switch. Never 404s on a clear\nqueue: zero with an empty per-client list is the empty state, not a missing\nresource.",
        "operationId": "reviewCount",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewCountResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The badge: how much is still waiting for a person, in total and per client, over\nthe profiles the caller may see.",
        "tags": [
          "Review"
        ]
      }
    },
    "/v1/review/{documentId}": {
      "get": {
        "description": "Answers for a document in any status, not only one still waiting. A reviewer\nfollowing a link to a document a colleague settled two minutes ago should see\nwhat it says and that it is settled, rather than a 404 that reads as \"we lost\nit\". The original file itself is fetched through the documents endpoint - the\nreview screen shows it beside these values.",
        "operationId": "reviewGet",
        "parameters": [
          {
            "in": "path",
            "name": "documentId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDocumentResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Everything one review screen needs about a document: its facts, and the values\nthe pipeline proposes for it. Requires View on the profile it belongs to.",
        "tags": [
          "Review"
        ]
      }
    },
    "/v1/review/{documentId}/decision": {
      "post": {
        "description": "`correctedFields` is a JSON OBJECT, not a string, and it is a full\n        snapshot of the corrected values rather than a diff - see\n        `DecideReviewRequest.CorrectedFields` for who reads it afterwards\n        and why a diff cannot answer them. Required for a correction, refused on the\n        other two outcomes.\n\n409 when the document is no longer waiting, which is the ordinary two-people-\none-queue case rather than an error: a colleague settled it while this screen\nwas open. The response says which document and that it has moved on, so the\nclient can refresh rather than retry.\n\nDecisions are append-only. A reviewer who changes their mind decides again\nand both answers stay in the record - which is the point of the record.",
        "operationId": "reviewDecide",
        "parameters": [
          {
            "in": "path",
            "name": "documentId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DecideReviewRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideReviewRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDecisionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Records a person's answer about one document and applies it. Requires\nManageDocuments on the profile.",
        "tags": [
          "Review"
        ]
      }
    },
    "/v1/sales-invoices/{invoiceId}/deliveries": {
      "get": {
        "operationId": "salesInvoiceDeliveriesList",
        "parameters": [
          {
            "description": "The sales invoice.",
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesInvoiceDeliveriesResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every emailed copy of the invoice, oldest first. Requires View on the profile.",
        "tags": [
          "SalesInvoiceDeliveries"
        ]
      },
      "post": {
        "description": "202 with one delivery per address, in the order sent. Sending happens in the\nbackground; read the deliveries back to see each one reach `Sent` or\n`Failed`.\n\nAn address that already has a copy queued, or sent, gets that delivery back and\nno second email. Set `resend` to send again to addresses that already got\none. 404 when the id is not a sales invoice you can see; 422\n`sales_invoice_pdf_missing` when it has no PDF to attach.",
        "operationId": "salesInvoiceDeliveriesCreate",
        "parameters": [
          {
            "description": "The sales invoice.",
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Any string up to 255 visible ASCII characters, unique per request you mean.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSalesInvoiceDeliveriesRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSalesInvoiceDeliveriesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesInvoiceDeliveriesResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Emails the invoice's PDF to 1 to 10 addresses. Requires TransmitInvoices on the\nprofile and an `Idempotency-Key` header.",
        "tags": [
          "SalesInvoiceDeliveries"
        ]
      }
    },
    "/v1/sales-invoices/{invoiceId}/submission": {
      "get": {
        "operationId": "salesInvoiceSubmissionsGet",
        "parameters": [
          {
            "description": "The sales invoice.",
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesInvoiceSubmissionHistoryResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The invoice's latest submission and every earlier one, newest first. Requires View\non the profile. `latest` is null when it was never sent through Syllevo.",
        "tags": [
          "SalesInvoiceSubmissions"
        ]
      },
      "post": {
        "description": "202 with the new submission. The upload happens in the background; read the\nsubmission back to follow it to `Accepted`, `Rejected`, or another\nfinal state.\n\n409 `spv_submission_exists`, with the existing submission, when one is in\nflight or was already accepted; 409 `spv_already_in_spv` when the SPV sent\nlist already has it. 403 `spv_transmission_disabled` or\n`spv_consent_missing` when sending is not allowed; 422 for a file or an\nenrollment that cannot be sent (see https://syllevo.com/docs/api/errors).",
        "operationId": "salesInvoiceSubmissionsCreate",
        "parameters": [
          {
            "description": "The sales invoice.",
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Any string up to 255 visible ASCII characters, unique per request you mean.",
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesInvoiceSubmissionResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesInvoiceSubmissionConflictResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Queues the invoice's XML for upload to SPV. Requires TransmitInvoices on the profile\nand an `Idempotency-Key` header.",
        "tags": [
          "SalesInvoiceSubmissions"
        ]
      }
    },
    "/v1/search": {
      "get": {
        "description": "An empty or too-short `q` answers empty categories rather than\nan error - the box fires while somebody is still typing. An actor with no profile\ngrants gets empty categories too, exactly as the invoice list gets an empty page.\nA category that ran out of its own time budget comes back flagged rather than\nsilently empty, and the Users category is absent entirely for anyone who is not an\nAdmin of this firm.",
        "operationId": "searchSearch",
        "parameters": [
          {
            "description": "What the accountant typed. Words are matched together, diacritics forgiven.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional. Narrows documents, sources, ANAF messages, and the firm's own supplier\nrows to one client; firms, colleagues, and the shared supplier directory keep\nanswering firm-wide. It can only ever narrow - a profile the caller cannot see\nremoves every row rather than adding one.",
            "in": "query",
            "name": "profileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Up to three matches in each category, grouped, with the count and the cap for\neach one.",
        "tags": [
          "Search"
        ]
      }
    },
    "/v1/setup-checklist-preferences": {
      "get": {
        "description": "Never 404s. Somebody who has never dismissed anything has no row and has skipped\nnothing, which is what this returns as an empty list - a missing row is an\nanswer, not a missing resource.",
        "operationId": "setupChecklistPreferencesGet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupChecklistPreferenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The caller's own dismissed suggestions in the current organization.",
        "tags": [
          "SetupChecklistPreferences"
        ]
      },
      "put": {
        "description": "An upsert, so the sidebar can save without knowing whether a row exists, and\nidempotent, so a double-click leaves one row rather than two lists that disagree.\nThe request carries the whole set: bringing a suggestion back is the same call as\ndismissing one, with that key left out.",
        "operationId": "setupChecklistPreferencesUpdate",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSetupChecklistPreferenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSetupChecklistPreferenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSetupChecklistPreferenceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupChecklistPreferenceResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Replaces the caller's own dismissed suggestions in the current organization, and\nreturns them.",
        "tags": [
          "SetupChecklistPreferences"
        ]
      }
    },
    "/v1/spv/messages": {
      "get": {
        "description": "Without `profileId` this is the firm-wide view, narrowed in the query to the\nclients the caller may see - so an actor with no grants gets an empty page rather\nthan a 403, exactly as the invoice list does. With `profileId` that same set\nis intersected down to the one client, so naming a client the caller cannot see is\nan empty page as well, never a 403. The bulk mark-read below reads the same\nparameter the opposite way, because it writes.",
        "operationId": "spvMessagesList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client, `type` to one ANAF message type\n    (exact `tip`, ANAF's values), and `unreadOnly=true` to what nobody at\n    the firm has read yet.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client, `type` to one ANAF message type\n    (exact `tip`, ANAF's values), and `unreadOnly=true` to what nobody at\n    the firm has read yet.",
            "in": "query",
            "name": "Type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`profileId` narrows to one client, `type` to one ANAF message type\n    (exact `tip`, ANAF's values), and `unreadOnly=true` to what nobody at\n    the firm has read yet.",
            "in": "query",
            "name": "UnreadOnly",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfSpvMessageResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of the stream, newest ANAF publication first.",
        "tags": [
          "SpvMessages"
        ]
      }
    },
    "/v1/spv/messages/read": {
      "post": {
        "description": "Answers how many rows this call actually moved from unread to read - messages\nalready read are not counted, because their first reader stands.",
        "operationId": "spvMessagesMarkAllRead",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MarkSpvMessagesReadRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkSpvMessagesReadRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkSpvMessagesReadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpvMessagesMarkedReadResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Marks a set of messages read in one act: one client's when the body names a\nprofile, or every profile the caller may see when it names none.",
        "tags": [
          "SpvMessages"
        ]
      }
    },
    "/v1/spv/messages/unread-count": {
      "get": {
        "description": "Never 404s on a caught-up firm. Zero unread with an empty per-profile list is the\nempty state, not a missing resource.",
        "operationId": "spvMessagesUnreadCount",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpvUnreadCountResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The unread badge: how many SPV messages are waiting, in total and per client,\nover the profiles the caller may see.",
        "tags": [
          "SpvMessages"
        ]
      }
    },
    "/v1/spv/messages/{id}/collect": {
      "post": {
        "operationId": "spvMessagesCollect",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpvCollectResponse"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpvCollectResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Files one received invoice that the enrollment's scope left uncollected or held.\nRequires ManageSources on the profile. 202 while a background job fetches or files it,\n200 with the document id when it was already filed.",
        "tags": [
          "SpvMessages"
        ]
      }
    },
    "/v1/spv/messages/{id}/read": {
      "post": {
        "description": "200 with the message as it now stands rather than 204, so the screen can show the\nsettled state without a second request. Idempotent: a message somebody already\nread keeps its first reader, and reading it again changes nothing.",
        "operationId": "spvMessagesMarkRead",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpvMessageResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Marks one message read for the whole firm. Requires View on the profile it\nbelongs to.",
        "tags": [
          "SpvMessages"
        ]
      }
    },
    "/v1/status": {
      "get": {
        "description": "The one route here that reads nothing. A client that reaches it with a credential\nand gets its own actor type back has proved the whole front of the pipeline:\nversioned route, authentication, organization scoping, correlation id.",
        "operationId": "statusGet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The credential is valid but not for this organization, or not for this action."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Answers with who the caller is, which organization the request was scoped to, and\nthe correlation id it will be logged under.",
        "tags": [
          "Status"
        ]
      }
    },
    "/v1/supplier-directory": {
      "get": {
        "description": "Not paged, and never 404s. The directory is an editorial list the picker shows in\nfull, and an empty one is the empty state rather than a missing resource.",
        "operationId": "supplierDirectoryList",
        "parameters": [
          {
            "description": "Optional `search` against the display name.",
            "in": "query",
            "name": "Search",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SupplierDirectoryEntryResponse"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Every listed supplier, alphabetical, with its sender presets and the key to its\ntutorial. Requires a signed-in actor.",
        "tags": [
          "SupplierDirectory"
        ]
      }
    },
    "/v1/suppliers": {
      "get": {
        "operationId": "suppliersList",
        "parameters": [
          {
            "description": "`profileId` is required - permissions are held on the profile. `search` is\n    optional and matches anywhere in the supplier's name, case-insensitively.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` is required - permissions are held on the profile. `search` is\n    optional and matches anywhere in the supplier's name, case-insensitively.",
            "in": "query",
            "name": "Search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfSupplierResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of a client's suppliers, ordered by name. Requires View on the profile.",
        "tags": [
          "Suppliers"
        ]
      },
      "post": {
        "description": "A custom supplier is first-class - it behaves exactly like a listed\none and the only thing it lacks is our tutorial. Same idempotency as the directory\nroute wherever a fiscal identifier is given.",
        "operationId": "supplierConnectionsCreateCustom",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomSupplierRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomSupplierRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomSupplierRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierConnectionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Adds a supplier the directory does not list: a name, and the addresses its invoices\ncome from. Requires ManageSources on the profile.",
        "tags": [
          "SupplierConnections"
        ]
      }
    },
    "/v1/suppliers/connections": {
      "get": {
        "operationId": "supplierConnectionsListConnections",
        "parameters": [
          {
            "description": "`profileId` is required - permissions are held on the profile.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "`profileId` is required - permissions are held on the profile.",
            "in": "query",
            "name": "Search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`profileId` is required - permissions are held on the profile.",
            "in": "query",
            "name": "HideEFactura",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfSupplierConnectionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of a client's suppliers WITH their connection state. Requires View on the\nprofile.",
        "tags": [
          "SupplierConnections"
        ]
      }
    },
    "/v1/suppliers/from-directory": {
      "post": {
        "description": "200 rather than 201, and idempotent: adding a supplier the client already has, by\nany route, answers with the one supplier rather than creating a second. Both paths\nmatch on the normalized fiscal identifier, which is the rule the extraction\npipeline already uses.",
        "operationId": "supplierConnectionsAddFromDirectory",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddSupplierFromDirectoryRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSupplierFromDirectoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSupplierFromDirectoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierConnectionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Connects a listed supplier to a client company. Requires ManageSources on the\nprofile - this is connecting a source, not filing a document.",
        "tags": [
          "SupplierConnections"
        ]
      }
    },
    "/v1/suppliers/{id}": {
      "get": {
        "operationId": "suppliersGet",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One supplier. Requires View on the profile it belongs to.",
        "tags": [
          "Suppliers"
        ]
      }
    },
    "/v1/suppliers/{id}/connection-methods": {
      "put": {
        "operationId": "supplierConnectionsSetConnectionMethods",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetSupplierConnectionMethodsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSupplierConnectionMethodsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSupplierConnectionMethodsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierConnectionResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Replaces the routes the firm declares for one supplier: whether its invoices are\nexpected through e-Factura. Requires ManageSources on the profile.",
        "tags": [
          "SupplierConnections"
        ]
      }
    },
    "/v1/suppliers/{id}/merge": {
      "post": {
        "description": "POST rather than DELETE, because nothing is being removed as far as the client's\ndata goes: the invoices, the expectations, and the sender addresses all survive on\nthe row that is kept. The supplier in the route is the one that DISAPPEARS, which is\nwhat the caller is acting on and what a stale list has to stop drawing.\n\nAnd the one that disappears is never the official row - the one whose fiscal\nidentifier matches a supplier directory entry, which is the same match that draws\nits brand mark. That refusal is a 409, not a silent reordering of the two sides.",
        "operationId": "suppliersMerge",
        "parameters": [
          {
            "description": "The supplier to remove. Everything hanging off it moves first.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MergeSupplierRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeSupplierRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeSupplierRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierResponse"
                }
              }
            },
            "description": "The merge is done. The body is the supplier that survived."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The same supplier was named twice, or the body names neither the id to keep nor a\ndirectory slug, or it names both."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Either supplier belongs to another firm or does not exist, or the directory does not\nlist that slug any more."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The two suppliers belong to different clients, which is not a duplicate\n(`supplier_merge_profile_mismatch`); the supplier being removed is the official\none, matched to a directory entry on its fiscal identifier\n(`supplier_merge_official_supplier`); or the slug resolves to the supplier in\nthe route, which already IS that listed company\n(`supplier_merge_already_official`)."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Folds two supplier rows for one company into one. Requires ManageSources on the\nclient, and both suppliers must belong to it.",
        "tags": [
          "Suppliers"
        ]
      }
    },
    "/v1/uploads/{token}": {
      "get": {
        "description": "**What this discloses, stated exactly, because an anonymous read deserves the arithmetic.** To somebody holding a LIVE token it returns the client\n        company's own name, that company's locale, and the link's expiry - and every\n        one of those three is already in the hand of whoever holds the token, because\n        the reminder that carried the link was addressed to that company, named it, and\n        was written in that locale. A live token therefore buys its holder nothing new.\n        What is deliberately not here: no organization, no ids, no document counts, and\n        above all no list of what is missing. That list is the accountant's working\n        knowledge of their client's affairs and it never appears on an unauthenticated\n        surface.\n\nTo somebody holding anything else it returns the same 404 the upload does, so\nthis endpoint cannot be used to test tokens more cheaply than the upload can -\nwhich is the property that would have made it worth skipping. It records no\nuse: following a link is not answering a reminder, and counting a page load as\none would corrupt the number an accountant reads to decide whether their client\nis engaging at all.",
        "operationId": "uploadsDetails",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadLinkDetailsResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "security": [],
        "summary": "What the upload page shows before anybody uploads: whose invoices this link is\nfor, in which language, and when it stops working.",
        "tags": [
          "Uploads"
        ]
      },
      "post": {
        "description": "200 with per-file rows, not 201 and not a partial-content status. The client is\na business owner on a phone, and the only question the page has to answer is\n\"which of these went through\" - a single status code cannot say that about six\nfiles, so the body does. Rows carry stable codes rather than sentences; the\nwording is resolved in the client's own language.\n\n**The body is read before the token is resolved, and that order is deliberate.** Resolving first would be cheaper against a flood - a dead token\n    could be refused without buffering 25MB - but it would also mean a dead token\n    answers faster and without draining the request, which is an oracle any caller\n    can measure from a script. The uniform answer wins, and the volumetric problem\n    is handled where it belongs: the per-address rate-limit policy on this\n    controller, plus the global unauthenticated ceiling, plus the request size\n    limit below.\n\nThe size and type limits are the authenticated upload's, referenced rather than\nrestated - `DocumentUploadLimits` for the bytes and the shared\nsignature table for the types. A public door held to different limits than the\nprivate one is a door where a file is accepted here and refused later, and the\nperson who sent it will not try twice.",
        "operationId": "uploadsUpload",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadLinkUploadResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Payload Too Large"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "security": [],
        "summary": "Takes in the files a client sends through their link. Each one is judged on its\nown and reported on its own.",
        "tags": [
          "Uploads"
        ]
      }
    },
    "/v1/users/me": {
      "get": {
        "operationId": "usersGetCurrent",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The current person: name, email, locale, and avatar links.",
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/users/me/avatar": {
      "delete": {
        "operationId": "usersDeleteAvatar",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Removes the current person's avatar. Idempotent: removing one that is already gone\nanswers 200 with the account rather than 404.",
        "tags": [
          "Users"
        ]
      },
      "post": {
        "description": "The two limits below are a pair. `RequestFormLimits` caps the FILE part so an\noversized upload is refused as it streams; `RequestSizeLimit` caps the whole\nbody a megabyte higher, so a file exactly at the limit is not killed for the\nmultipart framing around it. The validator's ceiling runs first on the length the\nreader measured, which is what makes \"too big\" a translated 400 rather than a bare\n413.",
        "operationId": "usersSetAvatar",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "Sets or replaces the current person's avatar. Self only - see the remarks on this\ncontroller.",
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/vat-validations": {
      "get": {
        "description": "Only suppliers in another EU member state than the client's own, and only\nones that have actually billed - a supplier with no invoice is not an\nintra-community problem. `status` is one of `invalid`,\n`missing`, `unchecked`, or `valid`, and rows come back in that\norder, then by name.\n\n`unchecked` means nobody has managed to ask yet, never that something is\n    wrong: an hour when VIES was unreachable leaves a supplier unchecked rather\n    than turning it invalid.\n\n`viesName` is the trading name the member state publishes, when it\n    publishes one. It is worth reading next to the supplier's own name - a valid\n    number belonging to a different company is the case a verdict alone cannot\n    catch.\n\nWithout `profileId` this is the firm-wide view, narrowed in the query to\nthe clients the caller may see - so an actor with no grants gets an empty page\nrather than a 403, exactly as the invoice list does. With `profileId`\nthat same set is intersected down to the one client, so naming a client the\ncaller cannot see is an empty page as well, never a 403.",
        "operationId": "vatValidationsList",
        "parameters": [
          {
            "description": "`profileId` narrows to one client.",
            "in": "query",
            "name": "ProfileId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Page",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "PageSize",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          },
          {
            "description": "Page and page size, clamped by `PaginationParams`.",
            "in": "query",
            "name": "Skip",
            "schema": {
              "format": "int32",
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedResultDtoOfSupplierVatValidationResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "One page of foreign suppliers and what is known about their VAT numbers, worst\nnews first.",
        "tags": [
          "VatValidations"
        ]
      }
    },
    "/v1/vat-validations/count": {
      "get": {
        "description": "Unchecked suppliers are deliberately not counted. That number describes how far\nSyllevo has got, not what is wrong with the client's books, and a badge that\nclimbs while a batch drains would train people to ignore it. Never 404s on a\nclean firm - two zeroes is the empty state, not a missing resource.",
        "operationId": "vatValidationsCount",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierVatCountResponse"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No credential, or one that is not valid. The response does not say which."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Something failed inside the API. Nothing was silently dropped: the request is in the logs under the correlation id it was sent with."
          }
        },
        "summary": "The badge: how many foreign suppliers have a VAT number the Commission rejected,\nand how many have none at all, over the profiles the caller may see.",
        "tags": [
          "VatValidations"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountBulkSyncResponse": {
        "properties": {
          "nothingToPull": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "queued": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "skippedTooSoon": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "queued",
          "skippedTooSoon",
          "nothingToPull"
        ],
        "type": "object"
      },
      "AccountResponse": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "ingestionAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastErrorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSuccessfulSyncAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "providerType": {
            "$ref": "#/components/schemas/DataProviderType"
          },
          "syncStatus": {
            "$ref": "#/components/schemas/AccountSyncStatus"
          },
          "tag": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "profileId",
          "providerType",
          "syncStatus"
        ],
        "type": "object"
      },
      "AccountSyncResponse": {
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "queuedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "accountId",
          "queuedAt"
        ],
        "type": "object"
      },
      "AccountSyncStatus": {
        "type": "integer"
      },
      "ActorType": {
        "enum": [
          "anonymous",
          "session",
          "apikey",
          "mcp",
          "system"
        ]
      },
      "AddSupplierFromDirectoryRequest": {
        "properties": {
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AffiliateCommissionResponse": {
        "properties": {
          "amountMinorUnits": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "currencyCode": {
            "type": "string"
          },
          "invoiceDate": {
            "format": "date",
            "type": "string"
          },
          "maturityDate": {
            "format": "date",
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "ratePercent": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "state",
          "amountMinorUnits",
          "currencyCode",
          "ratePercent",
          "invoiceDate",
          "maturityDate"
        ],
        "type": "object"
      },
      "AffiliateCommissionTotalResponse": {
        "properties": {
          "count": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "currencyCode": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "totalMinorUnits": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "state",
          "currencyCode",
          "totalMinorUnits",
          "count"
        ],
        "type": "object"
      },
      "AffiliateCommissionsResponse": {
        "properties": {
          "commissions": {
            "items": {
              "$ref": "#/components/schemas/AffiliateCommissionResponse"
            },
            "type": "array"
          },
          "totals": {
            "items": {
              "$ref": "#/components/schemas/AffiliateCommissionTotalResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "commissions",
          "totals"
        ],
        "type": "object"
      },
      "AffiliateResponse": {
        "properties": {
          "belowMinimum": {
            "type": "boolean"
          },
          "code": {
            "type": "string"
          },
          "commissionPercent": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "discountPercent": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "minimumPayoutMinorUnits": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "payableCurrencyCode": {
            "type": "string"
          },
          "payableTotalMinorUnits": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "payoutReady": {
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "isActive",
          "discountPercent",
          "commissionPercent",
          "createdAt",
          "payoutReady",
          "payableTotalMinorUnits",
          "payableCurrencyCode",
          "minimumPayoutMinorUnits",
          "belowMinimum"
        ],
        "type": "object"
      },
      "ApiKeyResponse": {
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdById": {
            "format": "uuid",
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastFour": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastUsedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "revokedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "revokedById": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "scopes": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyScopeResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "createdById",
          "createdAt",
          "scopes"
        ],
        "type": "object"
      },
      "ApiKeyScopeRequest": {
        "properties": {
          "permission": {
            "$ref": "#/components/schemas/ProfilePermission"
          },
          "profileId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "permission"
        ],
        "type": "object"
      },
      "ApiKeyScopeResponse": {
        "properties": {
          "permission": {
            "$ref": "#/components/schemas/ProfilePermission"
          },
          "profileId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "permission"
        ],
        "type": "object"
      },
      "BeginConnectorConnectRequest": {
        "properties": {
          "directorySlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId"
        ],
        "type": "object"
      },
      "BillingAllowancesResponse": {
        "properties": {
          "efacturaSubmissions": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ]
          },
          "foreignExtractions": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "BillingEntitlementsResponse": {
        "properties": {
          "accountingExports": {
            "type": "boolean"
          },
          "collectionActive": {
            "type": "boolean"
          },
          "productAccess": {
            "type": "boolean"
          },
          "state": {
            "$ref": "#/components/schemas/EntitlementState"
          }
        },
        "required": [
          "state",
          "collectionActive",
          "productAccess",
          "accountingExports"
        ],
        "type": "object"
      },
      "BillingPackageResponse": {
        "properties": {
          "audience": {
            "type": "string"
          },
          "includedAllowances": {
            "$ref": "#/components/schemas/BillingAllowancesResponse"
          },
          "includedProfiles": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "interval": {
            "type": "string"
          },
          "nameKey": {
            "type": "string"
          },
          "priceLookupKey": {
            "type": "string"
          }
        },
        "required": [
          "priceLookupKey",
          "audience",
          "nameKey",
          "includedProfiles",
          "interval",
          "includedAllowances"
        ],
        "type": "object"
      },
      "BillingSessionResponse": {
        "properties": {
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "BillingStateResponse": {
        "properties": {
          "entitlements": {
            "$ref": "#/components/schemas/BillingEntitlementsResponse"
          },
          "package": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BillingPackageResponse"
              }
            ]
          },
          "subscription": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BillingSubscriptionResponse"
              }
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/BillingUsageResponse"
          }
        },
        "required": [
          "usage",
          "entitlements"
        ],
        "type": "object"
      },
      "BillingSubscriptionResponse": {
        "properties": {
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "currentPeriodEnd": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "gracePeriodEndsAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "inGracePeriod": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "inGracePeriod",
          "cancelAtPeriodEnd"
        ],
        "type": "object"
      },
      "BillingUsageResponse": {
        "properties": {
          "activeProfiles": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "documentsThisPeriod": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "activeProfiles",
          "documentsThisPeriod",
          "periodStart",
          "periodEnd"
        ],
        "type": "object"
      },
      "ChangeMemberRoleRequest": {
        "properties": {
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          }
        },
        "required": [
          "role"
        ],
        "type": "object"
      },
      "ChangePlanRequest": {
        "properties": {
          "priceLookupKey": {
            "type": "string"
          },
          "returnUrl": {
            "type": "string"
          }
        },
        "required": [
          "priceLookupKey",
          "returnUrl"
        ],
        "type": "object"
      },
      "CompleteConnectorConnectRequest": {
        "properties": {
          "query": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "state",
          "query"
        ],
        "type": "object"
      },
      "CompleteEFacturaConnectRequest": {
        "properties": {
          "code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "state"
        ],
        "type": "object"
      },
      "CompletenessSummaryResponse": {
        "properties": {
          "expectedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "missingCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "period": {
            "type": "string"
          },
          "profileCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/ProfileCompletenessSummaryResponse"
            },
            "type": "array"
          },
          "profilesWithMissing": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "receivedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "waivedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "period",
          "profileCount",
          "profilesWithMissing",
          "missingCount",
          "expectedCount",
          "receivedCount",
          "waivedCount",
          "profiles"
        ],
        "type": "object"
      },
      "ConnectorAccountResponse": {
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "connectorSlug": {
            "type": "string"
          },
          "credentialExpiresAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "credentialState": {
            "$ref": "#/components/schemas/SupplierConnectorCredentialState"
          },
          "directorySlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalAccountId": {
            "type": "string"
          },
          "externalAccountName": {
            "type": "string"
          },
          "externalFiscalIdentifier": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastErrorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSuccessfulPollAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "nextPollAt": {
            "format": "date-time",
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "accountId",
          "profileId",
          "connectorSlug",
          "externalAccountId",
          "externalAccountName",
          "credentialState",
          "nextPollAt"
        ],
        "type": "object"
      },
      "ConnectorAuthorizationResponse": {
        "properties": {
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "ConnectorCatalogEntryResponse": {
        "properties": {
          "credentialMode": {
            "$ref": "#/components/schemas/ConnectorCredentialMode"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/ConnectorFieldResponse"
            },
            "type": "array"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "credentialMode",
          "fields"
        ],
        "type": "object"
      },
      "ConnectorCredentialMode": {
        "type": "integer"
      },
      "ConnectorFieldResponse": {
        "properties": {
          "labelKey": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "secret": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "labelKey",
          "secret"
        ],
        "type": "object"
      },
      "CreateAccountRequest": {
        "properties": {
          "config": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "providerType": {
            "$ref": "#/components/schemas/DataProviderType"
          },
          "tag": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "providerType"
        ],
        "type": "object"
      },
      "CreateApiKeyRequest": {
        "properties": {
          "expiresAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyScopeRequest"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "scopes"
        ],
        "type": "object"
      },
      "CreateApiKeyResponse": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ApiKeyResponse"
          },
          "plaintextKey": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "plaintextKey"
        ],
        "type": "object"
      },
      "CreateCustomSupplierRequest": {
        "properties": {
          "connectionMethods": {
            "items": {
              "$ref": "#/components/schemas/SupplierConnectionMethod"
            },
            "type": [
              "null",
              "array"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "senderAddresses": {
            "items": {
              "type": "string"
            },
            "type": [
              "null",
              "array"
            ]
          },
          "taxIdentifierType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TaxIdentifierType"
              }
            ]
          },
          "taxIdentifierValue": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "CreateEFacturaEnrollmentRequest": {
        "properties": {
          "connectionId": {
            "format": "uuid",
            "type": "string"
          },
          "cui": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/EFacturaCollectionScope"
          },
          "tag": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "connectionId",
          "cui"
        ],
        "type": "object"
      },
      "CreateInvitationRequest": {
        "properties": {
          "email": {
            "type": "string"
          },
          "grants": {
            "items": {
              "$ref": "#/components/schemas/ProfileAccessGrantRequest"
            },
            "type": "array"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          }
        },
        "required": [
          "email",
          "role"
        ],
        "type": "object"
      },
      "CreateOrganizationRequest": {
        "properties": {
          "kind": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrganizationKind"
              }
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "referralCode": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateProfileContactRequest": {
        "properties": {
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "$ref": "#/components/schemas/ProfileContactRole"
          }
        },
        "required": [
          "email",
          "role"
        ],
        "type": "object"
      },
      "CreateProfileRequest": {
        "properties": {
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "taxIdentifier": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateSalesInvoiceDeliveriesRequest": {
        "properties": {
          "resend": {
            "type": "boolean"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "DataProviderType": {
        "type": "integer"
      },
      "DecideReviewRequest": {
        "properties": {
          "correctedFields": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "outcome": {
            "$ref": "#/components/schemas/ReviewOutcome"
          }
        },
        "type": "object"
      },
      "DigestFrequency": {
        "type": "integer"
      },
      "DigestPreferenceResponse": {
        "properties": {
          "frequency": {
            "$ref": "#/components/schemas/DigestFrequency"
          }
        },
        "required": [
          "frequency"
        ],
        "type": "object"
      },
      "DocumentDetailResponse": {
        "properties": {
          "contentHash": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "deletedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "deletedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "deletedByUserId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "direction": {
            "$ref": "#/components/schemas/InvoiceDirection"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoice": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DocumentInvoiceSummaryResponse"
              }
            ]
          },
          "lastArrivalAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastErrorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastUpdatedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "originalFileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "provenance": {
            "items": {
              "$ref": "#/components/schemas/DocumentProvenanceResponse"
            },
            "type": "array"
          },
          "purgeAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "sizeBytes": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "sourceAccountTag": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceProviderType": {
            "$ref": "#/components/schemas/DataProviderType"
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          }
        },
        "required": [
          "provenance",
          "id",
          "profileId",
          "contentHash",
          "contentType",
          "sizeBytes",
          "status",
          "receivedAt",
          "lastArrivalAt",
          "sourceProviderType",
          "createdAt",
          "direction"
        ],
        "type": "object"
      },
      "DocumentDownloadResponse": {
        "properties": {
          "contentType": {
            "type": "string"
          },
          "documentId": {
            "format": "uuid",
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "url",
          "expiresAt",
          "contentType"
        ],
        "type": "object"
      },
      "DocumentFacetsResponse": {
        "properties": {
          "earliestPeriod": {
            "type": "string"
          },
          "filing": {
            "items": {
              "$ref": "#/components/schemas/DocumentFilingCountResponse"
            },
            "type": [
              "null",
              "array"
            ]
          },
          "periods": {
            "items": {
              "$ref": "#/components/schemas/DocumentPeriodCountResponse"
            },
            "type": "array"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/DocumentSourceCountResponse"
            },
            "type": "array"
          },
          "statuses": {
            "items": {
              "$ref": "#/components/schemas/DocumentStatusCountResponse"
            },
            "type": "array"
          },
          "trashed": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "earliestPeriod",
          "statuses",
          "periods",
          "sources",
          "trashed"
        ],
        "type": "object"
      },
      "DocumentFilingCountResponse": {
        "properties": {
          "count": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "filing": {
            "$ref": "#/components/schemas/DocumentFilingFilter"
          }
        },
        "required": [
          "filing",
          "count"
        ],
        "type": "object"
      },
      "DocumentFilingFilter": {
        "type": "integer"
      },
      "DocumentInvoiceSummaryResponse": {
        "properties": {
          "confirmed": {
            "type": "boolean"
          },
          "counterpartyCountryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "counterpartyName": {
            "type": [
              "null",
              "string"
            ]
          },
          "counterpartyTaxId": {
            "type": [
              "null",
              "string"
            ]
          },
          "currencyCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "direction": {
            "$ref": "#/components/schemas/InvoiceDirection"
          },
          "dueDate": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "isCreditNote": {
            "type": "boolean"
          },
          "issueDate": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          },
          "number": {
            "type": [
              "null",
              "string"
            ]
          },
          "supplierDirectorySlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "supplierId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "supplierName": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          }
        },
        "required": [
          "confirmed",
          "direction"
        ],
        "type": "object"
      },
      "DocumentPeriodCountResponse": {
        "properties": {
          "count": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "period": {
            "type": "string"
          }
        },
        "required": [
          "period",
          "count"
        ],
        "type": "object"
      },
      "DocumentProvenanceResponse": {
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "accountTag": {
            "type": [
              "null",
              "string"
            ]
          },
          "dkimVerdict": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailAuthenticationResult"
              }
            ]
          },
          "dmarcVerdict": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailAuthenticationResult"
              }
            ]
          },
          "externalDocumentId": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "originalFileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerType": {
            "$ref": "#/components/schemas/DataProviderType"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "senderAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceMessageId": {
            "type": [
              "null",
              "string"
            ]
          },
          "spfVerdict": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailAuthenticationResult"
              }
            ]
          }
        },
        "required": [
          "providerType",
          "receivedAt"
        ],
        "type": "object"
      },
      "DocumentResponse": {
        "properties": {
          "contentHash": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "deletedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "deletedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "deletedByUserId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "direction": {
            "$ref": "#/components/schemas/InvoiceDirection"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoice": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DocumentInvoiceSummaryResponse"
              }
            ]
          },
          "lastArrivalAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastErrorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastUpdatedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "originalFileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "purgeAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "sizeBytes": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "sourceAccountTag": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceProviderType": {
            "$ref": "#/components/schemas/DataProviderType"
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          }
        },
        "required": [
          "id",
          "profileId",
          "contentHash",
          "contentType",
          "sizeBytes",
          "status",
          "receivedAt",
          "lastArrivalAt",
          "sourceProviderType",
          "createdAt",
          "direction"
        ],
        "type": "object"
      },
      "DocumentSortField": {
        "type": "integer"
      },
      "DocumentSourceCountResponse": {
        "properties": {
          "count": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "source": {
            "$ref": "#/components/schemas/DocumentSourceKind"
          }
        },
        "required": [
          "source",
          "count"
        ],
        "type": "object"
      },
      "DocumentSourceKind": {
        "type": "integer"
      },
      "DocumentStatus": {
        "type": "integer"
      },
      "DocumentStatusCountResponse": {
        "properties": {
          "count": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          }
        },
        "required": [
          "status",
          "count"
        ],
        "type": "object"
      },
      "DocumentUploadResponse": {
        "properties": {
          "document": {
            "$ref": "#/components/schemas/DocumentDetailResponse"
          },
          "duplicate": {
            "type": "boolean"
          }
        },
        "required": [
          "document",
          "duplicate"
        ],
        "type": "object"
      },
      "EFacturaAuthorizationResponse": {
        "properties": {
          "browserNoteKey": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "EFacturaCollectionScope": {
        "type": "integer"
      },
      "EFacturaCompaniesResponse": {
        "properties": {
          "checkedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "companies": {
            "items": {
              "$ref": "#/components/schemas/EFacturaCompanyResponse"
            },
            "type": "array"
          },
          "status": {
            "$ref": "#/components/schemas/EFacturaCompanyDirectoryStatus"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "EFacturaCompanyDirectoryStatus": {
        "type": "integer"
      },
      "EFacturaCompanyResponse": {
        "properties": {
          "cui": {
            "type": "string"
          },
          "enrolledProfileIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "legalName": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "cui"
        ],
        "type": "object"
      },
      "EFacturaConnectionResponse": {
        "properties": {
          "accessTokenExpiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "certificateIssuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "certificateSerialLast4": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastRefreshedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "refreshTokenExpiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/EFacturaConnectionStatus"
          }
        },
        "required": [
          "id",
          "status",
          "accessTokenExpiresAt",
          "refreshTokenExpiresAt",
          "createdAt"
        ],
        "type": "object"
      },
      "EFacturaConnectionStatus": {
        "type": "integer"
      },
      "EFacturaEnrollmentResponse": {
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "connectionId": {
            "format": "uuid",
            "type": "string"
          },
          "cui": {
            "type": "string"
          },
          "eFacturaEnrolled": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "lastSuccessfulPollAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "legalName": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextPollAt": {
            "format": "date-time",
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "rightsCheckedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "rightsStatus": {
            "$ref": "#/components/schemas/EFacturaRightsStatus"
          },
          "scope": {
            "$ref": "#/components/schemas/EFacturaCollectionScope"
          },
          "sentConsecutiveFailures": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "sentLastSuccessfulPollAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "sentWindowEnd": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "windowEnd": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "accountId",
          "profileId",
          "connectionId",
          "cui",
          "rightsStatus",
          "windowEnd",
          "nextPollAt",
          "scope"
        ],
        "type": "object"
      },
      "EFacturaRightsStatus": {
        "type": "integer"
      },
      "EFacturaSubmissionState": {
        "type": "integer"
      },
      "EffectiveReminderSettingsResponse": {
        "properties": {
          "courtesyCloseOutEnabled": {
            "type": "boolean"
          },
          "dailySendCap": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "escalationConfirmed": {
            "type": "boolean"
          },
          "escalationEnabled": {
            "type": "boolean"
          },
          "escalationGapBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "escalationRunnable": {
            "type": "boolean"
          },
          "maxTouches": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "organizationSettingsId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "profileSettingsId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "sendWindowEnd": {
            "format": "time",
            "type": "string"
          },
          "sendWindowStart": {
            "format": "time",
            "type": "string"
          },
          "startOffsetBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "touchGapBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "startOffsetBusinessDays",
          "touchGapBusinessDays",
          "escalationGapBusinessDays",
          "maxTouches",
          "escalationEnabled",
          "escalationConfirmed",
          "escalationRunnable",
          "courtesyCloseOutEnabled",
          "sendWindowStart",
          "sendWindowEnd",
          "dailySendCap"
        ],
        "type": "object"
      },
      "EmailAuthenticationResult": {
        "type": "integer"
      },
      "EmailIngestionAcceptedResponse": {
        "properties": {
          "ingestionMessageId": {
            "format": "uuid",
            "type": "string"
          },
          "replayed": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "ingestionMessageId",
          "status",
          "replayed"
        ],
        "type": "object"
      },
      "EntitlementState": {
        "type": "integer"
      },
      "EntityTagHeaderValue": {
        "properties": {
          "isWeak": {
            "type": "boolean"
          },
          "tag": {
            "$ref": "#/components/schemas/StringSegment"
          }
        },
        "type": "object"
      },
      "ErrorResponse": {
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "type": [
              "null",
              "object"
            ]
          },
          "errors": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": [
              "null",
              "object"
            ]
          },
          "messageKey": {
            "type": "string"
          },
          "status": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "status",
          "code",
          "messageKey"
        ],
        "type": "object"
      },
      "ExpectedDocumentReason": {
        "type": "integer"
      },
      "ExpectedDocumentResponse": {
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "accountProviderType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DataProviderType"
              }
            ]
          },
          "accountTag": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isRecurring": {
            "type": "boolean"
          },
          "reason": {
            "$ref": "#/components/schemas/ExpectedDocumentReason"
          },
          "satisfiedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "satisfiedByDocumentId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "satisfiedByInvoiceId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/ExpectedDocumentState"
          },
          "supplierId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "supplierName": {
            "type": [
              "null",
              "string"
            ]
          },
          "waiveReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "waivedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "reason",
          "state",
          "isRecurring",
          "createdAt"
        ],
        "type": "object"
      },
      "ExpectedDocumentState": {
        "type": "integer"
      },
      "FileResult": {
        "properties": {
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "FilingTrashBehavior": {
        "type": "integer"
      },
      "IFormFile": {
        "format": "binary",
        "type": "string"
      },
      "ImportSalesInvoiceResponse": {
        "properties": {
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/SalesInvoiceDeliveryResponse"
            },
            "type": "array"
          },
          "duplicate": {
            "type": "boolean"
          },
          "invoice": {
            "$ref": "#/components/schemas/InvoiceResponse"
          },
          "restored": {
            "type": "boolean"
          },
          "submission": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SalesInvoiceSubmissionResponse"
              }
            ]
          },
          "submissionError": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ErrorResponse"
              }
            ]
          }
        },
        "required": [
          "invoice",
          "duplicate"
        ],
        "type": "object"
      },
      "InvitationResponse": {
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "emailSent": {
            "type": "boolean"
          },
          "expired": {
            "type": "boolean"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "grantedProfileCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "hasOrganizationWideAccess": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invitedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastSentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "status",
          "expired",
          "hasOrganizationWideAccess",
          "grantedProfileCount",
          "createdAt",
          "expiresAt",
          "emailSent"
        ],
        "type": "object"
      },
      "InvitationStatus": {
        "type": "integer"
      },
      "InvoiceAnomalyCountResponse": {
        "properties": {
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/InvoiceAnomalyProfileCount"
            },
            "type": "array"
          },
          "total": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "total",
          "profiles"
        ],
        "type": "object"
      },
      "InvoiceAnomalyKind": {
        "type": "integer"
      },
      "InvoiceAnomalyProfileCount": {
        "properties": {
          "openCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId",
          "openCount"
        ],
        "type": "object"
      },
      "InvoiceAnomalyResponse": {
        "properties": {
          "amountRatio": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          },
          "counterpartDocumentId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "counterpartInvoiceId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "dismissedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "dismissedById": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string"
          },
          "issueDate": {
            "format": "date",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/InvoiceAnomalyKind"
          },
          "medianTotalAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "supplierName": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "profileId",
          "invoiceId",
          "kind",
          "createdAt",
          "invoiceNumber",
          "issueDate",
          "totalAmount",
          "currencyCode"
        ],
        "type": "object"
      },
      "InvoiceDeliveryResponse": {
        "properties": {
          "channel": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "sentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "channel",
          "recipient",
          "status"
        ],
        "type": "object"
      },
      "InvoiceDirection": {
        "type": "integer"
      },
      "InvoiceDocumentLinkReason": {
        "type": "integer"
      },
      "InvoiceDocumentLinkResponse": {
        "properties": {
          "documentId": {
            "format": "uuid",
            "type": "string"
          },
          "reason": {
            "$ref": "#/components/schemas/InvoiceDocumentLinkReason"
          },
          "trustRank": {
            "$ref": "#/components/schemas/InvoiceSourceTrust"
          }
        },
        "required": [
          "documentId",
          "trustRank",
          "reason"
        ],
        "type": "object"
      },
      "InvoiceFacetsResponse": {
        "properties": {
          "periods": {
            "items": {
              "$ref": "#/components/schemas/InvoicePeriodCountResponse"
            },
            "type": "array"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/InvoiceSeriesCountResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "periods",
          "series"
        ],
        "type": "object"
      },
      "InvoiceNumberGapResponse": {
        "properties": {
          "missingCount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ]
          },
          "missingNumbers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "next": {
            "$ref": "#/components/schemas/InvoiceNumberNeighborResponse"
          },
          "previous": {
            "$ref": "#/components/schemas/InvoiceNumberNeighborResponse"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "series": {
            "type": [
              "null",
              "string"
            ]
          },
          "year": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "series",
          "year",
          "missingCount",
          "missingNumbers",
          "previous",
          "next"
        ],
        "type": "object"
      },
      "InvoiceNumberGapsResponse": {
        "properties": {
          "gaps": {
            "items": {
              "$ref": "#/components/schemas/InvoiceNumberGapResponse"
            },
            "type": "array"
          },
          "totalGaps": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalMissing": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ]
          }
        },
        "required": [
          "totalGaps",
          "totalMissing",
          "gaps"
        ],
        "type": "object"
      },
      "InvoiceNumberNeighborResponse": {
        "properties": {
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "issueDate": {
            "format": "date",
            "type": "string"
          },
          "number": {
            "type": "string"
          }
        },
        "required": [
          "invoiceId",
          "number",
          "issueDate"
        ],
        "type": "object"
      },
      "InvoicePeriodCountResponse": {
        "properties": {
          "count": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "period": {
            "type": "string"
          }
        },
        "required": [
          "period",
          "count"
        ],
        "type": "object"
      },
      "InvoiceResponse": {
        "properties": {
          "correctedInvoiceId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "correctedInvoiceIssueDate": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          },
          "correctedInvoiceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "counterpartyCountryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "counterpartyName": {
            "type": [
              "null",
              "string"
            ]
          },
          "counterpartyTaxId": {
            "type": [
              "null",
              "string"
            ]
          },
          "currencyCode": {
            "type": "string"
          },
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/InvoiceDeliveryResponse"
            },
            "type": "array"
          },
          "direction": {
            "$ref": "#/components/schemas/InvoiceDirection"
          },
          "documentLinks": {
            "items": {
              "$ref": "#/components/schemas/InvoiceDocumentLinkResponse"
            },
            "type": "array"
          },
          "documentTypeCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "dueDate": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isCreditNote": {
            "type": "boolean"
          },
          "issueDate": {
            "format": "date",
            "type": "string"
          },
          "netAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ]
          },
          "number": {
            "type": "string"
          },
          "numberSequence": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          },
          "numberSeries": {
            "type": [
              "null",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DataProviderType"
              }
            ]
          },
          "submission": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/InvoiceSubmissionResponse"
              }
            ]
          },
          "supplierId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "supplierName": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ]
          },
          "vatAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "profileId",
          "direction",
          "supplierId",
          "number",
          "issueDate",
          "currencyCode",
          "netAmount",
          "vatAmount",
          "totalAmount",
          "documentLinks"
        ],
        "type": "object"
      },
      "InvoiceSeriesCountResponse": {
        "properties": {
          "count": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "series": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "series",
          "count"
        ],
        "type": "object"
      },
      "InvoiceSortField": {
        "type": "integer"
      },
      "InvoiceSourceTrust": {
        "type": "integer"
      },
      "InvoiceSubmissionResponse": {
        "properties": {
          "channel": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastErrorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/EFacturaSubmissionState"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "uploadIndex": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "state",
          "updatedAt"
        ],
        "type": "object"
      },
      "JsonElement": {},
      "ManualSendRefusedResponse": {
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "type": [
              "null",
              "object"
            ]
          },
          "errors": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": [
              "null",
              "object"
            ]
          },
          "messageKey": {
            "type": "string"
          },
          "pendingTouchAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "status",
          "code",
          "messageKey"
        ],
        "type": "object"
      },
      "ManualSendResponse": {
        "properties": {
          "pendingTouchAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "scheduledFor": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "sequenceId": {
            "format": "uuid",
            "type": "string"
          },
          "touchId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "touchNumber": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ]
          },
          "verdict": {
            "$ref": "#/components/schemas/ManualTouchVerdict"
          }
        },
        "required": [
          "verdict",
          "sequenceId"
        ],
        "type": "object"
      },
      "ManualTouchVerdict": {
        "type": "integer"
      },
      "MarkExpectedRequest": {
        "properties": {
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "isRecurring": {
            "type": "boolean"
          },
          "period": {
            "type": [
              "null",
              "string"
            ]
          },
          "supplierId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "MarkSpvMessagesReadRequest": {
        "properties": {
          "profileId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "MergeSupplierRequest": {
        "properties": {
          "intoDirectorySlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "intoSupplierId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "MissingInvoicePredictionResponse": {
        "properties": {
          "currencyCode": {
            "type": "string"
          },
          "expectedByDay": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "lastInvoiceIssueDate": {
            "format": "date",
            "type": "string"
          },
          "lastInvoiceTotalAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ]
          },
          "monthsPresent": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "supplierId": {
            "format": "uuid",
            "type": "string"
          },
          "supplierName": {
            "type": [
              "null",
              "string"
            ]
          },
          "usualDay": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "supplierId",
          "usualDay",
          "expectedByDay",
          "monthsPresent",
          "lastInvoiceIssueDate",
          "lastInvoiceTotalAmount",
          "currencyCode"
        ],
        "type": "object"
      },
      "OnboardingSessionRequest": {
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "OnboardingSessionResponse": {
        "properties": {
          "organizations": {
            "items": {
              "$ref": "#/components/schemas/OrganizationMembershipResponse"
            },
            "type": "array"
          },
          "pendingInvitations": {
            "items": {
              "$ref": "#/components/schemas/PendingInvitationResponse"
            },
            "type": "array"
          },
          "personalAffiliate": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PersonalAffiliateSummaryResponse"
              }
            ]
          },
          "user": {
            "$ref": "#/components/schemas/UserResponse"
          }
        },
        "required": [
          "user",
          "organizations",
          "pendingInvitations",
          "personalAffiliate"
        ],
        "type": "object"
      },
      "OpenBillingPortalRequest": {
        "properties": {
          "returnUrl": {
            "type": "string"
          }
        },
        "required": [
          "returnUrl"
        ],
        "type": "object"
      },
      "OrganizationClosureResponse": {
        "properties": {
          "accessEndedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "accessEndsAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "deleteAfter": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "noticeSentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "enum": [
              null,
              "subscription_ended",
              "closed_by_owner",
              "never_subscribed"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "reminderSentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "enum": [
              "none",
              "pending",
              "scheduled",
              "deleting"
            ],
            "type": "string"
          }
        },
        "required": [
          "state"
        ],
        "type": "object"
      },
      "OrganizationKind": {
        "type": "integer"
      },
      "OrganizationMemberGrantsResponse": {
        "properties": {
          "grants": {
            "items": {
              "$ref": "#/components/schemas/ProfileAccessGrantResponse"
            },
            "type": "array"
          },
          "hasOrganizationWideAccess": {
            "type": "boolean"
          },
          "memberId": {
            "format": "uuid",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "memberId",
          "userId",
          "role",
          "hasOrganizationWideAccess",
          "grants"
        ],
        "type": "object"
      },
      "OrganizationMemberResponse": {
        "properties": {
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "grantedProfileCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "hasOrganizationWideAccess": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "userId",
          "email",
          "role",
          "createdAt",
          "grantedProfileCount",
          "hasOrganizationWideAccess"
        ],
        "type": "object"
      },
      "OrganizationMembershipResponse": {
        "properties": {
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasConnectedSource": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "joinedAt": {
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/OrganizationKind"
          },
          "locale": {
            "type": "string"
          },
          "memberCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "package": {
            "$ref": "#/components/schemas/OrganizationPackageResponse"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          },
          "visibleProfileCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "locale",
          "kind",
          "role",
          "joinedAt",
          "visibleProfileCount",
          "hasConnectedSource",
          "memberCount",
          "package"
        ],
        "type": "object"
      },
      "OrganizationPackageResponse": {
        "properties": {
          "includedProfiles": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ]
          },
          "lookupKey": {
            "type": [
              "null",
              "string"
            ]
          },
          "productAccess": {
            "type": "boolean"
          },
          "state": {
            "$ref": "#/components/schemas/EntitlementState"
          }
        },
        "required": [
          "state",
          "productAccess"
        ],
        "type": "object"
      },
      "OrganizationResponse": {
        "properties": {
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "locale"
        ],
        "type": "object"
      },
      "OrganizationRole": {
        "type": "integer"
      },
      "OrganizationSearchResultResponse": {
        "properties": {
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "name"
        ],
        "type": "object"
      },
      "OrganizationSecuritySettingsResponse": {
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "enforceTwoFactor": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "isDefaulted": {
            "type": "boolean"
          },
          "lastUpdatedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "mcpEnabled": {
            "type": "boolean"
          }
        },
        "required": [
          "isDefaulted",
          "enforceTwoFactor",
          "mcpEnabled"
        ],
        "type": "object"
      },
      "OrganizationStatsResponse": {
        "properties": {
          "activeProfileCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "archivedProfileCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "documentCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "invoiceCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "supplierCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "activeProfileCount",
          "archivedProfileCount",
          "invoiceCount",
          "documentCount",
          "supplierCount"
        ],
        "type": "object"
      },
      "PagedResultDtoOfAccountResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AccountResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfDocumentResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DocumentResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfInvoiceAnomalyResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvoiceAnomalyResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfInvoiceResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvoiceResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfMissingInvoicePredictionResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MissingInvoicePredictionResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfProfileResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProfileResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfReviewQueueItemResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ReviewQueueItemResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfSpvMessageResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SpvMessageResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfSupplierConnectionResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SupplierConnectionResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfSupplierResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SupplierResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfSupplierVatValidationResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SupplierVatValidationResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PagedResultDtoOfUnfiledEmailResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UnfiledEmailResponse"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pageSize": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "page",
          "pageSize",
          "totalPages"
        ],
        "type": "object"
      },
      "PauseRemindersRequest": {
        "properties": {
          "resumeAt": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "PendingInvitationResponse": {
        "properties": {
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "grantedProfileCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "hasOrganizationWideAccess": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invitedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "organizationKind": {
            "$ref": "#/components/schemas/OrganizationKind"
          },
          "organizationName": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          }
        },
        "required": [
          "id",
          "organizationId",
          "organizationName",
          "organizationKind",
          "role",
          "expiresAt",
          "hasOrganizationWideAccess",
          "grantedProfileCount"
        ],
        "type": "object"
      },
      "PersonalAffiliateSummaryResponse": {
        "properties": {
          "code": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "ProfileAccessGrantRequest": {
        "properties": {
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/ProfilePermission"
            },
            "type": "array"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId",
          "permissions"
        ],
        "type": "object"
      },
      "ProfileAccessGrantResponse": {
        "properties": {
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/ProfilePermission"
            },
            "type": "array"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId",
          "permissions"
        ],
        "type": "object"
      },
      "ProfileCompletenessResponse": {
        "properties": {
          "expectedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "missing": {
            "items": {
              "$ref": "#/components/schemas/ExpectedDocumentResponse"
            },
            "type": "array"
          },
          "missingCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "period": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "profileName": {
            "type": "string"
          },
          "receivedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "settled": {
            "items": {
              "$ref": "#/components/schemas/ExpectedDocumentResponse"
            },
            "type": "array"
          },
          "waivedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "profileName",
          "period",
          "expectedCount",
          "receivedCount",
          "missingCount",
          "waivedCount",
          "missing",
          "settled"
        ],
        "type": "object"
      },
      "ProfileCompletenessSummaryResponse": {
        "properties": {
          "expectedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "missingCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "profileName": {
            "type": "string"
          },
          "receivedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "waivedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "profileName",
          "expectedCount",
          "receivedCount",
          "missingCount",
          "waivedCount"
        ],
        "type": "object"
      },
      "ProfileContactResponse": {
        "properties": {
          "canReceiveReminders": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "hardBouncedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "hardBouncedEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasHardBounced": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastUpdatedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/ProfileContactRole"
          }
        },
        "required": [
          "id",
          "profileId",
          "email",
          "locale",
          "role",
          "hasHardBounced",
          "canReceiveReminders",
          "createdAt"
        ],
        "type": "object"
      },
      "ProfileContactRole": {
        "type": "integer"
      },
      "ProfilePermission": {
        "type": "integer"
      },
      "ProfileReminderHistoryResponse": {
        "properties": {
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "sequences": {
            "items": {
              "$ref": "#/components/schemas/ReminderSequenceSummaryResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "profileId",
          "sequences"
        ],
        "type": "object"
      },
      "ProfileReminderSettingsResponse": {
        "properties": {
          "effective": {
            "$ref": "#/components/schemas/EffectiveReminderSettingsResponse"
          },
          "hasOverride": {
            "type": "boolean"
          },
          "override": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderSettingsResponse"
              }
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId",
          "hasOverride",
          "effective"
        ],
        "type": "object"
      },
      "ProfileReminderStateResponse": {
        "properties": {
          "escalationConfirmed": {
            "type": "boolean"
          },
          "escalationContactConfigured": {
            "type": "boolean"
          },
          "escalationEnabled": {
            "type": "boolean"
          },
          "escalationRunnable": {
            "type": "boolean"
          },
          "period": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "profileName": {
            "type": "string"
          },
          "sequence": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderSequenceResponse"
              }
            ]
          }
        },
        "required": [
          "profileId",
          "profileName",
          "period",
          "escalationEnabled",
          "escalationConfirmed",
          "escalationContactConfigured",
          "escalationRunnable"
        ],
        "type": "object"
      },
      "ProfileResponse": {
        "properties": {
          "archivedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "canManageSources": {
            "type": "boolean"
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "myPermissions": {
            "items": {
              "$ref": "#/components/schemas/ProfilePermission"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "taxIdentifier": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "locale",
          "createdAt"
        ],
        "type": "object"
      },
      "ProfileSearchResultResponse": {
        "properties": {
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "taxIdentifier": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "name"
        ],
        "type": "object"
      },
      "ProfileStatsResponse": {
        "properties": {
          "documentCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "invoiceCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "supplierCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "invoiceCount",
          "supplierCount",
          "documentCount"
        ],
        "type": "object"
      },
      "RefundRequestAcceptedResponse": {
        "properties": {
          "messageKey": {
            "type": "string"
          },
          "requestedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "requestedAt",
          "messageKey"
        ],
        "type": "object"
      },
      "RegistryCompanyResponse": {
        "properties": {
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "cui": {
            "type": "string"
          },
          "eFacturaEnrolled": {
            "type": "boolean"
          },
          "eFacturaEnrolledSince": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          },
          "found": {
            "type": "boolean"
          },
          "legalName": {
            "type": [
              "null",
              "string"
            ]
          },
          "tradeRegisterNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "vatRegistered": {
            "type": "boolean"
          }
        },
        "required": [
          "cui",
          "found",
          "vatRegistered",
          "eFacturaEnrolled"
        ],
        "type": "object"
      },
      "ReminderPauseReason": {
        "type": "integer"
      },
      "ReminderSequenceResponse": {
        "properties": {
          "closeOutSentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "endedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "foldsInPriorPeriods": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastUpdatedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "maxTouches": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "nextTouchAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "outOfOfficeShiftBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "pauseReason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderPauseReason"
              }
            ]
          },
          "period": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "remainingOutOfOfficeShiftBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "resumeAt": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/ReminderSequenceState"
          },
          "stopReason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderStopReason"
              }
            ]
          },
          "touches": {
            "items": {
              "$ref": "#/components/schemas/ReminderTouchResponse"
            },
            "type": "array"
          },
          "touchesConsumed": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "touchesRemaining": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "profileId",
          "period",
          "state",
          "touchesConsumed",
          "maxTouches",
          "touchesRemaining",
          "foldsInPriorPeriods",
          "outOfOfficeShiftBusinessDays",
          "remainingOutOfOfficeShiftBusinessDays",
          "createdAt",
          "touches"
        ],
        "type": "object"
      },
      "ReminderSequenceState": {
        "type": "integer"
      },
      "ReminderSequenceSummaryResponse": {
        "properties": {
          "closeOutSentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "endedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastTouch": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderTouchResponse"
              }
            ]
          },
          "pauseReason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderPauseReason"
              }
            ]
          },
          "period": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ReminderSequenceState"
          },
          "stopReason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderStopReason"
              }
            ]
          },
          "touchesConsumed": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "period",
          "state",
          "touchesConsumed",
          "createdAt"
        ],
        "type": "object"
      },
      "ReminderSettingsResponse": {
        "properties": {
          "courtesyCloseOutEnabled": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "dailySendCap": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "escalationConfirmed": {
            "type": "boolean"
          },
          "escalationConfirmedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "escalationEnabled": {
            "type": "boolean"
          },
          "escalationGapBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "escalationRunnable": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "isDefaulted": {
            "type": "boolean"
          },
          "lastUpdatedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "maxTouches": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "sendWindowEnd": {
            "format": "time",
            "type": "string"
          },
          "sendWindowStart": {
            "format": "time",
            "type": "string"
          },
          "startOffsetBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "touchGapBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "isDefaulted",
          "startOffsetBusinessDays",
          "touchGapBusinessDays",
          "escalationGapBusinessDays",
          "maxTouches",
          "escalationEnabled",
          "escalationConfirmed",
          "escalationRunnable",
          "courtesyCloseOutEnabled",
          "sendWindowStart",
          "sendWindowEnd",
          "dailySendCap"
        ],
        "type": "object"
      },
      "ReminderStopReason": {
        "type": "integer"
      },
      "ReminderTouchCancelReason": {
        "type": "integer"
      },
      "ReminderTouchOutcome": {
        "type": "integer"
      },
      "ReminderTouchResponse": {
        "properties": {
          "cancelReason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReminderTouchCancelReason"
              }
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isEscalation": {
            "type": "boolean"
          },
          "isManual": {
            "type": "boolean"
          },
          "missingItemCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ]
          },
          "outcome": {
            "$ref": "#/components/schemas/ReminderTouchOutcome"
          },
          "recipientContactId": {
            "format": "uuid",
            "type": "string"
          },
          "recipientEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "recipientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduledFor": {
            "format": "date-time",
            "type": "string"
          },
          "sentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "touchNumber": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "touchNumber",
          "isManual",
          "isEscalation",
          "outcome",
          "scheduledFor",
          "recipientContactId"
        ],
        "type": "object"
      },
      "RemindersSendingTodayResponse": {
        "properties": {
          "dayEndUtc": {
            "format": "date-time",
            "type": "string"
          },
          "dayStartUtc": {
            "format": "date-time",
            "type": "string"
          },
          "localDay": {
            "format": "date",
            "type": "string"
          },
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/SendingTodayProfileResponse"
            },
            "type": "array"
          },
          "timeZoneId": {
            "type": "string"
          },
          "totalTouches": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "localDay",
          "timeZoneId",
          "dayStartUtc",
          "dayEndUtc",
          "totalTouches",
          "profiles"
        ],
        "type": "object"
      },
      "RenameAffiliateCodeRequest": {
        "properties": {
          "code": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "ReplaceMemberGrantsRequest": {
        "properties": {
          "grants": {
            "items": {
              "$ref": "#/components/schemas/ProfileAccessGrantRequest"
            },
            "type": "array"
          }
        },
        "required": [
          "grants"
        ],
        "type": "object"
      },
      "RequestRefundRequest": {
        "properties": {
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "ReviewCountResponse": {
        "properties": {
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/ReviewProfileCountResponse"
            },
            "type": "array"
          },
          "total": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "total",
          "profiles"
        ],
        "type": "object"
      },
      "ReviewDecisionResponse": {
        "properties": {
          "decidedAt": {
            "format": "date-time",
            "type": "string"
          },
          "decisionId": {
            "format": "uuid",
            "type": "string"
          },
          "documentId": {
            "format": "uuid",
            "type": "string"
          },
          "outcome": {
            "$ref": "#/components/schemas/ReviewOutcome"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          }
        },
        "required": [
          "decisionId",
          "documentId",
          "profileId",
          "outcome",
          "status",
          "decidedAt"
        ],
        "type": "object"
      },
      "ReviewDocumentResponse": {
        "properties": {
          "contentHash": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "documentId": {
            "format": "uuid",
            "type": "string"
          },
          "fieldScores": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "hasCandidate": {
            "type": "boolean"
          },
          "lastArrivalAt": {
            "format": "date-time",
            "type": "string"
          },
          "originalFileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "preFillSuggested": {
            "type": "boolean"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "profileName": {
            "type": "string"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "sizeBytes": {
            "format": "int64",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          },
          "values": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        },
        "required": [
          "documentId",
          "profileId",
          "profileName",
          "contentType",
          "sizeBytes",
          "contentHash",
          "receivedAt",
          "lastArrivalAt",
          "status",
          "hasCandidate",
          "preFillSuggested"
        ],
        "type": "object"
      },
      "ReviewOutcome": {
        "type": "integer"
      },
      "ReviewProfileCountResponse": {
        "properties": {
          "pendingCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId",
          "pendingCount"
        ],
        "type": "object"
      },
      "ReviewQueueItemResponse": {
        "properties": {
          "documentId": {
            "format": "uuid",
            "type": "string"
          },
          "hasCandidate": {
            "type": "boolean"
          },
          "lastArrivalAt": {
            "format": "date-time",
            "type": "string"
          },
          "originalFileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "preFillSuggested": {
            "type": "boolean"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "profileName": {
            "type": "string"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "documentId",
          "profileId",
          "profileName",
          "receivedAt",
          "lastArrivalAt",
          "hasCandidate",
          "preFillSuggested"
        ],
        "type": "object"
      },
      "RevokeUploadLinkResponse": {
        "properties": {
          "linkId": {
            "format": "uuid",
            "type": "string"
          },
          "revokedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "linkId",
          "revokedAt"
        ],
        "type": "object"
      },
      "SalesInvoiceDeliveriesResponse": {
        "properties": {
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/SalesInvoiceDeliveryResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "deliveries"
        ],
        "type": "object"
      },
      "SalesInvoiceDeliveryResponse": {
        "properties": {
          "attempts": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "lastAttemptAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "lastError": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedByApiKeyId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "requestedByUserId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "resendOfId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "sentAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/SalesInvoiceDeliveryState"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "invoiceId",
          "to",
          "state",
          "attempts",
          "createdAt"
        ],
        "type": "object"
      },
      "SalesInvoiceDeliveryState": {
        "type": "integer"
      },
      "SalesInvoiceSubmissionConflictResponse": {
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "details": {
            "additionalProperties": {
              "type": "string"
            },
            "type": [
              "null",
              "object"
            ]
          },
          "errors": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": [
              "null",
              "object"
            ]
          },
          "messageKey": {
            "type": "string"
          },
          "status": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "submission": {
            "$ref": "#/components/schemas/SalesInvoiceSubmissionResponse"
          }
        },
        "required": [
          "submission",
          "status",
          "code",
          "messageKey"
        ],
        "type": "object"
      },
      "SalesInvoiceSubmissionHistoryResponse": {
        "properties": {
          "history": {
            "items": {
              "$ref": "#/components/schemas/SalesInvoiceSubmissionResponse"
            },
            "type": "array"
          },
          "latest": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SalesInvoiceSubmissionResponse"
              }
            ]
          }
        },
        "required": [
          "history"
        ],
        "type": "object"
      },
      "SalesInvoiceSubmissionResponse": {
        "properties": {
          "attempts": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "channel": {
            "type": "string"
          },
          "completedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "cui": {
            "type": "string"
          },
          "downloadId": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "lastErrorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastErrorMessage": {
            "type": [
              "null",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "requestedByApiKeyId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "requestedByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedByUserId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "responseArchiveDocumentId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/EFacturaSubmissionState"
          },
          "uncertainSince": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "uploadIndex": {
            "type": [
              "null",
              "string"
            ]
          },
          "uploadedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "xmlDocumentId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "invoiceId",
          "profileId",
          "state",
          "cui",
          "attempts",
          "xmlDocumentId",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "SearchCategoryResponseOfOrganizationSearchResultResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/OrganizationSearchResultResponse"
            },
            "type": "array"
          },
          "limit": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "timedOut": {
            "type": "boolean"
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "limit",
          "totalPages",
          "timedOut"
        ],
        "type": "object"
      },
      "SearchCategoryResponseOfProfileSearchResultResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProfileSearchResultResponse"
            },
            "type": "array"
          },
          "limit": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "timedOut": {
            "type": "boolean"
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "limit",
          "totalPages",
          "timedOut"
        ],
        "type": "object"
      },
      "SearchCategoryResponseOfSearchResultResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SearchResultResponse"
            },
            "type": "array"
          },
          "limit": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "timedOut": {
            "type": "boolean"
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "limit",
          "totalPages",
          "timedOut"
        ],
        "type": "object"
      },
      "SearchCategoryResponseOfSourceSearchResultResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SourceSearchResultResponse"
            },
            "type": "array"
          },
          "limit": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "timedOut": {
            "type": "boolean"
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "limit",
          "totalPages",
          "timedOut"
        ],
        "type": "object"
      },
      "SearchCategoryResponseOfSpvMessageSearchResultResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SpvMessageSearchResultResponse"
            },
            "type": "array"
          },
          "limit": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "timedOut": {
            "type": "boolean"
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "limit",
          "totalPages",
          "timedOut"
        ],
        "type": "object"
      },
      "SearchCategoryResponseOfSupplierSearchResultResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SupplierSearchResultResponse"
            },
            "type": "array"
          },
          "limit": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "timedOut": {
            "type": "boolean"
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "limit",
          "totalPages",
          "timedOut"
        ],
        "type": "object"
      },
      "SearchCategoryResponseOfUserSearchResultResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UserSearchResultResponse"
            },
            "type": "array"
          },
          "limit": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "timedOut": {
            "type": "boolean"
          },
          "totalCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "totalPages": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "items",
          "totalCount",
          "limit",
          "totalPages",
          "timedOut"
        ],
        "type": "object"
      },
      "SearchMatchField": {
        "type": "integer"
      },
      "SearchMatchedLineResponse": {
        "properties": {
          "currencyCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": "string"
          },
          "lineTotal": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          },
          "netAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          },
          "quantity": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "unitPrice": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          }
        },
        "required": [
          "description"
        ],
        "type": "object"
      },
      "SearchResponse": {
        "properties": {
          "documents": {
            "$ref": "#/components/schemas/SearchCategoryResponseOfSearchResultResponse"
          },
          "organizations": {
            "$ref": "#/components/schemas/SearchCategoryResponseOfOrganizationSearchResultResponse"
          },
          "profileId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "profiles": {
            "$ref": "#/components/schemas/SearchCategoryResponseOfProfileSearchResultResponse"
          },
          "query": {
            "type": "string"
          },
          "sources": {
            "$ref": "#/components/schemas/SearchCategoryResponseOfSourceSearchResultResponse"
          },
          "spvMessages": {
            "$ref": "#/components/schemas/SearchCategoryResponseOfSpvMessageSearchResultResponse"
          },
          "suppliers": {
            "$ref": "#/components/schemas/SearchCategoryResponseOfSupplierSearchResultResponse"
          },
          "users": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchCategoryResponseOfUserSearchResultResponse"
              }
            ]
          }
        },
        "required": [
          "query",
          "documents",
          "profiles",
          "sources",
          "spvMessages",
          "organizations",
          "suppliers"
        ],
        "type": "object"
      },
      "SearchResultResponse": {
        "properties": {
          "documentId": {
            "format": "uuid",
            "type": "string"
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceCurrencyCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceIssueDate": {
            "format": "date",
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "invoiceTotalAmount": {
            "format": "double",
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ]
          },
          "lastArrivalAt": {
            "format": "date-time",
            "type": "string"
          },
          "matchedIn": {
            "$ref": "#/components/schemas/SearchMatchField"
          },
          "matchedLine": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchMatchedLineResponse"
              }
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "snippet": {
            "type": "string"
          },
          "supplierName": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "documentId",
          "profileId",
          "receivedAt",
          "lastArrivalAt",
          "snippet",
          "matchedIn"
        ],
        "type": "object"
      },
      "SendingTodayProfileResponse": {
        "properties": {
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "profileName": {
            "type": "string"
          },
          "touchCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "touches": {
            "items": {
              "$ref": "#/components/schemas/ReminderTouchResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "profileId",
          "profileName",
          "touchCount",
          "touches"
        ],
        "type": "object"
      },
      "SetSupplierConnectionMethodsRequest": {
        "properties": {
          "connectionMethods": {
            "items": {
              "$ref": "#/components/schemas/SupplierConnectionMethod"
            },
            "type": "array"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "connectionMethods"
        ],
        "type": "object"
      },
      "SetupChecklistPreferenceResponse": {
        "properties": {
          "skippedItems": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updatedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "skippedItems"
        ],
        "type": "object"
      },
      "SortDirection": {
        "type": "integer"
      },
      "SourceSearchResultResponse": {
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "providerType": {
            "$ref": "#/components/schemas/DataProviderType"
          },
          "tag": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "accountId",
          "profileId",
          "providerType"
        ],
        "type": "object"
      },
      "SpvCollectResponse": {
        "properties": {
          "documentId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "SpvMessageResponse": {
        "properties": {
          "anafCreatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "anafMessageId": {
            "type": "string"
          },
          "collection": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "cui": {
            "type": "string"
          },
          "details": {
            "type": [
              "null",
              "string"
            ]
          },
          "documentId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "heldReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "readAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "readById": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "requestId": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "profileId",
          "cui",
          "anafMessageId",
          "type",
          "anafCreatedAt",
          "createdAt"
        ],
        "type": "object"
      },
      "SpvMessageSearchResultResponse": {
        "properties": {
          "anafCreatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "anafMessageId": {
            "type": "string"
          },
          "messageId": {
            "format": "uuid",
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "messageId",
          "profileId",
          "type",
          "anafMessageId",
          "anafCreatedAt"
        ],
        "type": "object"
      },
      "SpvMessagesMarkedReadResponse": {
        "properties": {
          "markedCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "markedCount"
        ],
        "type": "object"
      },
      "SpvProfileUnreadCount": {
        "properties": {
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "unreadCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "profileId",
          "unreadCount"
        ],
        "type": "object"
      },
      "SpvTransmissionConsentResponse": {
        "properties": {
          "canEnable": {
            "type": "boolean"
          },
          "disabledAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "disabledById": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "disabledByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "enabledAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "enabledById": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "enabledByName": {
            "type": [
              "null",
              "string"
            ]
          },
          "holderName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lockedReason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SpvTransmissionLockedReason"
              }
            ]
          },
          "organizationEnabled": {
            "type": "boolean"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId",
          "enabled",
          "organizationEnabled",
          "canEnable"
        ],
        "type": "object"
      },
      "SpvTransmissionLockedReason": {
        "enum": [
          "noTaxId",
          "notEnrolled",
          "notConnected",
          "notHolder",
          "noPermission",
          null
        ]
      },
      "SpvUnreadCountResponse": {
        "properties": {
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/SpvProfileUnreadCount"
            },
            "type": "array"
          },
          "total": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "total",
          "profiles"
        ],
        "type": "object"
      },
      "StartCheckoutRequest": {
        "properties": {
          "cancelUrl": {
            "type": "string"
          },
          "priceLookupKey": {
            "type": "string"
          },
          "successUrl": {
            "type": "string"
          }
        },
        "required": [
          "priceLookupKey",
          "successUrl",
          "cancelUrl"
        ],
        "type": "object"
      },
      "StatusResponse": {
        "description": "What this route answers with: who the caller is, which\norganization the request is scoped to, and the id it is traced under.",
        "properties": {
          "actor": {
            "$ref": "#/components/schemas/ActorType",
            "description": "Which door the request came through."
          },
          "correlationId": {
            "description": "The id this request is traced under, echoed in X-Correlation-Id.",
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "description": "The organization the request is attached to, or null when nothing attached one.",
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "actor",
          "organizationId",
          "correlationId"
        ],
        "type": "object"
      },
      "StringSegment": {
        "properties": {
          "buffer": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasValue": {
            "type": "boolean"
          },
          "length": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "offset": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "SubmitConnectorCredentialsRequest": {
        "properties": {
          "directorySlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "fields": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "profileId",
          "fields"
        ],
        "type": "object"
      },
      "SupplierConnectionMethod": {
        "type": "integer"
      },
      "SupplierConnectionResponse": {
        "properties": {
          "connectionMethods": {
            "items": {
              "$ref": "#/components/schemas/SupplierConnectionMethod"
            },
            "type": "array"
          },
          "directorySlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "senderAddresses": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "supplier": {
            "$ref": "#/components/schemas/SupplierResponse"
          },
          "tutorialContentKey": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "supplier",
          "senderAddresses",
          "connectionMethods"
        ],
        "type": "object"
      },
      "SupplierConnectorCredentialState": {
        "type": "integer"
      },
      "SupplierDirectoryEntryResponse": {
        "properties": {
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "connectionMethods": {
            "items": {
              "$ref": "#/components/schemas/SupplierConnectionMethod"
            },
            "type": "array"
          },
          "connectorSlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "senderAddresses": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "slug": {
            "type": "string"
          },
          "taxIdentifierType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TaxIdentifierType"
              }
            ]
          },
          "taxIdentifierValue": {
            "type": [
              "null",
              "string"
            ]
          },
          "tutorialContentKey": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "displayName",
          "connectionMethods",
          "tutorialContentKey",
          "senderAddresses",
          "aliases"
        ],
        "type": "object"
      },
      "SupplierResponse": {
        "properties": {
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "directorySlug": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "taxIdentifierType": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TaxIdentifierType"
              }
            ]
          },
          "taxIdentifierValue": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "profileId",
          "name"
        ],
        "type": "object"
      },
      "SupplierSearchResultResponse": {
        "properties": {
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "slug": {
            "type": [
              "null",
              "string"
            ]
          },
          "supplierDirectoryEntryId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "supplierId": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "taxIdentifier": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "displayName"
        ],
        "type": "object"
      },
      "SupplierVatCountResponse": {
        "properties": {
          "invalid": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "missing": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "invalid",
          "missing"
        ],
        "type": "object"
      },
      "SupplierVatValidationResponse": {
        "properties": {
          "checkedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "countryCode": {
            "type": "string"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "supplierId": {
            "format": "uuid",
            "type": "string"
          },
          "supplierName": {
            "type": "string"
          },
          "vatNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "viesName": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "supplierId",
          "profileId",
          "supplierName",
          "countryCode",
          "status"
        ],
        "type": "object"
      },
      "TaxIdentifierType": {
        "type": "integer"
      },
      "TrendPointResponse": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "documents": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "invoices": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "date",
          "invoices",
          "documents"
        ],
        "type": "object"
      },
      "TrendResponse": {
        "properties": {
          "from": {
            "format": "date",
            "type": "string"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/TrendPointResponse"
            },
            "type": "array"
          },
          "to": {
            "format": "date",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "points"
        ],
        "type": "object"
      },
      "UnfiledEmailResponse": {
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "fieldsPurgedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "forwardedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "forwardedTo": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "linkCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "links": {
            "items": {
              "$ref": "#/components/schemas/UnfiledLinkResponse"
            },
            "type": "array"
          },
          "linksTruncated": {
            "type": "boolean"
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "resolvedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "resolvedById": {
            "format": "uuid",
            "type": [
              "null",
              "string"
            ]
          },
          "senderAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "senderDisplayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "subject": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "accountId",
          "profileId",
          "links",
          "linkCount",
          "linksTruncated",
          "receivedAt",
          "createdAt"
        ],
        "type": "object"
      },
      "UnfiledLinkDecision": {
        "type": "integer"
      },
      "UnfiledLinkResponse": {
        "properties": {
          "clickable": {
            "type": "boolean"
          },
          "decision": {
            "$ref": "#/components/schemas/UnfiledLinkDecision"
          },
          "fetchFailed": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "host",
          "decision",
          "clickable",
          "fetchFailed"
        ],
        "type": "object"
      },
      "UpdateAccountRequest": {
        "properties": {
          "config": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "tag": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "type": "object"
      },
      "UpdateDigestPreferenceRequest": {
        "properties": {
          "frequency": {
            "$ref": "#/components/schemas/DigestFrequency"
          }
        },
        "required": [
          "frequency"
        ],
        "type": "object"
      },
      "UpdateEFacturaScopeRequest": {
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/EFacturaCollectionScope"
          }
        },
        "required": [
          "scope"
        ],
        "type": "object"
      },
      "UpdateOrganizationRequest": {
        "properties": {
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "UpdateOrganizationSecuritySettingsRequest": {
        "properties": {
          "enforceTwoFactor": {
            "type": "boolean"
          },
          "mcpEnabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enforceTwoFactor",
          "mcpEnabled"
        ],
        "type": "object"
      },
      "UpdateProfileContactRequest": {
        "properties": {
          "clearDisplayName": {
            "type": "boolean"
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileContactRole"
              }
            ]
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "UpdateProfileRequest": {
        "properties": {
          "countryCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": "string"
          },
          "taxIdentifier": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "UpdateReminderSettingsRequest": {
        "properties": {
          "confirmEscalation": {
            "type": "boolean"
          },
          "courtesyCloseOutEnabled": {
            "type": "boolean"
          },
          "dailySendCap": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "escalationEnabled": {
            "type": "boolean"
          },
          "escalationGapBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "maxTouches": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "sendWindowEnd": {
            "format": "time",
            "type": "string"
          },
          "sendWindowStart": {
            "format": "time",
            "type": "string"
          },
          "startOffsetBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "touchGapBusinessDays": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "startOffsetBusinessDays",
          "touchGapBusinessDays",
          "escalationGapBusinessDays",
          "maxTouches",
          "sendWindowStart",
          "sendWindowEnd",
          "dailySendCap",
          "courtesyCloseOutEnabled",
          "escalationEnabled"
        ],
        "type": "object"
      },
      "UpdateSetupChecklistPreferenceRequest": {
        "properties": {
          "skippedItems": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "skippedItems"
        ],
        "type": "object"
      },
      "UpdateSpvTransmissionConsentRequest": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UploadLinkDetailsResponse": {
        "properties": {
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "profileName": {
            "type": "string"
          }
        },
        "required": [
          "profileName",
          "locale",
          "expiresAt"
        ],
        "type": "object"
      },
      "UploadLinkFileResponse": {
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "duplicate": {
            "type": "boolean"
          },
          "errorCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileName": {
            "type": "string"
          },
          "messageKey": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "fileName",
          "accepted"
        ],
        "type": "object"
      },
      "UploadLinkSummaryResponse": {
        "properties": {
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isExpired": {
            "type": "boolean"
          },
          "isRevoked": {
            "type": "boolean"
          },
          "isUsable": {
            "type": "boolean"
          },
          "issuedAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastUsedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "profileId": {
            "format": "uuid",
            "type": "string"
          },
          "revokedAt": {
            "format": "date-time",
            "type": [
              "null",
              "string"
            ]
          },
          "useCount": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "id",
          "profileId",
          "issuedAt",
          "expiresAt",
          "isRevoked",
          "isExpired",
          "isUsable",
          "useCount"
        ],
        "type": "object"
      },
      "UploadLinkUploadResponse": {
        "properties": {
          "accepted": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/UploadLinkFileResponse"
            },
            "type": "array"
          },
          "rejected": {
            "format": "int32",
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ]
          }
        },
        "required": [
          "accepted",
          "rejected",
          "files"
        ],
        "type": "object"
      },
      "UserResponse": {
        "properties": {
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "locale"
        ],
        "type": "object"
      },
      "UserSearchResultResponse": {
        "properties": {
          "avatarThumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "avatarUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "displayName": {
            "type": "string"
          },
          "membershipId": {
            "format": "uuid",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/OrganizationRole"
          }
        },
        "required": [
          "membershipId",
          "displayName",
          "role"
        ],
        "type": "object"
      },
      "WaiveExpectedDocumentRequest": {
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "stopRecurring": {
            "type": "boolean"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "description": "A Syllevo API key on its own header, for callers that would rather not put it on Authorization. Identical in every other respect.",
        "in": "header",
        "name": "X-Api-Key",
        "type": "apiKey"
      },
      "bearerAuth": {
        "bearerFormat": "JWT",
        "description": "`Authorization: Bearer <token>`. Either a WorkOS session access token or a Syllevo API key - the key prefix tells them apart. A session names its organization with the X-Organization-Id header; a key already carries one.",
        "scheme": "bearer",
        "type": "http"
      },
      "ingestionSignature": {
        "description": "Hex-encoded HMAC-SHA256 over the signing timestamp and the raw body, sent with that timestamp in X-Syllevo-Timestamp. The email ingestion webhook takes no session and no API key; this signature is the whole of its authentication, and a request that fails it is refused without being told why.",
        "in": "header",
        "name": "X-Syllevo-Signature",
        "type": "apiKey"
      },
      "organizationId": {
        "description": "Which organization a session-authenticated request is scoped to. An accountant belongs to more than one, and this is how a request says which. Not sent with an API key, which is issued to one organization and cannot act outside it.",
        "in": "header",
        "name": "X-Organization-Id",
        "type": "apiKey"
      },
      "stripeSignature": {
        "description": "Stripe's own signature over the raw body, carrying the signing timestamp and one or more version-prefixed signatures. Only Stripe holds the endpoint secret that produces it, so this is not an endpoint a client of this API calls: it is documented so the door is visible rather than because anyone else can open it. A request that fails verification is refused without being told why.",
        "in": "header",
        "name": "Stripe-Signature",
        "type": "apiKey"
      }
    }
  },
  "externalDocs": {
    "description": "Syllevo API documentation",
    "url": "https://syllevo.com/docs/api"
  }
}
