{
 "openapi": "3.1.0",
 "info": {
  "title": "Robodam Scan API",
  "description": "Public API of Robodam Scan. Authenticate with `Authorization: Bearer rbs_…` (a permanent API key from Nustatymai → Paskyra → API raktai). Every response carries `X-Request-ID` and `X-Contract-Version`; every error body a top-level `request_id`. Limited endpoints answer `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` and, on 429, `Retry-After`. `x-error-codes` lists the `detail.error` codes and whether retrying the same request can help. Guide: https://scan.robodam.com/dokumentacija",
  "version": "2026-09-30"
 },
 "servers": [
  {
   "url": "https://scan-api.robodam.com"
  }
 ],
 "paths": {
  "/api/v1/auth/register": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Register",
    "operationId": "register_api_v1_auth_register_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RegisterRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SecureAuthResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/login": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Login",
    "description": "Sign in with e-mail and password. Returns an access token; the refresh token is set as an httpOnly cookie. For server-to-server use, create an API key instead (`POST /api/v1/auth/api-keys`).",
    "operationId": "login_api_v1_auth_login_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LoginRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SecureAuthResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/refresh": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Refresh Token",
    "description": "A new access token from the refresh-token cookie.",
    "operationId": "refresh_token_api_v1_auth_refresh_post",
    "parameters": [
     {
      "name": "refresh_token",
      "in": "cookie",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Refresh Token"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AccessTokenResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/logout": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Logout",
    "operationId": "logout_api_v1_auth_logout_post",
    "parameters": [
     {
      "name": "refresh_token",
      "in": "cookie",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Refresh Token"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/logout-all": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Logout All",
    "operationId": "logout_all_api_v1_auth_logout_all_post",
    "responses": {
     "204": {
      "description": "Successful Response"
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/me": {
   "get": {
    "tags": [
     "Authentication"
    ],
    "summary": "Get Me",
    "operationId": "get_me_api_v1_auth_me_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UserResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Authentication"
    ],
    "summary": "Delete My Account",
    "operationId": "delete_my_account_api_v1_auth_me_delete",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DeleteAccountRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/me/language": {
   "patch": {
    "tags": [
     "Authentication"
    ],
    "summary": "Update My Language",
    "operationId": "update_my_language_api_v1_auth_me_language_patch",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UpdateLanguageRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UserResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/change-password": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Change Password",
    "operationId": "change_password_api_v1_auth_change_password_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ChangePasswordRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/statistics": {
   "get": {
    "tags": [
     "Authentication"
    ],
    "summary": "Get Statistics",
    "operationId": "get_statistics_api_v1_auth_statistics_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UserStatisticsResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/api-keys": {
   "get": {
    "tags": [
     "Authentication"
    ],
    "summary": "List Api Keys",
    "description": "The caller's API keys — metadata only, never the key itself.",
    "operationId": "list_api_keys_api_v1_auth_api_keys_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "items": {
          "$ref": "#/components/schemas/ApiKeyResponse"
         },
         "type": "array",
         "title": "Response List Api Keys Api V1 Auth Api Keys Get"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Create Api Key",
    "description": "Create a permanent API key (`rbs_…`). The plaintext key is shown in this response only — store it now. Only a signed-in session can create a key; a request authenticated by an API key is refused (403).",
    "operationId": "create_api_key_api_v1_auth_api_keys_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ApiKeyCreateRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ApiKeyCreatedResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/api-keys/{key_id}": {
   "delete": {
    "tags": [
     "Authentication"
    ],
    "summary": "Revoke Api Key",
    "description": "Revoke an API key. Idempotent; the key stops working immediately.",
    "operationId": "revoke_api_key_api_v1_auth_api_keys__key_id__delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Key Id"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/forgot-password": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Forgot Password",
    "operationId": "forgot_password_api_v1_auth_forgot_password_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ForgotPasswordRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/reset-password": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Reset Password",
    "operationId": "reset_password_api_v1_auth_reset_password_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ResetPasswordRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/verify-email": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Verify Email",
    "operationId": "verify_email_api_v1_auth_verify_email_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/VerifyEmailRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EmailVerificationResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/auth/resend-verification": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Resend Verification",
    "operationId": "resend_verification_api_v1_auth_resend_verification_post",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/verification-status": {
   "get": {
    "tags": [
     "Authentication"
    ],
    "summary": "Get Verification Status",
    "operationId": "get_verification_status_api_v1_auth_verification_status_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/auth/sign-agreement": {
   "post": {
    "tags": [
     "Authentication"
    ],
    "summary": "Sign Agreement",
    "operationId": "sign_agreement_api_v1_auth_sign_agreement_post",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/invoices/upload": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Upload Invoice",
    "description": "Upload one PDF (or a JPG/PNG/HEIC photo, converted to PDF) for asynchronous processing; poll `GET /api/v1/invoices/{invoice_id}` for the result. `Idempotency-Key` header or `external_id` form field: your own document id — a repeat with the same id answers the first upload (201, the same body) whatever the bytes. The same file uploaded again without an id answers 409 `duplicate_invoice` with the existing invoice id; `allow_duplicate=true` uploads it anyway. For an account with the fuel-statement capability (enabled per account by Robodam, off by default — without it nothing here applies): a machine-printed fuel-card statement whose printed totals reconcile is read from the PDF text layer and is exempt from the page cap (up to 200 pages); a bundle of several such documents becomes one child invoice per document (the uploaded row answers `status: split`). When the statement reader is busy or did not answer, the upload answers 503 `service_unavailable` (`retryable: true`) — send the same file again later; that is never reported as `too_many_pages`.",
    "operationId": "upload_invoice_api_v1_invoices_upload_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "allow_duplicate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "If true, bypass the SHA256 duplicate check and upload anyway. Use after the user explicitly confirms they want to re-upload.",
       "default": false,
       "title": "Allow Duplicate"
      },
      "description": "If true, bypass the SHA256 duplicate check and upload anyway. Use after the user explicitly confirms they want to re-upload."
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Your own id for this document (1–128 characters). Stored as the invoice's `external_id`; a repeat with the same key answers the FIRST result instead of creating (and billing) a second document. Same as the `external_id` form field — send either, or both equal.",
       "title": "Idempotency-Key"
      },
      "description": "Your own id for this document (1–128 characters). Stored as the invoice's `external_id`; a repeat with the same key answers the FIRST result instead of creating (and billing) a second document. Same as the `external_id` form field — send either, or both equal."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_invoice_api_v1_invoices_upload_post"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InvoiceUploadResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/batch-upload": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Batch Upload Invoices",
    "description": "Upload several files in one request. Always 201 with one result per file — also when every file failed (`failed == total`); read each `results[].status` and `results[].error`. Idempotency is per file: one `external_id` form field per file, in the files' order (an `Idempotency-Key` header is refused here, 422 `invalid_external_id`).",
    "operationId": "batch_upload_invoices_api_v1_invoices_batch_upload_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "allow_duplicate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "If true, bypass duplicate detection for all files in the batch.",
       "default": false,
       "title": "Allow Duplicate"
      },
      "description": "If true, bypass duplicate detection for all files in the batch."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_batch_upload_invoices_api_v1_invoices_batch_upload_post"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BatchUploadResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "List Invoices",
    "description": "The caller's invoices, paginated, with search, filters and sorting. The list carries a shortened `extracted_data` (the same key names); fetch `GET /api/v1/invoices/{invoice_id}` for the full document. Incremental sync: `sort_by=updated_at&sort_order=asc`, then pass each page's `next_cursor` back as `cursor` until it is null; start the next sync 2 minutes before the last row's `updated_at` (`updated_after`).",
    "operationId": "list_invoices_api_v1_invoices_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "description": "Page number (1-indexed)",
       "default": 1,
       "title": "Page"
      },
      "description": "Page number (1-indexed)"
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "description": "Items per page (max 100)",
       "default": 50,
       "title": "Page Size"
      },
      "description": "Items per page (max 100)"
     },
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 100
        },
        {
         "type": "null"
        }
       ],
       "description": "Search by invoice number, filename, or vendor name",
       "title": "Search"
      },
      "description": "Search by invoice number, filename, or vendor name"
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by processing status, comma-separated, case-insensitive: uploaded, processing, processed, failed, unprocessed, rejected, detection_pending, split, skipped_trial_exhausted. An unknown value is 422 `invalid_filter_value`.",
       "title": "Status"
      },
      "description": "Filter by processing status, comma-separated, case-insensitive: uploaded, processing, processed, failed, unprocessed, rejected, detection_pending, split, skipped_trial_exhausted. An unknown value is 422 `invalid_filter_value`."
     },
     {
      "name": "validation_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by validation status, comma-separated, case-insensitive: unvalidated, validated_correct, validated_incorrect, validated_partial, auto_validated (correct / incorrect / partial accepted as short forms). An unknown value is 422 `invalid_filter_value`.",
       "title": "Validation Status"
      },
      "description": "Filter by validation status, comma-separated, case-insensitive: unvalidated, validated_correct, validated_incorrect, validated_partial, auto_validated (correct / incorrect / partial accepted as short forms). An unknown value is 422 `invalid_filter_value`."
     },
     {
      "name": "start_date",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter invoices created on or after this date",
       "title": "Start Date"
      },
      "description": "Filter invoices created on or after this date"
     },
     {
      "name": "end_date",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter invoices created on or before this date",
       "title": "End Date"
      },
      "description": "Filter invoices created on or before this date"
     },
     {
      "name": "max_confidence",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer",
         "maximum": 100,
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "description": "Show only invoices with confidence_score <= this value (e.g. 84 to find 'needs review' rows)",
       "title": "Max Confidence"
      },
      "description": "Show only invoices with confidence_score <= this value (e.g. 84 to find 'needs review' rows)"
     },
     {
      "name": "min_confidence",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer",
         "maximum": 100,
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "description": "Show only invoices with confidence_score >= this value",
       "title": "Min Confidence"
      },
      "description": "Show only invoices with confidence_score >= this value"
     },
     {
      "name": "expense_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "unassigned",
          "ai",
          "manual"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by expense-assignment status",
       "title": "Expense Status"
      },
      "description": "Filter by expense-assignment status"
     },
     {
      "name": "erp_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "draft",
          "failed",
          "pending",
          "none",
          "disabled",
          "held",
          "not_sending",
          "unassigned"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by ERP push status (draft/failed/pending/none/disabled/held/not_sending/unassigned) — exactly the value the list badge shows (`display_push_status`). `failed` = TIKROS nesėkmės; `disabled` = praleista dėl išjungto siuntimo — DB abu yra `failed`; `held` = laukia buhalterės (Optimum ir Rivilės K3 sulaikymai); `not_sending` = eilutė, pažymėta „Nesiųsti“ (bet kuri sistema), arba Optimum atsisakymas visam laikui; `unassigned` = paskyros lizdo praleidimas: dokumentas nepriskirtas jokiai įmonei arba įmonės pačios pardavimas be kodų — laukia jos sprendimo",
       "title": "Erp Status"
      },
      "description": "Filter by ERP push status (draft/failed/pending/none/disabled/held/not_sending/unassigned) — exactly the value the list badge shows (`display_push_status`). `failed` = TIKROS nesėkmės; `disabled` = praleista dėl išjungto siuntimo — DB abu yra `failed`; `held` = laukia buhalterės (Optimum ir Rivilės K3 sulaikymai); `not_sending` = eilutė, pažymėta „Nesiųsti“ (bet kuri sistema), arba Optimum atsisakymas visam laikui; `unassigned` = paskyros lizdo praleidimas: dokumentas nepriskirtas jokiai įmonei arba įmonės pačios pardavimas be kodų — laukia jos sprendimo"
     },
     {
      "name": "agent_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "entered",
          "not_entered",
          "doubt",
          "none"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter by Suvedimo Agento outcome (entered/not_entered/doubt/none). `not_entered` returns only OPEN ones — resolved (later entered) rows drop out.",
       "title": "Agent Status"
      },
      "description": "Filter by Suvedimo Agento outcome (entered/not_entered/doubt/none). `not_entered` returns only OPEN ones — resolved (later entered) rows drop out."
     },
     {
      "name": "updated_after",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only invoices updated at/after this ISO datetime (incremental sync). Naive values are interpreted as UTC — send a 'Z' suffix to be explicit.",
       "title": "Updated After"
      },
      "description": "Only invoices updated at/after this ISO datetime (incremental sync). Naive values are interpreted as UTC — send a 'Z' suffix to be explicit."
     },
     {
      "name": "sort_by",
      "in": "query",
      "required": false,
      "schema": {
       "enum": [
        "created_at",
        "original_filename",
        "status",
        "file_size_bytes",
        "validation_status",
        "updated_at"
       ],
       "type": "string",
       "description": "Sort by field. `updated_at` sorts by (updated_at, id) and answers `next_cursor` for keyset paging.",
       "default": "created_at",
       "title": "Sort By"
      },
      "description": "Sort by field. `updated_at` sorts by (updated_at, id) and answers `next_cursor` for keyset paging."
     },
     {
      "name": "sort_order",
      "in": "query",
      "required": false,
      "schema": {
       "enum": [
        "asc",
        "desc"
       ],
       "type": "string",
       "description": "Sort order",
       "default": "desc",
       "title": "Sort Order"
      },
      "description": "Sort order"
     },
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Only this client company's invoices — its code as registered: the invoices stored under it (`owning_company_code`) and those whose seller or buyer carries its registered company code or VAT code, so an intercompany invoice is listed under both companies. `__none__` = invoices no company owns yet. An unknown code is 422 `unknown_company`, never ignored.",
       "title": "Company Code"
      },
      "description": "Only this client company's invoices — its code as registered: the invoices stored under it (`owning_company_code`) and those whose seller or buyer carries its registered company code or VAT code, so an intercompany invoice is listed under both companies. `__none__` = invoices no company owns yet. An unknown code is 422 `unknown_company`, never ignored."
     },
     {
      "name": "invoice_date_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only invoices whose own invoice_date is on or after this date (the document's date — `start_date`/`end_date` filter the upload date).",
       "title": "Invoice Date From"
      },
      "description": "Only invoices whose own invoice_date is on or after this date (the document's date — `start_date`/`end_date` filter the upload date)."
     },
     {
      "name": "invoice_date_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only invoices whose own invoice_date is on or before this date.",
       "title": "Invoice Date To"
      },
      "description": "Only invoices whose own invoice_date is on or before this date."
     },
     {
      "name": "external_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 128
        },
        {
         "type": "null"
        }
       ],
       "description": "Only the invoice stored under this id of yours — the `Idempotency-Key` / `external_id` it was uploaded with.",
       "title": "External Id"
      },
      "description": "Only the invoice stored under this id of yours — the `Idempotency-Key` / `external_id` it was uploaded with."
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 512
        },
        {
         "type": "null"
        }
       ],
       "description": "Keyset paging (with `sort_by=updated_at` only): the previous page's `next_cursor`. Opaque — pass it back unchanged; do not combine with `page`.",
       "title": "Cursor"
      },
      "description": "Keyset paging (with `sort_by=updated_at` only): the previous page's `next_cursor`. Opaque — pass it back unchanged; do not combine with `page`."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PaginatedInvoiceResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/reconciliation": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Reconciliation",
    "operationId": "get_reconciliation_api_v1_invoices_reconciliation_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Registered client company. Omit for the whole account (ERP verification then can't run — it needs one company's key).",
       "title": "Company Code"
      },
      "description": "Registered client company. Omit for the whole account (ERP verification then can't run — it needs one company's key)."
     },
     {
      "name": "month",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "pattern": "^\\d{4}-\\d{2}$"
        },
        {
         "type": "null"
        }
       ],
       "description": "Period as YYYY-MM. Defaults to the current month.",
       "title": "Month"
      },
      "description": "Period as YYYY-MM. Defaults to the current month."
     },
     {
      "name": "verify_erp",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Ask the ERP what it actually holds. Costs one paged GET; set false for a fast, unverified render.",
       "default": true,
       "title": "Verify Erp"
      },
      "description": "Ask the ERP what it actually holds. Costs one paged GET; set false for a fast, unverified render."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ReconciliationResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/reconciliation/firm": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Firm Reconciliation",
    "operationId": "get_firm_reconciliation_api_v1_invoices_reconciliation_firm_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "month",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "pattern": "^\\d{4}-\\d{2}$"
        },
        {
         "type": "null"
        }
       ],
       "description": "Period as YYYY-MM. Defaults to the current month.",
       "title": "Month"
      },
      "description": "Period as YYYY-MM. Defaults to the current month."
     },
     {
      "name": "sendable",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Also count, per company, what „Nusiųsti mėnesį“ would send this month (`sendable`; null unless asked). One pass over the month's documents, still no ERP call.",
       "default": false,
       "title": "Sendable"
      },
      "description": "Also count, per company, what „Nusiųsti mėnesį“ would send this month (`sendable`; null unless asked). One pass over the month's documents, still no ERP call."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FirmReconciliationResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/export": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Export Invoices",
    "description": "Every invoice matching the same filters as the list, in one response (capped at 1000), for a CSV/XLSX export.",
    "operationId": "export_invoices_api_v1_invoices_export_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "search",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 100
        },
        {
         "type": "null"
        }
       ],
       "title": "Search"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "validation_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Validation Status"
      }
     },
     {
      "name": "start_date",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "Start Date"
      }
     },
     {
      "name": "end_date",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "title": "End Date"
      }
     },
     {
      "name": "min_confidence",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer",
         "maximum": 100,
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "title": "Min Confidence"
      }
     },
     {
      "name": "max_confidence",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer",
         "maximum": 100,
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "title": "Max Confidence"
      }
     },
     {
      "name": "expense_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "unassigned",
          "ai",
          "manual"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Expense Status"
      }
     },
     {
      "name": "updated_after",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date-time"
        },
        {
         "type": "null"
        }
       ],
       "title": "Updated After"
      }
     },
     {
      "name": "erp_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "draft",
          "failed",
          "pending",
          "none",
          "disabled",
          "held",
          "not_sending",
          "unassigned"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Erp Status"
      }
     },
     {
      "name": "agent_status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "entered",
          "not_entered",
          "doubt",
          "none"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Agent Status"
      }
     },
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Only this client company's invoices — its code as registered: the invoices stored under it (`owning_company_code`) and those whose seller or buyer carries its registered company code or VAT code, so an intercompany invoice is listed under both companies. `__none__` = invoices no company owns yet. An unknown code is 422 `unknown_company`, never ignored.",
       "title": "Company Code"
      },
      "description": "Only this client company's invoices — its code as registered: the invoices stored under it (`owning_company_code`) and those whose seller or buyer carries its registered company code or VAT code, so an intercompany invoice is listed under both companies. `__none__` = invoices no company owns yet. An unknown code is 422 `unknown_company`, never ignored."
     },
     {
      "name": "invoice_date_from",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only invoices whose own invoice_date is on or after this date (the document's date — `start_date`/`end_date` filter the upload date).",
       "title": "Invoice Date From"
      },
      "description": "Only invoices whose own invoice_date is on or after this date (the document's date — `start_date`/`end_date` filter the upload date)."
     },
     {
      "name": "invoice_date_to",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "format": "date"
        },
        {
         "type": "null"
        }
       ],
       "description": "Only invoices whose own invoice_date is on or before this date.",
       "title": "Invoice Date To"
      },
      "description": "Only invoices whose own invoice_date is on or before this date."
     },
     {
      "name": "external_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 128
        },
        {
         "type": "null"
        }
       ],
       "description": "Only the invoice stored under this id of yours — the `Idempotency-Key` / `external_id` it was uploaded with.",
       "title": "External Id"
      },
      "description": "Only the invoice stored under this id of yours — the `Idempotency-Key` / `external_id` it was uploaded with."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/InvoiceListResponse"
         },
         "title": "Response Export Invoices Api V1 Invoices Export Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/export/{export_format}": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Export Invoices Accounting",
    "description": "The caller's invoices as an accounting file (Rivilė `.eip`, Centas XML, Finvalda), base64-encoded, with `problems` — one sentence per document that needs attention. Either list `invoice_ids` or pass the list's filters (capped at 1000). The saved per-company settings apply unless `config` overrides them for this call.",
    "operationId": "export_invoices_accounting_api_v1_invoices_export__export_format__post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "export_format",
      "in": "path",
      "required": true,
      "schema": {
       "enum": [
        "rivile",
        "centas",
        "finvalda"
       ],
       "type": "string",
       "title": "Export Format"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountingExportRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ExportResult"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/expense-summary": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Expense Summary",
    "operationId": "get_expense_summary_api_v1_invoices_expense_summary_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ExpenseSummaryResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/invoices/expense-config": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Expense Config",
    "description": "Whether expense-account assignment is on, and the assignable accounts.",
    "operationId": "get_expense_config_api_v1_invoices_expense_config_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ExpenseConfigPublicResponse"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Invoices"
    ],
    "summary": "Put Expense Config",
    "description": "Write the expense-assignment settings: the account list (`targets`), rules and switches. Unknown keys answer 422.",
    "operationId": "put_expense_config_api_v1_invoices_expense_config_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Registered company; omit for the account default.",
       "title": "Company Code"
      },
      "description": "Registered company; omit for the account default."
     },
     {
      "name": "force",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Allow a write that deletes many learned by_vendor rules (the PUT-reset guard). Only set after a deliberate GET → merge.",
       "default": false,
       "title": "Force"
      },
      "description": "Allow a write that deletes many learned by_vendor rules (the PUT-reset guard). Only set after a deliberate GET → merge."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExpenseConfigUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/expense-scope": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Expense Scopes",
    "operationId": "get_expense_scopes_api_v1_invoices_expense_scope_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_ids",
      "in": "query",
      "required": true,
      "schema": {
       "type": "array",
       "items": {
        "type": "string",
        "format": "uuid"
       },
       "minItems": 1,
       "title": "Invoice Ids"
      }
     },
     {
      "name": "vat_classes",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Also list each enabled scope's known VAT classes (`known_vat_classes`, QW-17) — the invoice page's panel asks.",
       "default": false,
       "title": "Vat Classes"
      },
      "description": "Also list each enabled scope's known VAT classes (`known_vat_classes`, QW-17) — the invoice page's panel asks."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ExpenseScopesResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/expense-config/full": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Expense Config Full",
    "operationId": "get_expense_config_full_api_v1_invoices_expense_config_full_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Registered company; omit for the account default.",
       "title": "Company Code"
      },
      "description": "Registered company; omit for the account default."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/memory": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "List Accounting Memory",
    "description": "The company's accounting memory (line text → account / card), newest activity first; `?status=conflict` lists the entries that need a decision.",
    "operationId": "list_accounting_memory_api_v1_invoices_memory_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Registered company; omit for the account default.",
       "title": "Company Code"
      },
      "description": "Registered company; omit for the account default."
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Filter: proposed | confirmed | corrected | conflict.",
       "title": "Status"
      },
      "description": "Filter: proposed | confirmed | corrected | conflict."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 1000,
       "minimum": 1,
       "default": 500,
       "title": "Limit"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MemoryListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/memory/outliers": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Memory Outliers",
    "operationId": "memory_outliers_api_v1_invoices_memory_outliers_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Registered company; omit for the account default.",
       "title": "Company Code"
      },
      "description": "Registered company; omit for the account default."
     },
     {
      "name": "min_docs",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 50,
       "minimum": 2,
       "default": 3,
       "title": "Min Docs"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "default": 200,
       "title": "Limit"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/memory/feedback": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Post Memory Feedback",
    "description": "Report observed „line text → target“ facts in one batch. `changed=true` (the bookkeeper corrected the line) replaces a stored target; `changed=false` confirms it. An entry with `dok_nr` + `eil` counts once — a retry is reported in `duplicates` and writes nothing. An `expense_code` the company has never used (not in its account list, its rules, its memory or its booked documents) is reported in `rejected` (`unknown_code`) and not written; the other entries are still applied.",
    "operationId": "post_memory_feedback_api_v1_invoices_memory_feedback_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Registered company; omit for the account default.",
       "title": "Company Code"
      },
      "description": "Registered company; omit for the account default."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryFeedbackRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MemoryFeedbackResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Invoice",
    "description": "One invoice with its full extraction, its processing state and, when it is booked through an accounting-system connection, that push's state (`erp_push_status`, `erp_push_error`, `erp_push_reason_code`).",
    "operationId": "get_invoice_api_v1_invoices__invoice_id__get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ClientInvoiceDetailResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Invoices"
    ],
    "summary": "Delete Invoice",
    "description": "Delete an invoice and its file. The processing charge is not refunded.",
    "operationId": "delete_invoice_api_v1_invoices__invoice_id__delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/expense-assignment/bulk": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Bulk Expense Assignment",
    "operationId": "bulk_expense_assignment_api_v1_invoices_expense_assignment_bulk_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BulkExpenseAssignmentRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BulkExpenseAssignmentResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/invoices/{invoice_id}/expense-assignment": {
   "put": {
    "tags": [
     "Invoices"
    ],
    "summary": "Set Expense Assignment",
    "operationId": "set_expense_assignment_api_v1_invoices__invoice_id__expense_assignment_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExpenseAssignmentUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ExpenseAssignmentResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}/memory-hints": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Memory Hints",
    "operationId": "get_memory_hints_api_v1_invoices__invoice_id__memory_hints_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}/reverse-charge": {
   "put": {
    "tags": [
     "Invoices"
    ],
    "summary": "Set Reverse Charge",
    "operationId": "set_reverse_charge_api_v1_invoices__invoice_id__reverse_charge_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReverseChargeUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ReverseChargeResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}/fields": {
   "put": {
    "tags": [
     "Invoices"
    ],
    "summary": "Set Invoice Fields",
    "operationId": "set_invoice_fields_api_v1_invoices__invoice_id__fields_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvoiceFieldsUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InvoiceFieldsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}/owner": {
   "put": {
    "tags": [
     "Invoices"
    ],
    "summary": "Set Invoice Owner",
    "operationId": "set_invoice_owner_api_v1_invoices__invoice_id__owner_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvoiceOwnerRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InvoiceOwnerResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}/pdf": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Invoice Pdf",
    "description": "The invoice's stored PDF (inline).",
    "operationId": "get_invoice_pdf_api_v1_invoices__invoice_id__pdf_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/extract-direct": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Extract Direct",
    "description": "Synchronous extraction: the result is in the response. Over the account's page cap (20 by default — the same cap as `/upload`) it answers 400 `too_many_pages` with `fallback: read_locally`: read the PDF locally or send it in smaller parts; 413 `too_many_pages_for_sync` only when an account's own cap is above the synchronous limit (then use `/upload`). A document too long for one read answers 422 `extraction_too_large` (`retryable: false`, `fallback: read_locally`); every extraction error carries `detail.retryable` — retry only when it is true. With `save_to_profile=true` (default) the result is stored; a file already processed answers its stored extraction (`from_cache: true`) at no charge unless `allow_duplicate=true`. `Idempotency-Key` / `external_id`: a repeat with the same id answers the first result at no charge, whatever the bytes; a file already stored under ANOTHER id answers 409 `external_id_conflict`. Opt-in blocks: `include_export` (an accounting-file rendering) and `include_expense` (the expense-account assignment). For an account with the fuel-statement capability (enabled per account by Robodam, off by default — without it nothing below applies and `split_documents` is ignored): a machine-printed fuel-card statement whose printed totals reconcile to the cent is read from the PDF text layer (no AI call), is exempt from both page limits up to 200 pages, is billed as one invoice per document and carries `extracted_data.fuel_statement` (the exchange rate in both directions: `fx_rate_local_per_eur` and `fx_rate_eur_per_local`) and `line_items[].fuel`. `split_documents=true` is required to receive a bundle of several such documents as `documents[]`, each billed as one invoice; without it a bundle is never answered as documents (`too_many_pages` over the cap, with `detail.fuel_statement` and a `hint`; one document within it). A stored bundle whose documents are not all read answers 409 `duplicate_invoice`. When the statement reader is busy or did not answer, the answer is 503 `service_unavailable` (`retryable: true`), never `too_many_pages`.",
    "operationId": "extract_direct_api_v1_invoices_extract_direct_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "save_to_profile",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": true,
       "title": "Save To Profile"
      }
     },
     {
      "name": "allow_duplicate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Allow Duplicate"
      }
     },
     {
      "name": "include_export",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "rivile",
          "centas",
          "finvalda"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Include Export"
      }
     },
     {
      "name": "include_expense",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Include Expense"
      }
     },
     {
      "name": "split_documents",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Answer a BUNDLE of several documents (a Routex bundle: one VAT invoice per country) as its documents: the response then carries `documents[]`, one entry per document, each billed as one invoice, and the top level is a container (`document_type: non_document`). REQUIRED to receive a bundle as documents: without it a bundle is answered as before — 400 `too_many_pages` over the page cap (with `detail.fuel_statement` and a `hint`), one document within it. No effect on a file that is one document. Only for an account with the fuel-statement capability (enabled per account by Robodam, off by default): for any other account the parameter is ignored.",
       "default": false,
       "title": "Split Documents"
      },
      "description": "Answer a BUNDLE of several documents (a Routex bundle: one VAT invoice per country) as its documents: the response then carries `documents[]`, one entry per document, each billed as one invoice, and the top level is a container (`document_type: non_document`). REQUIRED to receive a bundle as documents: without it a bundle is answered as before — 400 `too_many_pages` over the page cap (with `detail.fuel_statement` and a `hint`), one document within it. No effect on a file that is one document. Only for an account with the fuel-statement capability (enabled per account by Robodam, off by default): for any other account the parameter is ignored."
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "description": "Your own id for this document (1–128 characters). Stored as the invoice's `external_id`; a repeat with the same key answers the FIRST result instead of creating (and billing) a second document. Same as the `external_id` form field — send either, or both equal.",
       "title": "Idempotency-Key"
      },
      "description": "Your own id for this document (1–128 characters). Stored as the invoice's `external_id`; a repeat with the same key answers the FIRST result instead of creating (and billing) a second document. Same as the `external_id` form field — send either, or both equal."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_extract_direct_api_v1_invoices_extract_direct_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DirectExtractionResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}/retry": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Retry Failed Invoice",
    "description": "Queue a failed invoice for processing again. A document that failed as too long for one read answers 422 `extraction_too_large` (`retryable: false`, `fallback: read_locally`) and is not queued — a retry would fail the same way; one the AI model declined to read answers 422 `extraction_failed` (`retryable: false`) likewise. For an account with the fuel-statement capability (per account, off by default): a document that failed over the page cap answers 400 `too_many_pages` and is not queued, and one that failed because the statement reader did not answer IS queued again, with a fresh set of attempts: the reader's attempts cost nothing; a document within the page cap that the reader then judges unreconciled is read by the AI like any document (and billed when that read succeeds).",
    "operationId": "retry_failed_invoice_api_v1_invoices__invoice_id__retry_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/queue/stats": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Queue Stats",
    "description": "How many invoices are waiting to be processed, and the estimated wait.",
    "operationId": "get_queue_stats_api_v1_invoices_queue_stats_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/invoices/{invoice_id}/queue-position": {
   "get": {
    "tags": [
     "Invoices"
    ],
    "summary": "Get Invoice Queue Position",
    "description": "This invoice's position in the processing queue and the estimated wait.",
    "operationId": "get_invoice_queue_position_api_v1_invoices__invoice_id__queue_position_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/invoices/{invoice_id}/flag-issue": {
   "post": {
    "tags": [
     "Invoices"
    ],
    "summary": "Flag Invoice Issue",
    "operationId": "flag_invoice_issue_api_v1_invoices__invoice_id__flag_issue_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "invoice_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Invoice Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/FlagIssueRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FlagIssueResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/usage/current": {
   "get": {
    "tags": [
     "Usage"
    ],
    "summary": "Get current month usage",
    "description": "This billing period's usage and cost.",
    "operationId": "get_current_usage_api_v1_usage_current_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CurrentMonthUsageResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/usage/history": {
   "get": {
    "tags": [
     "Usage"
    ],
    "summary": "Get usage history",
    "operationId": "get_usage_history_api_v1_usage_history_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "months",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 120,
       "minimum": 1,
       "description": "Number of months to retrieve",
       "default": 12,
       "title": "Months"
      },
      "description": "Number of months to retrieve"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UsageHistoryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/usage/summary": {
   "get": {
    "tags": [
     "Usage"
    ],
    "summary": "Get usage summary",
    "description": "Usage for the current period and all time.",
    "operationId": "get_usage_summary_api_v1_usage_summary_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UsageSummaryResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/usage/trends": {
   "get": {
    "tags": [
     "Usage"
    ],
    "summary": "Get daily trends for dashboard chart",
    "operationId": "get_usage_trends_api_v1_usage_trends_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "window",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 365,
       "minimum": 1,
       "description": "Window size in days (7, 30, or 90)",
       "default": 30,
       "title": "Window"
      },
      "description": "Window size in days (7, 30, or 90)"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TrendsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/usage/entry-summary": {
   "get": {
    "tags": [
     "Usage"
    ],
    "summary": "Get the monthly entry summary",
    "operationId": "get_entry_summary_api_v1_usage_entry_summary_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "months",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 24,
       "minimum": 1,
       "description": "Number of months to retrieve",
       "default": 12,
       "title": "Months"
      },
      "description": "Number of months to retrieve"
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/EntrySummaryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/contact/submit": {
   "post": {
    "tags": [
     "Contact",
     "contact"
    ],
    "summary": "Submit Contact Form",
    "operationId": "submit_contact_form_api_v1_contact_submit_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ContactFormRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ContactFormResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/export-config": {
   "get": {
    "tags": [
     "Export Config"
    ],
    "summary": "Get Export Config",
    "operationId": "get_export_config_api_v1_export_config_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": true,
      "schema": {
       "enum": [
        "rivile",
        "centas",
        "finvalda"
       ],
       "type": "string",
       "title": "Format"
      }
     },
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company config key. Omit for the account default. A non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company config key. Omit for the account default. A non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ExportConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Export Config"
    ],
    "summary": "Put Export Config",
    "operationId": "put_export_config_api_v1_export_config_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": true,
      "schema": {
       "enum": [
        "rivile",
        "centas",
        "finvalda"
       ],
       "type": "string",
       "title": "Format"
      }
     },
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company config key. Omit for the account default. A non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company config key. Omit for the account default. A non-null value targets one registered client company."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExportConfigUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ExportConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Export Config"
    ],
    "summary": "Delete Company Config",
    "operationId": "delete_company_config_api_v1_export_config_delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": true,
      "schema": {
       "enum": [
        "rivile",
        "centas",
        "finvalda"
       ],
       "type": "string",
       "title": "Format"
      }
     },
     {
      "name": "company_code",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 50,
       "description": "The registered company to remove.",
       "title": "Company Code"
      },
      "description": "The registered company to remove."
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/export-config/companies": {
   "get": {
    "tags": [
     "Export Config"
    ],
    "summary": "List Company Configs",
    "operationId": "list_company_configs_api_v1_export_config_companies_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": true,
      "schema": {
       "enum": [
        "rivile",
        "centas",
        "finvalda"
       ],
       "type": "string",
       "title": "Format"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompanyConfigListResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/export-config/companies/bulk": {
   "post": {
    "tags": [
     "Export Config"
    ],
    "summary": "Bulk Register Companies",
    "operationId": "bulk_register_companies_api_v1_export_config_companies_bulk_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BulkRegisterCompaniesRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BulkRegisterCompaniesResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/export-config/discover-companies": {
   "get": {
    "tags": [
     "Export Config"
    ],
    "summary": "Discover Companies Endpoint",
    "operationId": "discover_companies_endpoint_api_v1_export_config_discover_companies_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": true,
      "schema": {
       "enum": [
        "rivile",
        "centas",
        "finvalda"
       ],
       "type": "string",
       "title": "Format"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DiscoverCompaniesResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/export-config/companies/{company_code}/code": {
   "put": {
    "tags": [
     "Export Config"
    ],
    "summary": "Rename Company Code",
    "operationId": "rename_company_code_api_v1_export_config_companies__company_code__code_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Company Code"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CompanyCodeRenameRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompanyCodeRenameResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/key": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Set Rivile Erp Key",
    "operationId": "set_rivile_erp_key_api_v1_integrations_rivile_erp_key_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     },
     {
      "name": "discover",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Auto-configure: after storing the key, best-effort discover the company's ERP defaults and persist them (SO4). Default true.",
       "default": true,
       "title": "Discover"
      },
      "description": "Auto-configure: after storing the key, best-effort discover the company's ERP defaults and persist them (SO4). Default true."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetIntegrationKeyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IntegrationKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Rivile Erp Key Status",
    "operationId": "get_rivile_erp_key_status_api_v1_integrations_rivile_erp_key_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IntegrationKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Integrations"
    ],
    "summary": "Delete Rivile Erp Key",
    "operationId": "delete_rivile_erp_key_api_v1_integrations_rivile_erp_key_delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/IntegrationKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/keys/bulk": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Bulk Set Rivile Erp Keys",
    "operationId": "bulk_set_rivile_erp_keys_api_v1_integrations_rivile_erp_keys_bulk_put",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BulkSetKeysRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BulkSetKeysResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/rivile-erp/config": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Rivile Erp Config",
    "operationId": "get_rivile_erp_config_api_v1_integrations_rivile_erp_config_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Put Rivile Erp Config",
    "operationId": "put_rivile_erp_config_api_v1_integrations_rivile_erp_config_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RivileErpConfigUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/companies-status": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Rivile Erp Companies Status",
    "operationId": "rivile_erp_companies_status_api_v1_integrations_rivile_erp_companies_status_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpCompaniesStatusResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/rivile-erp/discover": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Discover Rivile Erp",
    "operationId": "discover_rivile_erp_api_v1_integrations_rivile_erp_discover_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpDiscoverResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/clients/progress": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Clients Progress",
    "operationId": "clients_progress_api_v1_clients_progress_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "group",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "enum": [
          "attention",
          "waiting_me",
          "waiting_client",
          "working",
          "paused"
         ],
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Group"
      }
     },
     {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1,
       "title": "Page"
      }
     },
     {
      "name": "page_size",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "default": 25,
       "title": "Page Size"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ClientProgressResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/clients/{company_code}/paused": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Set Client Paused",
    "operationId": "set_client_paused_api_v1_clients__company_code__paused_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Company Code"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientPauseRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ClientPauseResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/clients/{company_code}/vat-code": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Set Client Vat Code",
    "operationId": "set_client_vat_code_api_v1_clients__company_code__vat_code_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Company Code"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientVatCodeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ClientVatCodeResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/clients/{company_code}/sending": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Set Client Sending",
    "operationId": "set_client_sending_api_v1_clients__company_code__sending_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Company Code"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientSendingRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ClientSendingResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/clients/{company_code}/send-month": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Send Month To Erp",
    "operationId": "send_month_to_erp_api_v1_clients__company_code__send_month_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Company Code"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SendMonthRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SendMonthResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/discover-clients": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Discover Rivile Erp Clients",
    "operationId": "discover_rivile_erp_clients_api_v1_integrations_rivile_erp_discover_clients_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     },
     {
      "name": "include_inactive",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Include Inactive"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpDiscoverClientsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/cards": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Rivile Erp Cards",
    "operationId": "get_rivile_erp_cards_api_v1_integrations_rivile_erp_cards_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpCardsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/clients": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Rivile Erp Clients",
    "operationId": "get_rivile_erp_clients_api_v1_integrations_rivile_erp_clients_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpClientsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/suggest-card-map": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Suggest Rivile Erp Card Map",
    "operationId": "suggest_rivile_erp_card_map_api_v1_integrations_rivile_erp_suggest_card_map_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpSuggestCardMapResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/suggest-cards": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Suggest Rivile Erp Cards",
    "operationId": "suggest_rivile_erp_cards_api_v1_integrations_rivile_erp_suggest_cards_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RivileErpSuggestCardsRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpSuggestCardsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/rivile-erp/push": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Push To Rivile Erp",
    "operationId": "push_to_rivile_erp_api_v1_integrations_rivile_erp_push_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RivileErpPushRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpPushResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/rivile-erp/test-run": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Rivile Erp Test Run",
    "operationId": "rivile_erp_test_run_api_v1_integrations_rivile_erp_test_run_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 5,
       "minimum": 1,
       "default": 3,
       "title": "Limit"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TestRunResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/vendor-cards": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Vendor Cards",
    "operationId": "get_vendor_cards_api_v1_integrations_rivile_erp_vendor_cards_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/VendorCardsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Put Vendor Cards",
    "operationId": "put_vendor_cards_api_v1_integrations_rivile_erp_vendor_cards_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/VendorCardsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/VendorCardsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/rivile-erp/dismiss-push": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Dismiss Rivile Erp Push",
    "operationId": "dismiss_rivile_erp_push_api_v1_integrations_rivile_erp_dismiss_push_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RivileErpDismissRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpDismissResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/rivile-erp/reset-push": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Reset Rivile Erp Push",
    "operationId": "reset_rivile_erp_push_api_v1_integrations_rivile_erp_reset_push_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RivileErpPushRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RivileErpResetPushResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/systems": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Accounting Systems",
    "operationId": "get_accounting_systems_api_v1_integrations_systems_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AccountingSystemsResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/google-drive/key": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Set Google Drive Key",
    "operationId": "set_google_drive_key_api_v1_integrations_google_drive_key_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetDriveKeyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Google Drive Key Status",
    "operationId": "get_google_drive_key_status_api_v1_integrations_google_drive_key_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Integrations"
    ],
    "summary": "Delete Google Drive Key",
    "operationId": "delete_google_drive_key_api_v1_integrations_google_drive_key_delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/config": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Google Drive Config",
    "operationId": "get_google_drive_config_api_v1_integrations_google_drive_config_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Put Google Drive Config",
    "operationId": "put_google_drive_config_api_v1_integrations_google_drive_config_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DriveConfigUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/visible": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "List Visible Drive Folders",
    "operationId": "list_visible_drive_folders_api_v1_integrations_google_drive_visible_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveVisibleResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/subfolders": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "List Drive Subfolders",
    "operationId": "list_drive_subfolders_api_v1_integrations_google_drive_subfolders_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "folder_id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 128,
       "title": "Folder Id"
      }
     },
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveSubfoldersResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/access-request": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Request Google Access",
    "operationId": "request_google_access_api_v1_integrations_google_drive_access_request_post",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveKeyStatusResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/google-drive/folder-request/{company_code}/text": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Folder Request Text",
    "operationId": "folder_request_text_api_v1_integrations_google_drive_folder_request__company_code__text_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Company Code"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FolderRequestMessage"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/folder-request": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Request Client Folder",
    "operationId": "request_client_folder_api_v1_integrations_google_drive_folder_request_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/FolderRequestCreate"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FolderRequestResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/google-drive/folder-request/{company_code}/remind": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Remind Client Folder",
    "operationId": "remind_client_folder_api_v1_integrations_google_drive_folder_request__company_code__remind_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Company Code"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FolderRequestResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/preview": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Preview Google Drive Folder",
    "operationId": "preview_google_drive_folder_api_v1_integrations_google_drive_preview_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     },
     {
      "name": "root_folder_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 128
        },
        {
         "type": "null"
        }
       ],
       "description": "Override the configured root — lets the bookkeeper test a folder id before saving it.",
       "title": "Root Folder Id"
      },
      "description": "Override the configured root — lets the bookkeeper test a folder id before saving it."
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "anyOf": [
         {
          "$ref": "#/components/schemas/DrivePreviewOverridesRequest"
         },
         {
          "type": "null"
         }
        ],
        "title": "Overrides"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveFolderPreviewResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/sync-now": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Sync Google Drive Now",
    "operationId": "sync_google_drive_now_api_v1_integrations_google_drive_sync_now_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveSyncNowResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/google-drive/ingestions": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "List Google Drive Ingestions",
    "operationId": "list_google_drive_ingestions_api_v1_integrations_google_drive_ingestions_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company.",
       "title": "Company Code"
      },
      "description": "Per-company key. Omit for the account default; a non-null value targets one registered client company."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 200,
       "minimum": 1,
       "default": 50,
       "title": "Limit"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DriveIngestionsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/optimum/key": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Set Optimum Key",
    "operationId": "set_optimum_key_api_v1_integrations_optimum_key_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetIntegrationKeyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Optimum Key Status",
    "operationId": "get_optimum_key_status_api_v1_integrations_optimum_key_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Integrations"
    ],
    "summary": "Delete Optimum Key",
    "operationId": "delete_optimum_key_api_v1_integrations_optimum_key_delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumKeyStatusResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/optimum/keys/bulk": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Bulk Set Optimum Keys",
    "operationId": "bulk_set_optimum_keys_api_v1_integrations_optimum_keys_bulk_put",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OptimumBulkKeysRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumBulkKeysResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/optimum/config": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Get Optimum Config",
    "operationId": "get_optimum_config_api_v1_integrations_optimum_config_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Put Optimum Config",
    "operationId": "put_optimum_config_api_v1_integrations_optimum_config_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OptimumConfigUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumConfigResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/optimum/firm-settings": {
   "put": {
    "tags": [
     "Integrations"
    ],
    "summary": "Put Optimum Firm Settings",
    "operationId": "put_optimum_firm_settings_api_v1_integrations_optimum_firm_settings_put",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OptimumFirmSettingsRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumFirmSettingsResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/optimum/vat-rates": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Optimum Vat Rates",
    "operationId": "optimum_vat_rates_api_v1_integrations_optimum_vat_rates_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumVatRatesResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/optimum/catalog": {
   "get": {
    "tags": [
     "Integrations"
    ],
    "summary": "Optimum Catalog",
    "operationId": "optimum_catalog_api_v1_integrations_optimum_catalog_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumCatalogResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/optimum/discover": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Discover Optimum",
    "operationId": "discover_optimum_api_v1_integrations_optimum_discover_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumDiscoverResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/optimum/push": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Push To Optimum",
    "operationId": "push_to_optimum_api_v1_integrations_optimum_push_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OptimumPushRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumPushResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/integrations/optimum/test-run": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Optimum Test Run",
    "operationId": "optimum_test_run_api_v1_integrations_optimum_test_run_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "company_code",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string",
         "maxLength": 50
        },
        {
         "type": "null"
        }
       ],
       "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key.",
       "title": "Company Code"
      },
      "description": "The client company whose Optimum database this is. Omit for the account's own database. Optimum keys never fall back to the account key."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "maximum": 5,
       "minimum": 1,
       "default": 3,
       "title": "Limit"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumTestRunResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/integrations/optimum/undo-push": {
   "post": {
    "tags": [
     "Integrations"
    ],
    "summary": "Undo Optimum Push",
    "operationId": "undo_optimum_push_api_v1_integrations_optimum_undo_push_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OptimumUndoRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OptimumUndoResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agent-config/backups": {
   "get": {
    "tags": [
     "Agent Config",
     "agent-config"
    ],
    "summary": "List Backups",
    "operationId": "list_backups_api_v1_agent_config_backups_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Agent Config",
     "agent-config"
    ],
    "summary": "Upload Backup",
    "operationId": "upload_backup_api_v1_agent_config_backups_post",
    "requestBody": {
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_backup_api_v1_agent_config_backups_post"
       }
      }
     },
     "required": true
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agent-config/backups/{backup_id}": {
   "get": {
    "tags": [
     "Agent Config",
     "agent-config"
    ],
    "summary": "Download Backup",
    "operationId": "download_backup_api_v1_agent_config_backups__backup_id__get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "backup_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Backup Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/agent-config/update": {
   "get": {
    "tags": [
     "Agent Config",
     "agent-config"
    ],
    "summary": "Check Update",
    "operationId": "check_update_api_v1_agent_config_update_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agent-config/update/download": {
   "get": {
    "tags": [
     "Agent Config",
     "agent-config"
    ],
    "summary": "Download Update",
    "operationId": "download_update_api_v1_agent_config_update_download_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agreements/company-requisites": {
   "get": {
    "tags": [
     "Agreements"
    ],
    "summary": "Get company requisites",
    "operationId": "get_company_requisites_api_v1_agreements_company_requisites_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompanyRequisitesResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Agreements"
    ],
    "summary": "Create or update company requisites",
    "operationId": "create_company_requisites_api_v1_agreements_company_requisites_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CompanyRequisitesCreate"
       }
      }
     },
     "required": true
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompanyRequisitesResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   },
   "patch": {
    "tags": [
     "Agreements"
    ],
    "summary": "Update company requisites",
    "operationId": "update_company_requisites_api_v1_agreements_company_requisites_patch",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CompanyRequisitesUpdate"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompanyRequisitesResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agreements/workflow-status": {
   "get": {
    "tags": [
     "Agreements"
    ],
    "summary": "Get workflow status",
    "operationId": "get_workflow_status_api_v1_agreements_workflow_status_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AgreementWorkflowStatus"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agreements/create": {
   "post": {
    "tags": [
     "Agreements"
    ],
    "summary": "Create agreement",
    "operationId": "create_agreement_api_v1_agreements_create_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SignedAgreementCreate"
       }
      }
     },
     "required": true
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SignedAgreementDetailResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agreements/current": {
   "get": {
    "tags": [
     "Agreements"
    ],
    "summary": "Get current agreement",
    "operationId": "get_current_agreement_api_v1_agreements_current_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SignedAgreementDetailResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/api/v1/agreements/{agreement_id}/upload": {
   "post": {
    "tags": [
     "Agreements"
    ],
    "summary": "Upload signed contract",
    "operationId": "upload_signed_contract_api_v1_agreements__agreement_id__upload_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "agreement_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "format": "uuid",
       "title": "Agreement Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_signed_contract_api_v1_agreements__agreement_id__upload_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SignedAgreementResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/agreements/contract-template": {
   "get": {
    "tags": [
     "Agreements"
    ],
    "summary": "Get contract template",
    "operationId": "get_contract_template_api_v1_agreements_contract_template_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/health": {
   "get": {
    "tags": [
     "Health"
    ],
    "summary": "Health Check",
    "description": "Liveness/readiness: 200 when the API can serve requests, 503 when its database is unreachable.",
    "operationId": "health_check_health_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/health/db": {
   "get": {
    "tags": [
     "Health"
    ],
    "summary": "Database Health Check",
    "operationId": "database_health_check_health_db_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/version": {
   "get": {
    "tags": [
     "Health"
    ],
    "summary": "Version",
    "description": "The running build's version.",
    "operationId": "version_version_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "AccessTokenResponse": {
    "properties": {
     "access_token": {
      "type": "string",
      "title": "Access Token"
     },
     "token_type": {
      "type": "string",
      "title": "Token Type",
      "default": "bearer"
     },
     "expires_in": {
      "type": "integer",
      "title": "Expires In"
     }
    },
    "type": "object",
    "required": [
     "access_token",
     "expires_in"
    ],
    "title": "AccessTokenResponse"
   },
   "AccountingExportRequest": {
    "properties": {
     "invoice_ids": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Ids"
     },
     "search": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Search"
     },
     "status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Status"
     },
     "validation_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Validation Status"
     },
     "start_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Start Date"
     },
     "end_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "End Date"
     },
     "min_confidence": {
      "anyOf": [
       {
        "type": "integer",
        "maximum": 100.0,
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Min Confidence"
     },
     "max_confidence": {
      "anyOf": [
       {
        "type": "integer",
        "maximum": 100.0,
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Max Confidence"
     },
     "expense_status": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "unassigned",
         "ai",
         "manual"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Expense Status"
     },
     "updated_after": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Updated After"
     },
     "erp_status": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "draft",
         "failed",
         "pending",
         "none",
         "disabled",
         "held",
         "not_sending",
         "unassigned"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Status"
     },
     "agent_status": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "entered",
         "not_entered",
         "doubt",
         "none"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Agent Status"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "invoice_date_from": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Date From"
     },
     "invoice_date_to": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Date To"
     },
     "external_id": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 128
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id"
     },
     "config": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Config"
     }
    },
    "type": "object",
    "title": "AccountingExportRequest"
   },
   "AccountingSystemCompany": {
    "properties": {
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "uses_erp": {
      "type": "boolean",
      "title": "Uses Erp",
      "default": false
     },
     "erp_systems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Erp Systems",
      "default": []
     }
    },
    "type": "object",
    "title": "AccountingSystemCompany"
   },
   "AccountingSystemsResponse": {
    "properties": {
     "uses_erp": {
      "type": "boolean",
      "title": "Uses Erp"
     },
     "companies": {
      "items": {
       "$ref": "#/components/schemas/AccountingSystemCompany"
      },
      "type": "array",
      "title": "Companies"
     },
     "file_exports": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "File Exports"
     },
     "erp_systems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Erp Systems",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "uses_erp",
     "companies",
     "file_exports"
    ],
    "title": "AccountingSystemsResponse"
   },
   "AgreementWorkflowStatus": {
    "properties": {
     "user_id": {
      "type": "string",
      "format": "uuid",
      "title": "User Id"
     },
     "trial_invoices_remaining": {
      "type": "integer",
      "title": "Trial Invoices Remaining"
     },
     "trial_exhausted": {
      "type": "boolean",
      "title": "Trial Exhausted"
     },
     "has_requisites": {
      "type": "boolean",
      "title": "Has Requisites"
     },
     "company_requisites": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CompanyRequisitesResponse"
       },
       {
        "type": "null"
       }
      ]
     },
     "has_agreement": {
      "type": "boolean",
      "title": "Has Agreement"
     },
     "agreement_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Agreement Status"
     },
     "contract_generated": {
      "type": "boolean",
      "title": "Contract Generated"
     },
     "contract_uploaded": {
      "type": "boolean",
      "title": "Contract Uploaded"
     },
     "contract_approved": {
      "type": "boolean",
      "title": "Contract Approved"
     },
     "current_agreement": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/SignedAgreementResponse"
       },
       {
        "type": "null"
       }
      ]
     },
     "credit_limit_eur": {
      "type": "string",
      "title": "Credit Limit Eur",
      "default": "0.00"
     },
     "credit_balance_eur": {
      "type": "string",
      "title": "Credit Balance Eur",
      "default": "0.00"
     },
     "credit_available_eur": {
      "type": "string",
      "title": "Credit Available Eur",
      "default": "0.00"
     },
     "can_process_invoices": {
      "type": "boolean",
      "title": "Can Process Invoices"
     },
     "is_blocked": {
      "type": "boolean",
      "title": "Is Blocked"
     },
     "block_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Block Reason"
     },
     "next_step": {
      "type": "string",
      "title": "Next Step"
     },
     "next_step_description": {
      "type": "string",
      "title": "Next Step Description"
     }
    },
    "type": "object",
    "required": [
     "user_id",
     "trial_invoices_remaining",
     "trial_exhausted",
     "has_requisites",
     "has_agreement",
     "contract_generated",
     "contract_uploaded",
     "contract_approved",
     "can_process_invoices",
     "is_blocked",
     "next_step",
     "next_step_description"
    ],
    "title": "AgreementWorkflowStatus"
   },
   "ApiKeyCreateRequest": {
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "Name"
     }
    },
    "type": "object",
    "required": [
     "name"
    ],
    "title": "ApiKeyCreateRequest"
   },
   "ApiKeyCreatedResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "key_prefix": {
      "type": "string",
      "title": "Key Prefix"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "last_used_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Last Used At"
     },
     "revoked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Revoked At"
     },
     "key": {
      "type": "string",
      "title": "Key"
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "key_prefix",
     "created_at",
     "key"
    ],
    "title": "ApiKeyCreatedResponse"
   },
   "ApiKeyResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "key_prefix": {
      "type": "string",
      "title": "Key Prefix"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "last_used_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Last Used At"
     },
     "revoked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Revoked At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "key_prefix",
     "created_at"
    ],
    "title": "ApiKeyResponse"
   },
   "BatchUploadResponse": {
    "properties": {
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "successful": {
      "type": "integer",
      "title": "Successful"
     },
     "failed": {
      "type": "integer",
      "title": "Failed"
     },
     "results": {
      "items": {
       "$ref": "#/components/schemas/BatchUploadResult"
      },
      "type": "array",
      "title": "Results"
     }
    },
    "type": "object",
    "required": [
     "total",
     "successful",
     "failed",
     "results"
    ],
    "title": "BatchUploadResponse"
   },
   "BatchUploadResult": {
    "properties": {
     "status": {
      "type": "string",
      "enum": [
       "success",
       "error"
      ],
      "title": "Status"
     },
     "filename": {
      "type": "string",
      "title": "Filename"
     },
     "data": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/InvoiceUploadResponse"
       },
       {
        "type": "null"
       }
      ]
     },
     "error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error"
     }
    },
    "type": "object",
    "required": [
     "status",
     "filename"
    ],
    "title": "BatchUploadResult",
    "description": "One file of a batch: `status` `success` with `data`, or `error` with `error` — an object `{error, message}` (a code from `x-error-codes`)."
   },
   "Body_batch_upload_invoices_api_v1_invoices_batch_upload_post": {
    "properties": {
     "files": {
      "items": {
       "type": "string",
       "contentMediaType": "application/octet-stream"
      },
      "type": "array",
      "title": "Files"
     },
     "external_id": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id",
      "description": "One id per file, in the files' order (repeat the field) — each file's `Idempotency-Key`. Either one per file or none."
     }
    },
    "type": "object",
    "required": [
     "files"
    ],
    "title": "Body_batch_upload_invoices_api_v1_invoices_batch_upload_post"
   },
   "Body_extract_direct_api_v1_invoices_extract_direct_post": {
    "properties": {
     "file": {
      "type": "string",
      "contentMediaType": "application/octet-stream",
      "title": "File"
     },
     "external_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id",
      "description": "The document's own id — the `Idempotency-Key` header as a form field."
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_extract_direct_api_v1_invoices_extract_direct_post"
   },
   "Body_upload_backup_api_v1_agent_config_backups_post": {
    "properties": {
     "file": {
      "type": "string",
      "contentMediaType": "application/octet-stream",
      "title": "File"
     },
     "label": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Label"
     },
     "agent_version": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Agent Version"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_backup_api_v1_agent_config_backups_post"
   },
   "Body_upload_invoice_api_v1_invoices_upload_post": {
    "properties": {
     "file": {
      "type": "string",
      "contentMediaType": "application/octet-stream",
      "title": "File"
     },
     "external_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id",
      "description": "The document's own id — the `Idempotency-Key` header as a form field."
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_invoice_api_v1_invoices_upload_post"
   },
   "Body_upload_signed_contract_api_v1_agreements__agreement_id__upload_post": {
    "properties": {
     "file": {
      "type": "string",
      "contentMediaType": "application/octet-stream",
      "title": "File",
      "description": "Signed contract PDF"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_signed_contract_api_v1_agreements__agreement_id__upload_post"
   },
   "BulkCompanyItem": {
    "properties": {
     "company_code": {
      "type": "string",
      "maxLength": 50,
      "minLength": 1,
      "title": "Company Code"
     },
     "vat_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Code"
     },
     "name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 255
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "email": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 255
       },
       {
        "type": "null"
       }
      ],
      "title": "Email"
     }
    },
    "type": "object",
    "required": [
     "company_code"
    ],
    "title": "BulkCompanyItem"
   },
   "BulkExpenseAssignmentRequest": {
    "properties": {
     "invoice_ids": {
      "items": {
       "type": "string",
       "format": "uuid"
      },
      "type": "array",
      "minItems": 1,
      "title": "Invoice Ids"
     },
     "account_code": {
      "type": "string",
      "minLength": 1,
      "title": "Account Code"
     },
     "config_company": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Config Company",
      "description": "config_company the picker was rendered for (null = the account); a mismatch with the invoice's current scope answers 409 expense_scope_changed"
     },
     "vat_class": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Class",
      "description": "PVM klasifikatorius for each document's _default"
     }
    },
    "type": "object",
    "required": [
     "invoice_ids",
     "account_code"
    ],
    "title": "BulkExpenseAssignmentRequest"
   },
   "BulkExpenseAssignmentResponse": {
    "properties": {
     "assigned": {
      "type": "integer",
      "title": "Assigned"
     },
     "requested": {
      "type": "integer",
      "title": "Requested"
     },
     "skipped": {
      "items": {
       "$ref": "#/components/schemas/BulkExpenseSkipped"
      },
      "type": "array",
      "title": "Skipped",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "assigned",
     "requested"
    ],
    "title": "BulkExpenseAssignmentResponse"
   },
   "BulkExpenseSkipped": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "invoice_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Number"
     },
     "vendor": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor"
     },
     "reason": {
      "type": "string",
      "title": "Reason"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "company_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Name"
     }
    },
    "type": "object",
    "required": [
     "invoice_id",
     "reason"
    ],
    "title": "BulkExpenseSkipped"
   },
   "BulkKeyItem": {
    "properties": {
     "company_code": {
      "type": "string",
      "maxLength": 50,
      "minLength": 1,
      "title": "Company Code"
     },
     "key": {
      "type": "string",
      "maxLength": 4096,
      "minLength": 1,
      "title": "Key"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "key"
    ],
    "title": "BulkKeyItem"
   },
   "BulkRegisterCompaniesRequest": {
    "properties": {
     "companies": {
      "items": {
       "$ref": "#/components/schemas/BulkCompanyItem"
      },
      "type": "array",
      "maxItems": 500,
      "minItems": 1,
      "title": "Companies"
     }
    },
    "type": "object",
    "required": [
     "companies"
    ],
    "title": "BulkRegisterCompaniesRequest"
   },
   "BulkRegisterCompaniesResponse": {
    "properties": {
     "registered": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Registered"
     },
     "skipped": {
      "items": {
       "additionalProperties": {
        "type": "string"
       },
       "type": "object"
      },
      "type": "array",
      "title": "Skipped"
     },
     "count": {
      "type": "integer",
      "title": "Count"
     }
    },
    "type": "object",
    "required": [
     "registered",
     "skipped",
     "count"
    ],
    "title": "BulkRegisterCompaniesResponse"
   },
   "BulkSetKeysRequest": {
    "properties": {
     "keys": {
      "items": {
       "$ref": "#/components/schemas/BulkKeyItem"
      },
      "type": "array",
      "maxItems": 200,
      "minItems": 1,
      "title": "Keys"
     }
    },
    "type": "object",
    "required": [
     "keys"
    ],
    "title": "BulkSetKeysRequest"
   },
   "BulkSetKeysResponse": {
    "properties": {
     "results": {
      "items": {
       "$ref": "#/components/schemas/BulkSetKeysResultItem"
      },
      "type": "array",
      "title": "Results"
     },
     "stored": {
      "type": "integer",
      "title": "Stored"
     }
    },
    "type": "object",
    "required": [
     "results",
     "stored"
    ],
    "title": "BulkSetKeysResponse"
   },
   "BulkSetKeysResultItem": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "configured": {
      "type": "boolean",
      "title": "Configured"
     },
     "masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Masked"
     },
     "error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error"
     },
     "verdict": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "accepted",
         "rejected",
         "unreachable"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Verdict"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "configured"
    ],
    "title": "BulkSetKeysResultItem"
   },
   "ChangePasswordRequest": {
    "properties": {
     "old_password": {
      "type": "string",
      "title": "Old Password"
     },
     "new_password": {
      "type": "string",
      "maxLength": 128,
      "title": "New Password"
     }
    },
    "type": "object",
    "required": [
     "old_password",
     "new_password"
    ],
    "title": "ChangePasswordRequest"
   },
   "ClientInvoiceDetailResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "user_id": {
      "type": "string",
      "format": "uuid",
      "title": "User Id"
     },
     "original_filename": {
      "type": "string",
      "title": "Original Filename"
     },
     "file_size_bytes": {
      "type": "integer",
      "title": "File Size Bytes"
     },
     "mime_type": {
      "type": "string",
      "title": "Mime Type"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "extracted_data": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Extracted Data"
     },
     "manual_field_overrides": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Manual Field Overrides"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     },
     "processing_started_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Processing Started At"
     },
     "processing_completed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Processing Completed At"
     },
     "processing_error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Processing Error"
     },
     "retry_count": {
      "type": "integer",
      "title": "Retry Count",
      "default": 0
     },
     "page_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Page Count"
     },
     "processing_time_seconds": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Processing Time Seconds"
     },
     "confidence_score": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Confidence Score"
     },
     "validation_warnings": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Validation Warnings",
      "default": []
     },
     "client_flagged": {
      "type": "boolean",
      "title": "Client Flagged",
      "default": false
     },
     "flag_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Flag Reason"
     },
     "flag_description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Flag Description"
     },
     "flag_priority": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Flag Priority"
     },
     "flagged_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Flagged At"
     },
     "admin_reviewed": {
      "type": "boolean",
      "title": "Admin Reviewed",
      "default": false
     },
     "admin_reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Admin Reviewed At"
     },
     "vat_validation_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Validation Status"
     },
     "vat_validated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Validated At"
     },
     "document_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Type"
     },
     "expense_assignments": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expense Assignments"
     },
     "reverse_charge_override": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reverse Charge Override"
     },
     "erp_push_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Status"
     },
     "erp_push_system": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push System"
     },
     "erp_push_error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Error"
     },
     "erp_push_reason_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Reason Code"
     },
     "erp_document_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Document Id"
     },
     "erp_company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Company Code"
     },
     "owning_company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Owning Company Code"
     },
     "erp_needs_repush": {
      "type": "boolean",
      "title": "Erp Needs Repush",
      "default": false
     },
     "erp_push_dismissed": {
      "type": "boolean",
      "title": "Erp Push Dismissed",
      "default": false
     },
     "erp_push_refusal": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Refusal"
     },
     "erp_push_retry": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Retry"
     },
     "erp_push_unrouted": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Unrouted"
     },
     "erp_push_sales_off": {
      "type": "boolean",
      "title": "Erp Push Sales Off",
      "default": false
     },
     "erp_push_missing_isaf_rates": {
      "items": {
       "type": "integer"
      },
      "type": "array",
      "title": "Erp Push Missing Isaf Rates",
      "default": []
     },
     "erp_push_booking": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Booking"
     },
     "erp_push_sums": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Sums"
     },
     "erp_push_missing_lines": {
      "items": {
       "type": "integer"
      },
      "type": "array",
      "title": "Erp Push Missing Lines",
      "default": []
     },
     "erp_push_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Reason"
     },
     "erp_push_advisories": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Erp Push Advisories",
      "default": []
     },
     "erp_push_technical": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Technical"
     },
     "sum_mismatch": {
      "type": "boolean",
      "title": "Sum Mismatch",
      "default": false
     },
     "sum_mismatches": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Sum Mismatches",
      "default": []
     },
     "document_tax_rate": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Tax Rate"
     },
     "lines_are_gross": {
      "type": "boolean",
      "title": "Lines Are Gross",
      "default": false
     },
     "expense_line_checks": {
      "items": {
       "type": "integer"
      },
      "type": "array",
      "title": "Expense Line Checks",
      "default": []
     },
     "owner_unrouted": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Owner Unrouted"
     },
     "vendor_memory": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vendor Memory"
     },
     "external_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id",
      "description": "Your own id for this document, as sent in the `Idempotency-Key` header or the `external_id` form field (1–128 characters). A repeat with the same id answers the first result instead of creating a second document."
     }
    },
    "type": "object",
    "required": [
     "id",
     "user_id",
     "original_filename",
     "file_size_bytes",
     "mime_type",
     "status",
     "created_at",
     "updated_at"
    ],
    "title": "ClientInvoiceDetailResponse",
    "description": "One invoice as its owner receives it."
   },
   "ClientPauseRequest": {
    "properties": {
     "paused": {
      "type": "boolean",
      "title": "Paused"
     }
    },
    "type": "object",
    "required": [
     "paused"
    ],
    "title": "ClientPauseRequest"
   },
   "ClientPauseResponse": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "paused": {
      "type": "boolean",
      "title": "Paused"
     },
     "erp_disabled": {
      "type": "boolean",
      "title": "Erp Disabled",
      "default": false
     },
     "drive_disabled": {
      "type": "boolean",
      "title": "Drive Disabled",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "paused"
    ],
    "title": "ClientPauseResponse"
   },
   "ClientProgressResponse": {
    "properties": {
     "clients": {
      "items": {
       "$ref": "#/components/schemas/ClientProgressRow"
      },
      "type": "array",
      "title": "Clients"
     },
     "totals": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Totals"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "firm_erp_default": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "rivile_erp",
         "optimum"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Firm Erp Default"
     }
    },
    "type": "object",
    "required": [
     "clients",
     "totals",
     "total",
     "page",
     "page_size"
    ],
    "title": "ClientProgressResponse"
   },
   "ClientProgressRow": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "own_vat_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Own Vat Code"
     },
     "steps": {
      "additionalProperties": {
       "type": "boolean"
      },
      "type": "object",
      "title": "Steps"
     },
     "steps_done": {
      "type": "integer",
      "title": "Steps Done"
     },
     "steps_total": {
      "type": "integer",
      "title": "Steps Total"
     },
     "next_step": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Next Step"
     },
     "group": {
      "type": "string",
      "title": "Group"
     },
     "erp_system": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp System"
     },
     "erp_configured": {
      "type": "boolean",
      "title": "Erp Configured",
      "default": false
     },
     "drive_enabled": {
      "type": "boolean",
      "title": "Drive Enabled",
      "default": false
     },
     "pushed_count": {
      "type": "integer",
      "title": "Pushed Count",
      "default": 0
     },
     "failed_count": {
      "type": "integer",
      "title": "Failed Count",
      "default": 0
     },
     "disabled_count": {
      "type": "integer",
      "title": "Disabled Count",
      "default": 0
     },
     "dismissed_count": {
      "type": "integer",
      "title": "Dismissed Count",
      "default": 0
     },
     "not_sending_count": {
      "type": "integer",
      "title": "Not Sending Count",
      "default": 0
     },
     "held_count": {
      "type": "integer",
      "title": "Held Count",
      "default": 0
     },
     "last_invoice_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Last Invoice At"
     },
     "month_invoices": {
      "type": "integer",
      "title": "Month Invoices",
      "default": 0
     },
     "asked": {
      "type": "boolean",
      "title": "Asked",
      "default": false
     },
     "asked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Asked At"
     },
     "days_waiting": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Days Waiting"
     },
     "can_remind": {
      "type": "boolean",
      "title": "Can Remind",
      "default": false
     },
     "contact_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contact Email"
     },
     "folder_offered": {
      "type": "boolean",
      "title": "Folder Offered",
      "default": false
     },
     "offered_folder_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Offered Folder Id"
     },
     "offered_folder_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Offered Folder Name"
     },
     "paused": {
      "type": "boolean",
      "title": "Paused",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "steps",
     "steps_done",
     "steps_total",
     "group"
    ],
    "title": "ClientProgressRow"
   },
   "ClientSendingRequest": {
    "properties": {
     "purchases": {
      "type": "boolean",
      "title": "Purchases"
     },
     "sales": {
      "type": "boolean",
      "title": "Sales"
     }
    },
    "type": "object",
    "required": [
     "purchases",
     "sales"
    ],
    "title": "ClientSendingRequest"
   },
   "ClientSendingResponse": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "purchases": {
      "type": "boolean",
      "title": "Purchases"
     },
     "sales": {
      "type": "boolean",
      "title": "Sales"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "purchases",
     "sales"
    ],
    "title": "ClientSendingResponse"
   },
   "ClientVatCodeRequest": {
    "properties": {
     "vat_code": {
      "type": "string",
      "maxLength": 32,
      "title": "Vat Code"
     }
    },
    "type": "object",
    "required": [
     "vat_code"
    ],
    "title": "ClientVatCodeRequest"
   },
   "ClientVatCodeResponse": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "own_vat_code": {
      "type": "string",
      "title": "Own Vat Code"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "own_vat_code"
    ],
    "title": "ClientVatCodeResponse"
   },
   "CompanyCodeRenameRequest": {
    "properties": {
     "new_company_code": {
      "type": "string",
      "title": "New Company Code"
     }
    },
    "type": "object",
    "required": [
     "new_company_code"
    ],
    "title": "CompanyCodeRenameRequest"
   },
   "CompanyCodeRenameResponse": {
    "properties": {
     "old_company_code": {
      "type": "string",
      "title": "Old Company Code"
     },
     "new_company_code": {
      "type": "string",
      "title": "New Company Code"
     },
     "moved": {
      "additionalProperties": true,
      "type": "object",
      "title": "Moved"
     }
    },
    "type": "object",
    "required": [
     "old_company_code",
     "new_company_code",
     "moved"
    ],
    "title": "CompanyCodeRenameResponse"
   },
   "CompanyConfigListResponse": {
    "properties": {
     "format": {
      "type": "string",
      "title": "Format"
     },
     "companies": {
      "items": {
       "$ref": "#/components/schemas/CompanyConfigSummary"
      },
      "type": "array",
      "title": "Companies"
     }
    },
    "type": "object",
    "required": [
     "format",
     "companies"
    ],
    "title": "CompanyConfigListResponse"
   },
   "CompanyConfigSummary": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "own_company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Own Company Code"
     },
     "own_vat_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Own Vat Code"
     },
     "display_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Display Name"
     },
     "updated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "company_code"
    ],
    "title": "CompanyConfigSummary"
   },
   "CompanyRequisitesCreate": {
    "properties": {
     "company_name": {
      "type": "string",
      "maxLength": 255,
      "minLength": 1,
      "title": "Company Name"
     },
     "company_code": {
      "type": "string",
      "maxLength": 50,
      "minLength": 9,
      "title": "Company Code",
      "description": "Įmonės kodas (9 skaitmenys Lietuvoje)"
     },
     "vat_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Code",
      "description": "PVM kodas (pvz., LT100000000000)"
     },
     "legal_address": {
      "type": "string",
      "maxLength": 1000,
      "minLength": 1,
      "title": "Legal Address",
      "description": "Gatvė ir namo numeris"
     },
     "postal_code": {
      "type": "string",
      "maxLength": 20,
      "minLength": 1,
      "title": "Postal Code",
      "description": "Pašto kodas (5 skaitmenų LT)"
     },
     "city": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "City"
     },
     "country": {
      "type": "string",
      "maxLength": 100,
      "title": "Country",
      "default": "Lietuva"
     },
     "bank_name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 255
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Name"
     },
     "bank_account": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Account",
      "description": "IBAN formatas"
     },
     "bank_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 20
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Code",
      "description": "SWIFT/BIC kodas"
     },
     "representative_name": {
      "type": "string",
      "maxLength": 255,
      "minLength": 1,
      "title": "Representative Name"
     },
     "representative_title": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 100
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Title",
      "description": "Pareigos, pvz., Direktorius"
     },
     "representative_email": {
      "type": "string",
      "format": "email",
      "title": "Representative Email",
      "description": "Atstovo el. paštas (privalomas)"
     },
     "representative_phone": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Phone"
     }
    },
    "type": "object",
    "required": [
     "company_name",
     "company_code",
     "legal_address",
     "postal_code",
     "city",
     "representative_name",
     "representative_email"
    ],
    "title": "CompanyRequisitesCreate"
   },
   "CompanyRequisitesResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "user_id": {
      "type": "string",
      "format": "uuid",
      "title": "User Id"
     },
     "company_name": {
      "type": "string",
      "title": "Company Name"
     },
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "vat_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Code"
     },
     "legal_address": {
      "type": "string",
      "title": "Legal Address"
     },
     "postal_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Postal Code"
     },
     "city": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "City"
     },
     "country": {
      "type": "string",
      "title": "Country"
     },
     "bank_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Name"
     },
     "bank_account": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Account"
     },
     "bank_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Code"
     },
     "representative_name": {
      "type": "string",
      "title": "Representative Name"
     },
     "representative_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Title"
     },
     "representative_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Email"
     },
     "representative_phone": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Phone"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "user_id",
     "company_name",
     "company_code",
     "legal_address",
     "country",
     "representative_name",
     "created_at",
     "updated_at"
    ],
    "title": "CompanyRequisitesResponse"
   },
   "CompanyRequisitesUpdate": {
    "properties": {
     "company_name": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 255,
        "minLength": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Name"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "vat_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Code"
     },
     "legal_address": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Legal Address"
     },
     "postal_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Postal Code"
     },
     "city": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "City"
     },
     "country": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Country"
     },
     "bank_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Name"
     },
     "bank_account": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Account"
     },
     "bank_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bank Code"
     },
     "representative_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Name"
     },
     "representative_title": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Title"
     },
     "representative_email": {
      "anyOf": [
       {
        "type": "string",
        "format": "email"
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Email"
     },
     "representative_phone": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Representative Phone"
     }
    },
    "type": "object",
    "title": "CompanyRequisitesUpdate"
   },
   "ContactFormRequest": {
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 2,
      "title": "Name",
      "description": "Sender's name"
     },
     "email": {
      "type": "string",
      "format": "email",
      "title": "Email",
      "description": "Sender's email"
     },
     "message": {
      "type": "string",
      "maxLength": 5000,
      "minLength": 10,
      "title": "Message",
      "description": "Message content"
     }
    },
    "type": "object",
    "required": [
     "name",
     "email",
     "message"
    ],
    "title": "ContactFormRequest"
   },
   "ContactFormResponse": {
    "properties": {
     "success": {
      "type": "boolean",
      "title": "Success"
     },
     "message": {
      "type": "string",
      "title": "Message"
     }
    },
    "type": "object",
    "required": [
     "success",
     "message"
    ],
    "title": "ContactFormResponse"
   },
   "CurrentMonthUsageResponse": {
    "properties": {
     "period_year": {
      "type": "integer",
      "title": "Period Year",
      "description": "Year of the usage period"
     },
     "period_month": {
      "type": "integer",
      "maximum": 12.0,
      "minimum": 1.0,
      "title": "Period Month",
      "description": "Month of the usage period (1-12)"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages",
      "description": "Total pages processed this period"
     },
     "total_invoices": {
      "type": "integer",
      "title": "Total Invoices",
      "description": "Total invoices processed this period"
     },
     "cost_per_page": {
      "type": "number",
      "title": "Cost Per Page",
      "description": "Rate per page in EUR"
     },
     "total_cost": {
      "type": "number",
      "title": "Total Cost",
      "description": "Total cost for the period"
     },
     "total_input_tokens": {
      "type": "integer",
      "title": "Total Input Tokens",
      "description": "Total input tokens used this period",
      "default": 0
     },
     "total_output_tokens": {
      "type": "integer",
      "title": "Total Output Tokens",
      "description": "Total output tokens generated this period",
      "default": 0
     },
     "total_tokens": {
      "type": "integer",
      "title": "Total Tokens",
      "description": "Total tokens used this period",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "period_year",
     "period_month",
     "total_pages",
     "total_invoices",
     "cost_per_page",
     "total_cost"
    ],
    "title": "CurrentMonthUsageResponse"
   },
   "DeleteAccountRequest": {
    "properties": {
     "password": {
      "type": "string",
      "title": "Password"
     }
    },
    "type": "object",
    "required": [
     "password"
    ],
    "title": "DeleteAccountRequest"
   },
   "DirectExtractionResponse": {
    "properties": {
     "success": {
      "type": "boolean",
      "title": "Success"
     },
     "filename": {
      "type": "string",
      "title": "Filename"
     },
     "file_size_bytes": {
      "type": "integer",
      "title": "File Size Bytes"
     },
     "extracted_data": {
      "additionalProperties": true,
      "type": "object",
      "title": "Extracted Data"
     },
     "processing_time_seconds": {
      "type": "number",
      "title": "Processing Time Seconds"
     },
     "confidence_score": {
      "type": "integer",
      "title": "Confidence Score"
     },
     "auto_validated": {
      "type": "boolean",
      "title": "Auto Validated",
      "default": false
     },
     "validation_warnings": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Validation Warnings",
      "default": []
     },
     "document_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Type"
     },
     "risk_flags": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Risk Flags",
      "default": []
     },
     "validation_issues": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Validation Issues",
      "default": []
     },
     "expense": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expense"
     },
     "duplicate_of_invoice_number": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Duplicate Of Invoice Number"
     },
     "from_cache": {
      "type": "boolean",
      "title": "From Cache",
      "default": false
     },
     "duplicate_of": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Duplicate Of"
     },
     "invoice_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Id"
     },
     "message": {
      "type": "string",
      "title": "Message",
      "default": "Data extracted successfully"
     },
     "export": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/ExportResult"
       },
       {
        "type": "null"
       }
      ]
     },
     "external_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id",
      "description": "Your own id for this document, as sent in the `Idempotency-Key` header or the `external_id` form field (1–128 characters). A repeat with the same id answers the first result instead of creating a second document."
     },
     "documents": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Documents",
      "description": "Present only with `split_documents=true` when the file is a bundle of several documents (and the account has the fuel-statement capability, enabled per account by Robodam): one entry per document — `invoice_id`, `filename`, `pages` (`from`/`to` in the uploaded file), `document_type`, `extracted_data`, `confidence_score`, `auto_validated`, `validation_warnings`, `validation_issues`, `risk_flags`, `duplicate_of_invoice_number`, `expense`, `export`. The top level is then the container (`document_type: non_document`), not a document."
     }
    },
    "type": "object",
    "required": [
     "success",
     "filename",
     "file_size_bytes",
     "extracted_data",
     "processing_time_seconds",
     "confidence_score"
    ],
    "title": "DirectExtractionResponse",
    "description": "The synchronous extraction. `external_id` is present only when the request carried one; `documents` only with `split_documents=true` when the file is a bundle of several documents (an account with the fuel-statement capability)."
   },
   "DiscoverCompaniesResponse": {
    "properties": {
     "format": {
      "type": "string",
      "title": "Format"
     },
     "scanned_invoices": {
      "type": "integer",
      "title": "Scanned Invoices"
     },
     "suggestions": {
      "items": {
       "$ref": "#/components/schemas/DiscoveredCompanySummary"
      },
      "type": "array",
      "title": "Suggestions"
     }
    },
    "type": "object",
    "required": [
     "format",
     "scanned_invoices",
     "suggestions"
    ],
    "title": "DiscoverCompaniesResponse"
   },
   "DiscoveredCompanySummary": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "vat_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Code"
     },
     "vendor_count": {
      "type": "integer",
      "title": "Vendor Count"
     },
     "customer_count": {
      "type": "integer",
      "title": "Customer Count"
     },
     "both_sides": {
      "type": "boolean",
      "title": "Both Sides"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     }
    },
    "type": "object",
    "required": [
     "name",
     "vendor_count",
     "customer_count",
     "both_sides",
     "total"
    ],
    "title": "DiscoveredCompanySummary"
   },
   "DriveConfigResponse": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config"
     },
     "is_default": {
      "type": "boolean",
      "title": "Is Default"
     }
    },
    "type": "object",
    "required": [
     "config",
     "is_default"
    ],
    "title": "DriveConfigResponse"
   },
   "DriveConfigUpdateRequest": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config"
     }
    },
    "type": "object",
    "required": [
     "config"
    ],
    "title": "DriveConfigUpdateRequest"
   },
   "DriveFolderPreviewItem": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "mime_type": {
      "type": "string",
      "title": "Mime Type"
     },
     "size": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Size"
     },
     "modified_time": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Modified Time"
     },
     "direction": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Direction"
     },
     "path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Path"
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "mime_type"
    ],
    "title": "DriveFolderPreviewItem"
   },
   "DriveFolderPreviewResponse": {
    "properties": {
     "root_folder_id": {
      "type": "string",
      "title": "Root Folder Id"
     },
     "root_folder_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Root Folder Name"
     },
     "total_candidates": {
      "type": "integer",
      "title": "Total Candidates"
     },
     "already_ingested": {
      "type": "integer",
      "title": "Already Ingested"
     },
     "new_candidates": {
      "type": "integer",
      "title": "New Candidates"
     },
     "skipped": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Skipped"
     },
     "sample": {
      "items": {
       "$ref": "#/components/schemas/DriveFolderPreviewItem"
      },
      "type": "array",
      "title": "Sample"
     }
    },
    "type": "object",
    "required": [
     "root_folder_id",
     "total_candidates",
     "already_ingested",
     "new_candidates",
     "skipped",
     "sample"
    ],
    "title": "DriveFolderPreviewResponse"
   },
   "DriveIngestionRow": {
    "properties": {
     "drive_file_id": {
      "type": "string",
      "title": "Drive File Id"
     },
     "drive_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Drive Name"
     },
     "direction": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Direction"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "detail": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Detail"
     },
     "invoice_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Id"
     },
     "created_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "drive_file_id",
     "status"
    ],
    "title": "DriveIngestionRow"
   },
   "DriveIngestionsResponse": {
    "properties": {
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "rows": {
      "items": {
       "$ref": "#/components/schemas/DriveIngestionRow"
      },
      "type": "array",
      "title": "Rows"
     },
     "totals": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Totals"
     }
    },
    "type": "object",
    "required": [
     "rows",
     "totals"
    ],
    "title": "DriveIngestionsResponse"
   },
   "DriveKeyStatusResponse": {
    "properties": {
     "configured": {
      "type": "boolean",
      "title": "Configured"
     },
     "masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Masked"
     },
     "access_asked": {
      "type": "boolean",
      "title": "Access Asked",
      "default": false
     },
     "access_asked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Access Asked At"
     },
     "access_days_waiting": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Access Days Waiting"
     },
     "access_can_remind": {
      "type": "boolean",
      "title": "Access Can Remind",
      "default": false
     },
     "service_account_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Service Account Email"
     }
    },
    "type": "object",
    "required": [
     "configured"
    ],
    "title": "DriveKeyStatusResponse"
   },
   "DrivePreviewOverridesRequest": {
    "properties": {
     "skip_sales": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Skip Sales"
     },
     "ingest_modified_after": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Ingest Modified After"
     }
    },
    "additionalProperties": false,
    "type": "object",
    "title": "DrivePreviewOverridesRequest"
   },
   "DriveSubfolder": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "used_by": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Used By"
     }
    },
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "title": "DriveSubfolder"
   },
   "DriveSubfoldersResponse": {
    "properties": {
     "parent_id": {
      "type": "string",
      "title": "Parent Id"
     },
     "parent_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Parent Name"
     },
     "folders": {
      "items": {
       "$ref": "#/components/schemas/DriveSubfolder"
      },
      "type": "array",
      "title": "Folders",
      "default": []
     },
     "file_count": {
      "type": "integer",
      "title": "File Count",
      "default": 0
     },
     "error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error"
     }
    },
    "type": "object",
    "required": [
     "parent_id"
    ],
    "title": "DriveSubfoldersResponse"
   },
   "DriveSyncNowResponse": {
    "properties": {
     "ingested": {
      "type": "integer",
      "title": "Ingested"
     },
     "duplicates": {
      "type": "integer",
      "title": "Duplicates"
     },
     "failed": {
      "type": "integer",
      "title": "Failed"
     },
     "considered": {
      "type": "integer",
      "title": "Considered"
     },
     "skipped": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Skipped"
     },
     "capped": {
      "type": "integer",
      "title": "Capped",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "ingested",
     "duplicates",
     "failed",
     "considered",
     "skipped"
    ],
    "title": "DriveSyncNowResponse"
   },
   "DriveVisibleFolder": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "owner": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Owner"
     },
     "shared_at": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Shared At"
     },
     "is_configured": {
      "type": "boolean",
      "title": "Is Configured",
      "default": false
     },
     "used_by": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Used By"
     }
    },
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "title": "DriveVisibleFolder"
   },
   "DriveVisibleResponse": {
    "properties": {
     "verdict": {
      "type": "string",
      "enum": [
       "no_key",
       "auth_failed",
       "unreachable",
       "nothing_shared",
       "not_configured",
       "root_not_visible",
       "configured_nested",
       "configured_no_access",
       "ok"
      ],
      "title": "Verdict"
     },
     "service_account_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Service Account Email"
     },
     "configured_root_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Configured Root Id"
     },
     "configured_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Configured Name"
     },
     "configured_visible": {
      "type": "boolean",
      "title": "Configured Visible",
      "default": false
     },
     "folders": {
      "items": {
       "$ref": "#/components/schemas/DriveVisibleFolder"
      },
      "type": "array",
      "title": "Folders",
      "default": []
     },
     "detail": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Detail"
     }
    },
    "type": "object",
    "required": [
     "verdict"
    ],
    "title": "DriveVisibleResponse"
   },
   "EmailVerificationResponse": {
    "properties": {
     "message": {
      "type": "string",
      "title": "Message"
     },
     "email_verified": {
      "type": "boolean",
      "title": "Email Verified",
      "default": true
     }
    },
    "type": "object",
    "required": [
     "message"
    ],
    "title": "EmailVerificationResponse"
   },
   "EntrySummaryCompany": {
    "properties": {
     "documents": {
      "type": "integer",
      "title": "Documents",
      "description": "Documents processed (billed) in the month"
     },
     "entered": {
      "type": "integer",
      "title": "Entered",
      "description": "Of them, entered into the accounting system"
     },
     "not_entered": {
      "type": "integer",
      "title": "Not Entered",
      "description": "Tried and not entered — still open"
     },
     "not_sending": {
      "type": "integer",
      "title": "Not Sending",
      "description": "Not sent by choice or by configuration"
     },
     "not_attempted": {
      "type": "integer",
      "title": "Not Attempted",
      "description": "Not tried yet"
     },
     "doubt": {
      "type": "integer",
      "title": "Doubt",
      "description": "Documents with an open doubt (also counted in one of the four above)"
     },
     "rate": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rate",
      "description": "entered / (entered + not_entered), 4 decimals; null when nothing was tried"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code",
      "description": "The owning company; null — documents no company owns"
     },
     "company_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Name",
      "description": "Its registered name, when known"
     }
    },
    "type": "object",
    "required": [
     "documents",
     "entered",
     "not_entered",
     "not_sending",
     "not_attempted",
     "doubt"
    ],
    "title": "EntrySummaryCompany"
   },
   "EntrySummaryPeriod": {
    "properties": {
     "documents": {
      "type": "integer",
      "title": "Documents",
      "description": "Documents processed (billed) in the month"
     },
     "entered": {
      "type": "integer",
      "title": "Entered",
      "description": "Of them, entered into the accounting system"
     },
     "not_entered": {
      "type": "integer",
      "title": "Not Entered",
      "description": "Tried and not entered — still open"
     },
     "not_sending": {
      "type": "integer",
      "title": "Not Sending",
      "description": "Not sent by choice or by configuration"
     },
     "not_attempted": {
      "type": "integer",
      "title": "Not Attempted",
      "description": "Not tried yet"
     },
     "doubt": {
      "type": "integer",
      "title": "Doubt",
      "description": "Documents with an open doubt (also counted in one of the four above)"
     },
     "rate": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rate",
      "description": "entered / (entered + not_entered), 4 decimals; null when nothing was tried"
     },
     "year": {
      "type": "integer",
      "title": "Year",
      "description": "Year of the period"
     },
     "month": {
      "type": "integer",
      "maximum": 12.0,
      "minimum": 1.0,
      "title": "Month",
      "description": "Month of the period (1-12)"
     },
     "billed_documents": {
      "type": "integer",
      "title": "Billed Documents",
      "description": "Documents billed in the month, as the usage history shows them (0 without a row)"
     },
     "possible_duplicates": {
      "type": "integer",
      "title": "Possible Duplicates",
      "description": "Documents of the month that repeat an earlier one: the same company, seller, invoice number and document type"
     },
     "unmatched_agent_rows": {
      "type": "integer",
      "title": "Unmatched Agent Rows",
      "description": "Agent reports dated in the month that were never tied to a document (a report whose document was deleted afterwards is not counted)"
     },
     "companies": {
      "items": {
       "$ref": "#/components/schemas/EntrySummaryCompany"
      },
      "type": "array",
      "title": "Companies",
      "description": "Per company — only for an account with documents of two or more companies"
     }
    },
    "type": "object",
    "required": [
     "documents",
     "entered",
     "not_entered",
     "not_sending",
     "not_attempted",
     "doubt",
     "year",
     "month",
     "billed_documents",
     "possible_duplicates",
     "unmatched_agent_rows"
    ],
    "title": "EntrySummaryPeriod"
   },
   "EntrySummaryResponse": {
    "properties": {
     "available": {
      "type": "boolean",
      "title": "Available",
      "description": "False when the account has neither agent reports nor accounting-system pushes"
     },
     "sources": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Sources",
      "description": "Where the answers come from: `agent`, `erp`"
     },
     "agent_data_through": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Agent Data Through",
      "description": "The latest day the agent's reports are dated"
     },
     "month_rule": {
      "type": "string",
      "title": "Month Rule",
      "description": "`utc_processing`: a document belongs to the UTC month it was processed in"
     },
     "open_not_entered_total": {
      "type": "integer",
      "title": "Open Not Entered Total",
      "description": "Documents `GET /invoices?agent_status=not_entered` lists"
     },
     "open_doubt_total": {
      "type": "integer",
      "title": "Open Doubt Total",
      "description": "Documents `GET /invoices?agent_status=doubt` lists"
     },
     "open_erp_failed_total": {
      "type": "integer",
      "title": "Open Erp Failed Total",
      "description": "Documents `GET /invoices?erp_status=failed` lists (0 without an accounting-system push)",
      "default": 0
     },
     "open_erp_held_total": {
      "type": "integer",
      "title": "Open Erp Held Total",
      "description": "Documents `GET /invoices?erp_status=held` lists (0 without an accounting-system push)",
      "default": 0
     },
     "periods": {
      "items": {
       "$ref": "#/components/schemas/EntrySummaryPeriod"
      },
      "type": "array",
      "title": "Periods",
      "description": "Newest first, one per requested month (empty when not available)"
     }
    },
    "type": "object",
    "required": [
     "available",
     "sources",
     "month_rule",
     "open_not_entered_total",
     "open_doubt_total",
     "periods"
    ],
    "title": "EntrySummaryResponse"
   },
   "ExpenseAssignmentResponse": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "expense_assignments": {
      "additionalProperties": true,
      "type": "object",
      "title": "Expense Assignments"
     }
    },
    "type": "object",
    "required": [
     "invoice_id",
     "expense_assignments"
    ],
    "title": "ExpenseAssignmentResponse"
   },
   "ExpenseAssignmentUpdateRequest": {
    "properties": {
     "assignments": {
      "additionalProperties": {
       "type": "string"
      },
      "type": "object",
      "title": "Assignments",
      "description": "Map of \"_default\" | line-index → account_code"
     },
     "vat_classes": {
      "anyOf": [
       {
        "additionalProperties": {
         "type": "string"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat Classes",
      "description": "Map of \"_default\" | line-index → PVM klasifikatorius"
     },
     "config_company": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Config Company",
      "description": "config_company the picker was rendered for (null = the account); a mismatch with the invoice's current scope answers 409 expense_scope_changed"
     }
    },
    "type": "object",
    "title": "ExpenseAssignmentUpdateRequest"
   },
   "ExpenseConfigPublicResponse": {
    "properties": {
     "enabled": {
      "type": "boolean",
      "title": "Enabled"
     },
     "granularity": {
      "type": "string",
      "title": "Granularity"
     },
     "default_account": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Default Account"
     },
     "targets": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Targets",
      "default": []
     },
     "any_scope_enabled": {
      "type": "boolean",
      "title": "Any Scope Enabled",
      "default": false
     },
     "company_scope_enabled": {
      "type": "boolean",
      "title": "Company Scope Enabled",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "enabled",
     "granularity"
    ],
    "title": "ExpenseConfigPublicResponse"
   },
   "ExpenseConfigUpdateRequest": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config",
      "description": "ExpenseConfig object"
     }
    },
    "type": "object",
    "required": [
     "config"
    ],
    "title": "ExpenseConfigUpdateRequest"
   },
   "ExpenseScopeConfig": {
    "properties": {
     "config_company": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Config Company"
     },
     "enabled": {
      "type": "boolean",
      "title": "Enabled"
     },
     "granularity": {
      "type": "string",
      "title": "Granularity"
     },
     "default_account": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Default Account"
     },
     "targets": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Targets",
      "default": []
     },
     "known_vat_classes": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Known Vat Classes"
     }
    },
    "type": "object",
    "required": [
     "enabled",
     "granularity"
    ],
    "title": "ExpenseScopeConfig"
   },
   "ExpenseScopeEntry": {
    "properties": {
     "owner": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Owner"
     },
     "config_company": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Config Company"
     },
     "pending": {
      "type": "boolean",
      "title": "Pending",
      "default": false
     },
     "enabled": {
      "type": "boolean",
      "title": "Enabled",
      "default": false
     },
     "unassigned": {
      "type": "boolean",
      "title": "Unassigned",
      "default": false
     }
    },
    "type": "object",
    "title": "ExpenseScopeEntry"
   },
   "ExpenseScopesResponse": {
    "properties": {
     "scopes": {
      "additionalProperties": {
       "$ref": "#/components/schemas/ExpenseScopeEntry"
      },
      "type": "object",
      "title": "Scopes"
     },
     "configs": {
      "items": {
       "$ref": "#/components/schemas/ExpenseScopeConfig"
      },
      "type": "array",
      "title": "Configs",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "scopes"
    ],
    "title": "ExpenseScopesResponse"
   },
   "ExpenseSummaryResponse": {
    "properties": {
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "assigned": {
      "type": "integer",
      "title": "Assigned"
     },
     "unassigned": {
      "type": "integer",
      "title": "Unassigned"
     },
     "by_source": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "By Source",
      "default": {}
     },
     "sales": {
      "type": "integer",
      "title": "Sales",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "total",
     "assigned",
     "unassigned"
    ],
    "title": "ExpenseSummaryResponse"
   },
   "ExportConfigResponse": {
    "properties": {
     "format": {
      "type": "string",
      "title": "Format"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config"
     },
     "is_default": {
      "type": "boolean",
      "title": "Is Default"
     },
     "updated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Updated At"
     }
    },
    "type": "object",
    "required": [
     "format",
     "config",
     "is_default"
    ],
    "title": "ExportConfigResponse"
   },
   "ExportConfigUpdateRequest": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config",
      "description": "Format-specific config object"
     }
    },
    "type": "object",
    "required": [
     "config"
    ],
    "title": "ExportConfigUpdateRequest"
   },
   "ExportResult": {
    "properties": {
     "format": {
      "type": "string",
      "title": "Format"
     },
     "filename": {
      "type": "string",
      "title": "Filename"
     },
     "content_type": {
      "type": "string",
      "title": "Content Type"
     },
     "content_base64": {
      "type": "string",
      "title": "Content Base64"
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems",
      "default": []
     },
     "skipped_count": {
      "type": "integer",
      "title": "Skipped Count",
      "default": 0
     },
     "purchase_count": {
      "type": "integer",
      "title": "Purchase Count",
      "default": 0
     },
     "sale_count": {
      "type": "integer",
      "title": "Sale Count",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "format",
     "filename",
     "content_type",
     "content_base64"
    ],
    "title": "ExportResult"
   },
   "FirmReconciliationResponse": {
    "properties": {
     "period": {
      "type": "string",
      "title": "Period"
     },
     "companies": {
      "items": {
       "$ref": "#/components/schemas/FirmReconciliationRow"
      },
      "type": "array",
      "title": "Companies"
     },
     "totals": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Totals"
     },
     "needs_attention": {
      "type": "integer",
      "title": "Needs Attention"
     }
    },
    "type": "object",
    "required": [
     "period",
     "companies",
     "totals",
     "needs_attention"
    ],
    "title": "FirmReconciliationResponse"
   },
   "FirmReconciliationRow": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "status": {
      "type": "string",
      "enum": [
       "mismatch",
       "unverified",
       "never_checked",
       "stale",
       "ok",
       "nothing_sent",
       "not_connected"
      ],
      "title": "Status"
     },
     "sent_by_us": {
      "type": "integer",
      "title": "Sent By Us"
     },
     "verified_in_erp": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verified In Erp"
     },
     "missing_count": {
      "type": "integer",
      "title": "Missing Count",
      "default": 0
     },
     "verify_error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Verify Error"
     },
     "checked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Checked At"
     },
     "sendable": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Sendable"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "name",
     "status",
     "sent_by_us"
    ],
    "title": "FirmReconciliationRow"
   },
   "FlagIssueRequest": {
    "properties": {
     "reason": {
      "type": "string",
      "enum": [
       "incorrect_data",
       "missing_fields",
       "wrong_document_type",
       "unreadable_pdf",
       "other"
      ],
      "title": "Reason"
     },
     "description": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 2000
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     }
    },
    "type": "object",
    "required": [
     "reason"
    ],
    "title": "FlagIssueRequest"
   },
   "FlagIssueResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "client_flagged": {
      "type": "boolean",
      "title": "Client Flagged"
     },
     "flag_reason": {
      "type": "string",
      "title": "Flag Reason"
     },
     "flag_priority": {
      "type": "string",
      "title": "Flag Priority"
     },
     "flagged_at": {
      "type": "string",
      "format": "date-time",
      "title": "Flagged At"
     },
     "message": {
      "type": "string",
      "title": "Message",
      "default": "Problem reported successfully"
     }
    },
    "type": "object",
    "required": [
     "id",
     "client_flagged",
     "flag_reason",
     "flag_priority",
     "flagged_at"
    ],
    "title": "FlagIssueResponse"
   },
   "FolderRequestCreate": {
    "properties": {
     "company_code": {
      "type": "string",
      "maxLength": 50,
      "minLength": 1,
      "title": "Company Code"
     },
     "contact_email": {
      "type": "string",
      "maxLength": 255,
      "minLength": 3,
      "title": "Contact Email"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "contact_email"
    ],
    "title": "FolderRequestCreate"
   },
   "FolderRequestMessage": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "company_name": {
      "type": "string",
      "title": "Company Name"
     },
     "service_account_email": {
      "type": "string",
      "title": "Service Account Email"
     },
     "subject": {
      "type": "string",
      "title": "Subject"
     },
     "body": {
      "type": "string",
      "title": "Body"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "company_name",
     "service_account_email",
     "subject",
     "body"
    ],
    "title": "FolderRequestMessage"
   },
   "FolderRequestResponse": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "asked": {
      "type": "boolean",
      "title": "Asked",
      "default": false
     },
     "contact_email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contact Email"
     },
     "asked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Asked At"
     },
     "days_waiting": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Days Waiting"
     },
     "can_remind": {
      "type": "boolean",
      "title": "Can Remind",
      "default": false
     },
     "closed": {
      "type": "boolean",
      "title": "Closed",
      "default": false
     },
     "closed_folder_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Closed Folder Name"
     },
     "last_checked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Last Checked At"
     }
    },
    "type": "object",
    "required": [
     "company_code"
    ],
    "title": "FolderRequestResponse"
   },
   "ForgotPasswordRequest": {
    "properties": {
     "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
     }
    },
    "type": "object",
    "required": [
     "email"
    ],
    "title": "ForgotPasswordRequest"
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "IntegrationKeyStatusResponse": {
    "properties": {
     "configured": {
      "type": "boolean",
      "title": "Configured"
     },
     "masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Masked"
     },
     "auto_config": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Auto Config"
     },
     "verdict": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "accepted",
         "unreachable"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Verdict"
     }
    },
    "type": "object",
    "required": [
     "configured"
    ],
    "title": "IntegrationKeyStatusResponse"
   },
   "InvoiceFieldsResponse": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "updated": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Updated"
     },
     "extracted_data": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Extracted Data"
     },
     "manual_field_overrides": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Manual Field Overrides"
     },
     "needs_repush": {
      "type": "boolean",
      "title": "Needs Repush",
      "default": false
     },
     "owning_company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Owning Company Code"
     }
    },
    "type": "object",
    "required": [
     "invoice_id",
     "updated"
    ],
    "title": "InvoiceFieldsResponse"
   },
   "InvoiceFieldsUpdateRequest": {
    "properties": {
     "fields": {
      "additionalProperties": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ]
      },
      "type": "object",
      "maxProperties": 20,
      "minProperties": 1,
      "title": "Fields"
     }
    },
    "type": "object",
    "required": [
     "fields"
    ],
    "title": "InvoiceFieldsUpdateRequest"
   },
   "InvoiceListResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "original_filename": {
      "type": "string",
      "title": "Original Filename"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "file_size_bytes": {
      "type": "integer",
      "title": "File Size Bytes"
     },
     "extracted_data": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Extracted Data"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "retry_count": {
      "type": "integer",
      "title": "Retry Count",
      "default": 0
     },
     "processing_error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Processing Error"
     },
     "page_count": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Page Count"
     },
     "validation_status": {
      "type": "string",
      "title": "Validation Status",
      "default": "unvalidated"
     },
     "is_validated": {
      "type": "boolean",
      "title": "Is Validated",
      "default": false
     },
     "auto_validated": {
      "type": "boolean",
      "title": "Auto Validated",
      "default": false
     },
     "confidence_score": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Confidence Score"
     },
     "client_flagged": {
      "type": "boolean",
      "title": "Client Flagged",
      "default": false
     },
     "flag_priority": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Flag Priority"
     },
     "document_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Document Type"
     },
     "expense_assignments": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expense Assignments"
     },
     "reverse_charge_override": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reverse Charge Override"
     },
     "erp_push_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Status"
     },
     "erp_push_system": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push System"
     },
     "erp_push_reason_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Reason Code"
     },
     "erp_push_note": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Push Note"
     },
     "agent_status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Agent Status"
     },
     "agent_note": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Agent Note"
     },
     "agent_doubt": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Agent Doubt"
     },
     "sum_mismatch": {
      "type": "boolean",
      "title": "Sum Mismatch",
      "default": false
     },
     "expense_lines": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expense Lines"
     },
     "owning_company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Owning Company Code"
     },
     "intercompany": {
      "anyOf": [
       {
        "additionalProperties": {
         "type": "string"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Intercompany"
     },
     "unassigned": {
      "type": "boolean",
      "title": "Unassigned",
      "default": false
     },
     "updated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Updated At"
     },
     "external_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id",
      "description": "Your own id for this document, as sent in the `Idempotency-Key` header or the `external_id` form field (1–128 characters). A repeat with the same id answers the first result instead of creating a second document."
     }
    },
    "type": "object",
    "required": [
     "id",
     "original_filename",
     "status",
     "file_size_bytes",
     "created_at"
    ],
    "title": "InvoiceListResponse"
   },
   "InvoiceOwnerRequest": {
    "properties": {
     "company_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     }
    },
    "type": "object",
    "title": "InvoiceOwnerRequest"
   },
   "InvoiceOwnerResponse": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "owning_company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Owning Company Code"
     }
    },
    "type": "object",
    "required": [
     "invoice_id"
    ],
    "title": "InvoiceOwnerResponse"
   },
   "InvoiceUploadResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "original_filename": {
      "type": "string",
      "title": "Original Filename"
     },
     "file_size_bytes": {
      "type": "integer",
      "title": "File Size Bytes"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "extracted_data": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Extracted Data"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "external_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "External Id",
      "description": "Your own id for this document, as sent in the `Idempotency-Key` header or the `external_id` form field (1–128 characters). A repeat with the same id answers the first result instead of creating a second document."
     }
    },
    "type": "object",
    "required": [
     "id",
     "original_filename",
     "file_size_bytes",
     "status",
     "created_at"
    ],
    "title": "InvoiceUploadResponse"
   },
   "LoginRequest": {
    "properties": {
     "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
     },
     "password": {
      "type": "string",
      "title": "Password"
     }
    },
    "type": "object",
    "required": [
     "email",
     "password"
    ],
    "title": "LoginRequest"
   },
   "MemoryFeedbackEntry": {
    "properties": {
     "text": {
      "type": "string",
      "maxLength": 1024,
      "minLength": 1,
      "title": "Text"
     },
     "supplier_key": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 255
       },
       {
        "type": "null"
       }
      ],
      "title": "Supplier Key",
      "description": "The `expense.supplier_key` /extract-direct returned for this document, echoed unchanged; omit for a client-wide fact."
     },
     "target_type": {
      "type": "string",
      "enum": [
       "expense_code",
       "product_card",
       "exclude"
      ],
      "title": "Target Type"
     },
     "target_value": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 64
       },
       {
        "type": "null"
       }
      ],
      "title": "Target Value"
     },
     "changed": {
      "type": "boolean",
      "title": "Changed",
      "default": false
     },
     "dok_nr": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 80
       },
       {
        "type": "null"
       }
      ],
      "title": "Dok Nr",
      "description": "The ERP document number the line was entered as (with `eil`: the idempotency key; blank = not keyed)."
     },
     "eil": {
      "anyOf": [
       {
        "type": "integer",
        "minimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Eil",
      "description": "The line index as /extract-direct returned it (`expense.lines[].idx`)."
     },
     "data": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Data",
      "description": "The entry date (part of the idempotency key)."
     }
    },
    "type": "object",
    "required": [
     "text",
     "target_type"
    ],
    "title": "MemoryFeedbackEntry"
   },
   "MemoryFeedbackRejection": {
    "properties": {
     "index": {
      "type": "integer",
      "title": "Index"
     },
     "error": {
      "type": "string",
      "title": "Error"
     },
     "message": {
      "type": "string",
      "title": "Message"
     }
    },
    "type": "object",
    "required": [
     "index",
     "error",
     "message"
    ],
    "title": "MemoryFeedbackRejection",
    "description": "An entry that was not applied: `index` into the request's `entries`, a machine `error` and a `message`."
   },
   "MemoryFeedbackRequest": {
    "properties": {
     "entries": {
      "items": {
       "$ref": "#/components/schemas/MemoryFeedbackEntry"
      },
      "type": "array",
      "maxItems": 500,
      "minItems": 1,
      "title": "Entries"
     }
    },
    "type": "object",
    "required": [
     "entries"
    ],
    "title": "MemoryFeedbackRequest"
   },
   "MemoryFeedbackResponse": {
    "properties": {
     "stored": {
      "type": "integer",
      "title": "Stored"
     },
     "skipped_empty": {
      "type": "integer",
      "title": "Skipped Empty"
     },
     "conflicts": {
      "type": "integer",
      "title": "Conflicts"
     },
     "duplicates": {
      "type": "integer",
      "title": "Duplicates",
      "default": 0
     },
     "duplicate_indexes": {
      "items": {
       "type": "integer"
      },
      "type": "array",
      "title": "Duplicate Indexes",
      "default": []
     },
     "rejected": {
      "items": {
       "$ref": "#/components/schemas/MemoryFeedbackRejection"
      },
      "type": "array",
      "title": "Rejected",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "stored",
     "skipped_empty",
     "conflicts"
    ],
    "title": "MemoryFeedbackResponse"
   },
   "MemoryListResponse": {
    "properties": {
     "count": {
      "type": "integer",
      "title": "Count"
     },
     "items": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Items"
     }
    },
    "type": "object",
    "required": [
     "count",
     "items"
    ],
    "title": "MemoryListResponse"
   },
   "OptimumBookingLine": {
    "properties": {
     "account_no": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Account No"
     },
     "amount": {
      "type": "number",
      "title": "Amount",
      "default": 0.0
     },
     "vat_line": {
      "type": "boolean",
      "title": "Vat Line",
      "default": false
     }
    },
    "type": "object",
    "title": "OptimumBookingLine"
   },
   "OptimumBulkKeyResult": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "configured": {
      "type": "boolean",
      "title": "Configured"
     },
     "masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Masked"
     },
     "verdict": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "accepted",
         "rejected",
         "unreachable"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Verdict"
     },
     "error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error"
     },
     "system": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "System"
     },
     "database": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Database"
     },
     "database_changed": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Database Changed"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "configured"
    ],
    "title": "OptimumBulkKeyResult"
   },
   "OptimumBulkKeysRequest": {
    "properties": {
     "keys": {
      "items": {
       "$ref": "#/components/schemas/BulkKeyItem"
      },
      "type": "array",
      "maxItems": 10,
      "minItems": 1,
      "title": "Keys"
     }
    },
    "type": "object",
    "required": [
     "keys"
    ],
    "title": "OptimumBulkKeysRequest"
   },
   "OptimumBulkKeysResponse": {
    "properties": {
     "results": {
      "items": {
       "$ref": "#/components/schemas/OptimumBulkKeyResult"
      },
      "type": "array",
      "title": "Results"
     },
     "stored": {
      "type": "integer",
      "title": "Stored"
     }
    },
    "type": "object",
    "required": [
     "results",
     "stored"
    ],
    "title": "OptimumBulkKeysResponse"
   },
   "OptimumCatalogAccount": {
    "properties": {
     "account_no": {
      "type": "string",
      "title": "Account No"
     },
     "kind": {
      "type": "string",
      "title": "Kind"
     },
     "example": {
      "type": "string",
      "title": "Example",
      "default": ""
     }
    },
    "type": "object",
    "required": [
     "account_no",
     "kind"
    ],
    "title": "OptimumCatalogAccount"
   },
   "OptimumCatalogCard": {
    "properties": {
     "code": {
      "type": "string",
      "title": "Code"
     },
     "name": {
      "type": "string",
      "title": "Name",
      "default": ""
     },
     "product": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Product"
     }
    },
    "type": "object",
    "required": [
     "code"
    ],
    "title": "OptimumCatalogCard"
   },
   "OptimumCatalogResponse": {
    "properties": {
     "articles": {
      "items": {
       "$ref": "#/components/schemas/OptimumCatalogCard"
      },
      "type": "array",
      "title": "Articles",
      "default": []
     },
     "customers": {
      "items": {
       "$ref": "#/components/schemas/OptimumCatalogCard"
      },
      "type": "array",
      "title": "Customers",
      "default": []
     },
     "truncated": {
      "type": "boolean",
      "title": "Truncated",
      "default": false
     },
     "accounts": {
      "items": {
       "$ref": "#/components/schemas/OptimumCatalogAccount"
      },
      "type": "array",
      "title": "Accounts",
      "default": []
     },
     "employees": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Employees",
      "default": []
     }
    },
    "type": "object",
    "title": "OptimumCatalogResponse"
   },
   "OptimumConfigResponse": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config"
     },
     "is_default": {
      "type": "boolean",
      "title": "Is Default"
     },
     "unblocked": {
      "items": {
       "$ref": "#/components/schemas/OptimumUnblockedDocument"
      },
      "type": "array",
      "title": "Unblocked",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "config",
     "is_default"
    ],
    "title": "OptimumConfigResponse"
   },
   "OptimumConfigUpdateRequest": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config",
      "description": "Partial OptimumConfig — MERGED into the stored config, never replacing it (unknown keys are rejected)."
     }
    },
    "type": "object",
    "required": [
     "config"
    ],
    "title": "OptimumConfigUpdateRequest"
   },
   "OptimumDiscoverResponse": {
    "properties": {
     "database": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Database"
     },
     "user_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "User Code"
     },
     "settings": {
      "additionalProperties": true,
      "type": "object",
      "title": "Settings",
      "default": {}
     },
     "companies": {
      "type": "integer",
      "title": "Companies",
      "default": 0
     },
     "suppliers": {
      "type": "integer",
      "title": "Suppliers",
      "default": 0
     },
     "articles": {
      "type": "integer",
      "title": "Articles",
      "default": 0
     },
     "stores": {
      "type": "integer",
      "title": "Stores",
      "default": 0
     },
     "supplier_group_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Supplier Group Code"
     },
     "auto_config": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Auto Config"
     }
    },
    "type": "object",
    "title": "OptimumDiscoverResponse"
   },
   "OptimumFirmSettingsRequest": {
    "properties": {
     "pilot_start_date": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Pilot Start Date"
     },
     "targets": {
      "anyOf": [
       {
        "items": {
         "$ref": "#/components/schemas/OptimumFirmTarget"
        },
        "type": "array",
        "maxItems": 300,
        "minItems": 1
       },
       {
        "type": "null"
       }
      ],
      "title": "Targets"
     },
     "overwrite": {
      "type": "boolean",
      "title": "Overwrite",
      "default": false
     }
    },
    "type": "object",
    "title": "OptimumFirmSettingsRequest"
   },
   "OptimumFirmSettingsResponse": {
    "properties": {
     "results": {
      "items": {
       "$ref": "#/components/schemas/OptimumFirmSettingsResult"
      },
      "type": "array",
      "title": "Results"
     },
     "pilot_set": {
      "type": "integer",
      "title": "Pilot Set"
     },
     "targets_set": {
      "type": "integer",
      "title": "Targets Set"
     }
    },
    "type": "object",
    "required": [
     "results",
     "pilot_set",
     "targets_set"
    ],
    "title": "OptimumFirmSettingsResponse"
   },
   "OptimumFirmSettingsResult": {
    "properties": {
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "pilot": {
      "type": "string",
      "title": "Pilot"
     },
     "targets": {
      "type": "string",
      "title": "Targets"
     }
    },
    "type": "object",
    "required": [
     "company_code",
     "pilot",
     "targets"
    ],
    "title": "OptimumFirmSettingsResult"
   },
   "OptimumFirmTarget": {
    "properties": {
     "code": {
      "type": "string",
      "pattern": "^[A-Za-z0-9.\\-]{1,30}$",
      "title": "Code"
     },
     "label": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Label"
     }
    },
    "type": "object",
    "required": [
     "code",
     "label"
    ],
    "title": "OptimumFirmTarget"
   },
   "OptimumKeyStatusResponse": {
    "properties": {
     "configured": {
      "type": "boolean",
      "title": "Configured"
     },
     "masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Masked"
     },
     "verdict": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "accepted",
         "unreachable"
        ]
       },
       {
        "type": "null"
       }
      ],
      "title": "Verdict"
     },
     "database": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Database"
     },
     "user_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "User Code"
     },
     "auto_config": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Auto Config"
     }
    },
    "type": "object",
    "required": [
     "configured"
    ],
    "title": "OptimumKeyStatusResponse"
   },
   "OptimumPushDetail": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "filename": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filename"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems",
      "default": []
     },
     "optimum_document_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Optimum Document Id"
     },
     "booking": {
      "items": {
       "$ref": "#/components/schemas/OptimumBookingLine"
      },
      "type": "array",
      "title": "Booking",
      "default": []
     },
     "vat_codes": {
      "items": {
       "$ref": "#/components/schemas/OptimumVatCodeLine"
      },
      "type": "array",
      "title": "Vat Codes",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "invoice_id",
     "status"
    ],
    "title": "OptimumPushDetail"
   },
   "OptimumPushRequest": {
    "properties": {
     "invoice_ids": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "maxItems": 1000,
      "minItems": 1,
      "title": "Invoice Ids"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "evaluate": {
      "type": "boolean",
      "title": "Evaluate",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "invoice_ids"
    ],
    "title": "OptimumPushRequest"
   },
   "OptimumPushResponse": {
    "properties": {
     "pushed_count": {
      "type": "integer",
      "title": "Pushed Count"
     },
     "held_count": {
      "type": "integer",
      "title": "Held Count",
      "default": 0
     },
     "skipped_count": {
      "type": "integer",
      "title": "Skipped Count"
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems"
     },
     "details": {
      "items": {
       "$ref": "#/components/schemas/OptimumPushDetail"
      },
      "type": "array",
      "title": "Details",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "pushed_count",
     "skipped_count",
     "problems"
    ],
    "title": "OptimumPushResponse"
   },
   "OptimumTestRunResponse": {
    "properties": {
     "attempted": {
      "type": "integer",
      "title": "Attempted"
     },
     "held_count": {
      "type": "integer",
      "title": "Held Count",
      "default": 0
     },
     "skipped_count": {
      "type": "integer",
      "title": "Skipped Count",
      "default": 0
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems",
      "default": []
     },
     "invoices": {
      "items": {
       "$ref": "#/components/schemas/OptimumPushDetail"
      },
      "type": "array",
      "title": "Invoices",
      "default": []
     },
     "no_candidates": {
      "type": "boolean",
      "title": "No Candidates",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "attempted"
    ],
    "title": "OptimumTestRunResponse"
   },
   "OptimumUnblockedDocument": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "invoice_number": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Invoice Number"
     },
     "counterparty": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Counterparty"
     }
    },
    "type": "object",
    "required": [
     "invoice_id"
    ],
    "title": "OptimumUnblockedDocument"
   },
   "OptimumUndoRequest": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "maxLength": 64,
      "minLength": 1,
      "title": "Invoice Id"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 50
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     }
    },
    "type": "object",
    "required": [
     "invoice_id"
    ],
    "title": "OptimumUndoRequest"
   },
   "OptimumUndoResponse": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "optimum_document_id": {
      "type": "string",
      "title": "Optimum Document Id"
     },
     "undone": {
      "type": "boolean",
      "title": "Undone",
      "default": true
     },
     "isaf_warning": {
      "type": "boolean",
      "title": "Isaf Warning",
      "default": false
     },
     "isaf_period": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Isaf Period"
     },
     "isaf_deadline": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Isaf Deadline"
     },
     "message": {
      "type": "string",
      "title": "Message"
     }
    },
    "type": "object",
    "required": [
     "invoice_id",
     "optimum_document_id",
     "message"
    ],
    "title": "OptimumUndoResponse"
   },
   "OptimumVatCodeLine": {
    "properties": {
     "code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Code"
     },
     "amount": {
      "type": "number",
      "title": "Amount",
      "default": 0.0
     }
    },
    "type": "object",
    "title": "OptimumVatCodeLine"
   },
   "OptimumVatRateSeen": {
    "properties": {
     "rate": {
      "type": "integer",
      "title": "Rate"
     },
     "invoices": {
      "type": "integer",
      "title": "Invoices"
     }
    },
    "type": "object",
    "required": [
     "rate",
     "invoices"
    ],
    "title": "OptimumVatRateSeen"
   },
   "OptimumVatRatesResponse": {
    "properties": {
     "rates": {
      "items": {
       "$ref": "#/components/schemas/OptimumVatRateSeen"
      },
      "type": "array",
      "title": "Rates",
      "default": []
     },
     "scanned": {
      "type": "integer",
      "title": "Scanned",
      "default": 0
     }
    },
    "type": "object",
    "title": "OptimumVatRatesResponse"
   },
   "PaginatedInvoiceResponse": {
    "properties": {
     "items": {
      "items": {
       "$ref": "#/components/schemas/InvoiceListResponse"
      },
      "type": "array",
      "title": "Items"
     },
     "total": {
      "type": "integer",
      "title": "Total"
     },
     "page": {
      "type": "integer",
      "title": "Page"
     },
     "page_size": {
      "type": "integer",
      "title": "Page Size"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages"
     },
     "next_cursor": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Next Cursor"
     }
    },
    "type": "object",
    "required": [
     "items",
     "total",
     "page",
     "page_size",
     "total_pages"
    ],
    "title": "PaginatedInvoiceResponse"
   },
   "ReconciliationResponse": {
    "properties": {
     "period": {
      "type": "string",
      "title": "Period"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "drive": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Drive"
     },
     "invoices": {
      "additionalProperties": true,
      "type": "object",
      "title": "Invoices"
     },
     "erp": {
      "additionalProperties": true,
      "type": "object",
      "title": "Erp"
     },
     "drive_connected": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Drive Connected"
     }
    },
    "type": "object",
    "required": [
     "period",
     "drive",
     "invoices",
     "erp"
    ],
    "title": "ReconciliationResponse"
   },
   "RegisterRequest": {
    "properties": {
     "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
     },
     "password": {
      "type": "string",
      "maxLength": 128,
      "title": "Password"
     },
     "full_name": {
      "type": "string",
      "maxLength": 255,
      "minLength": 1,
      "title": "Full Name"
     }
    },
    "type": "object",
    "required": [
     "email",
     "password",
     "full_name"
    ],
    "title": "RegisterRequest"
   },
   "ResetPasswordRequest": {
    "properties": {
     "token": {
      "type": "string",
      "title": "Token"
     },
     "new_password": {
      "type": "string",
      "maxLength": 128,
      "title": "New Password"
     }
    },
    "type": "object",
    "required": [
     "token",
     "new_password"
    ],
    "title": "ResetPasswordRequest"
   },
   "ReverseChargeResponse": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "reverse_charge_override": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reverse Charge Override"
     },
     "reverse_charge_suggested": {
      "type": "boolean",
      "title": "Reverse Charge Suggested",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "invoice_id"
    ],
    "title": "ReverseChargeResponse"
   },
   "ReverseChargeUpdateRequest": {
    "properties": {
     "reverse_charge": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reverse Charge"
     }
    },
    "type": "object",
    "title": "ReverseChargeUpdateRequest"
   },
   "RivileErpCard": {
    "properties": {
     "code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Code"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "item_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Item Id"
     },
     "uom_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uom Id"
     },
     "item_type_id": {
      "anyOf": [
       {},
       {
        "type": "null"
       }
      ],
      "title": "Item Type Id"
     },
     "mappable": {
      "type": "boolean",
      "title": "Mappable",
      "default": false
     },
     "account_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Account Code"
     }
    },
    "type": "object",
    "title": "RivileErpCard"
   },
   "RivileErpCardsResponse": {
    "properties": {
     "cards": {
      "items": {
       "$ref": "#/components/schemas/RivileErpCard"
      },
      "type": "array",
      "title": "Cards"
     },
     "cached": {
      "type": "boolean",
      "title": "Cached"
     }
    },
    "type": "object",
    "required": [
     "cards",
     "cached"
    ],
    "title": "RivileErpCardsResponse"
   },
   "RivileErpClientRef": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Code"
     }
    },
    "type": "object",
    "required": [
     "id"
    ],
    "title": "RivileErpClientRef"
   },
   "RivileErpClientsResponse": {
    "properties": {
     "clients": {
      "items": {
       "$ref": "#/components/schemas/RivileErpClientRef"
      },
      "type": "array",
      "title": "Clients"
     },
     "cached": {
      "type": "boolean",
      "title": "Cached",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "clients"
    ],
    "title": "RivileErpClientsResponse"
   },
   "RivileErpCompaniesStatusResponse": {
    "properties": {
     "companies": {
      "items": {
       "$ref": "#/components/schemas/RivileErpCompanyStatus"
      },
      "type": "array",
      "title": "Companies"
     },
     "totals": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Totals"
     }
    },
    "type": "object",
    "required": [
     "companies",
     "totals"
    ],
    "title": "RivileErpCompaniesStatusResponse"
   },
   "RivileErpCompanyStatus": {
    "properties": {
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "own_vat_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Own Vat Code"
     },
     "is_vat_payer": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Is Vat Payer"
     },
     "key_configured": {
      "type": "boolean",
      "title": "Key Configured",
      "default": false
     },
     "key_masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Key Masked"
     },
     "config_enabled": {
      "type": "boolean",
      "title": "Config Enabled",
      "default": false
     },
     "pushed_count": {
      "type": "integer",
      "title": "Pushed Count",
      "default": 0
     },
     "failed_count": {
      "type": "integer",
      "title": "Failed Count",
      "default": 0
     },
     "disabled_count": {
      "type": "integer",
      "title": "Disabled Count",
      "default": 0
     },
     "dismissed_count": {
      "type": "integer",
      "title": "Dismissed Count",
      "default": 0
     },
     "not_sending_count": {
      "type": "integer",
      "title": "Not Sending Count",
      "default": 0
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "erp_system": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp System"
     }
    },
    "type": "object",
    "required": [
     "status"
    ],
    "title": "RivileErpCompanyStatus"
   },
   "RivileErpConfigResponse": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config"
     },
     "is_default": {
      "type": "boolean",
      "title": "Is Default"
     }
    },
    "type": "object",
    "required": [
     "config",
     "is_default"
    ],
    "title": "RivileErpConfigResponse"
   },
   "RivileErpConfigUpdateRequest": {
    "properties": {
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config",
      "description": "RivileErpConfig blob (per-company booking defaults)."
     }
    },
    "type": "object",
    "required": [
     "config"
    ],
    "title": "RivileErpConfigUpdateRequest"
   },
   "RivileErpDiscoverClientsResponse": {
    "properties": {
     "clients": {
      "items": {
       "$ref": "#/components/schemas/RivileErpDiscoveredClient"
      },
      "type": "array",
      "title": "Clients"
     },
     "total_in_erp": {
      "type": "integer",
      "title": "Total In Erp"
     },
     "new_count": {
      "type": "integer",
      "title": "New Count"
     },
     "source_company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Company Code"
     },
     "error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error"
     }
    },
    "type": "object",
    "required": [
     "clients",
     "total_in_erp",
     "new_count"
    ],
    "title": "RivileErpDiscoverClientsResponse"
   },
   "RivileErpDiscoverResponse": {
    "properties": {
     "suggested_config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Suggested Config"
     },
     "products": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Products"
     },
     "sampled_invoices": {
      "type": "integer",
      "title": "Sampled Invoices"
     },
     "sampled_lines": {
      "type": "integer",
      "title": "Sampled Lines"
     }
    },
    "type": "object",
    "required": [
     "suggested_config",
     "products",
     "sampled_invoices",
     "sampled_lines"
    ],
    "title": "RivileErpDiscoverResponse"
   },
   "RivileErpDiscoveredClient": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "company_code": {
      "type": "string",
      "title": "Company Code"
     },
     "vat_code": {
      "type": "string",
      "title": "Vat Code",
      "default": ""
     },
     "email": {
      "type": "string",
      "title": "Email",
      "default": ""
     },
     "already_registered": {
      "type": "boolean",
      "title": "Already Registered",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "name",
     "company_code"
    ],
    "title": "RivileErpDiscoveredClient"
   },
   "RivileErpDismissRequest": {
    "properties": {
     "invoice_ids": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "maxItems": 1000,
      "minItems": 1,
      "title": "Invoice Ids"
     },
     "dismissed": {
      "type": "boolean",
      "title": "Dismissed",
      "default": true
     },
     "note": {
      "anyOf": [
       {
        "type": "string",
        "maxLength": 200
       },
       {
        "type": "null"
       }
      ],
      "title": "Note"
     }
    },
    "type": "object",
    "required": [
     "invoice_ids"
    ],
    "title": "RivileErpDismissRequest"
   },
   "RivileErpDismissResponse": {
    "properties": {
     "dismissed_count": {
      "type": "integer",
      "title": "Dismissed Count"
     },
     "skipped_count": {
      "type": "integer",
      "title": "Skipped Count"
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems"
     }
    },
    "type": "object",
    "required": [
     "dismissed_count",
     "skipped_count",
     "problems"
    ],
    "title": "RivileErpDismissResponse"
   },
   "RivileErpPushRequest": {
    "properties": {
     "invoice_ids": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "maxItems": 1000,
      "minItems": 1,
      "title": "Invoice Ids"
     }
    },
    "type": "object",
    "required": [
     "invoice_ids"
    ],
    "title": "RivileErpPushRequest"
   },
   "RivileErpPushResponse": {
    "properties": {
     "pushed_count": {
      "type": "integer",
      "title": "Pushed Count"
     },
     "skipped_count": {
      "type": "integer",
      "title": "Skipped Count"
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems"
     }
    },
    "type": "object",
    "required": [
     "pushed_count",
     "skipped_count",
     "problems"
    ],
    "title": "RivileErpPushResponse"
   },
   "RivileErpResetPushResponse": {
    "properties": {
     "reset_count": {
      "type": "integer",
      "title": "Reset Count"
     },
     "forgotten": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Forgotten"
     }
    },
    "type": "object",
    "required": [
     "reset_count",
     "forgotten"
    ],
    "title": "RivileErpResetPushResponse"
   },
   "RivileErpSuggestCardMapResponse": {
    "properties": {
     "suggestions": {
      "additionalProperties": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "object",
      "title": "Suggestions"
     },
     "unmatched_gl_codes": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Unmatched Gl Codes"
     },
     "cards_available": {
      "type": "integer",
      "title": "Cards Available"
     },
     "targets_available": {
      "type": "integer",
      "title": "Targets Available"
     }
    },
    "type": "object",
    "required": [
     "suggestions",
     "unmatched_gl_codes",
     "cards_available",
     "targets_available"
    ],
    "title": "RivileErpSuggestCardMapResponse"
   },
   "RivileErpSuggestCardsRequest": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "minLength": 1,
      "title": "Invoice Id"
     },
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "apply": {
      "type": "boolean",
      "title": "Apply",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "invoice_id"
    ],
    "title": "RivileErpSuggestCardsRequest"
   },
   "RivileErpSuggestCardsResponse": {
    "properties": {
     "assignments": {
      "additionalProperties": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "object",
      "title": "Assignments"
     },
     "applied": {
      "type": "boolean",
      "title": "Applied"
     },
     "cards_available": {
      "type": "integer",
      "title": "Cards Available"
     },
     "kept_count": {
      "type": "integer",
      "title": "Kept Count",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "assignments",
     "applied",
     "cards_available"
    ],
    "title": "RivileErpSuggestCardsResponse"
   },
   "SecureAuthResponse": {
    "properties": {
     "user": {
      "$ref": "#/components/schemas/UserResponse"
     },
     "access_token": {
      "type": "string",
      "title": "Access Token"
     },
     "token_type": {
      "type": "string",
      "title": "Token Type",
      "default": "bearer"
     },
     "expires_in": {
      "type": "integer",
      "title": "Expires In"
     }
    },
    "type": "object",
    "required": [
     "user",
     "access_token",
     "expires_in"
    ],
    "title": "SecureAuthResponse"
   },
   "SendMonthRequest": {
    "properties": {
     "month": {
      "anyOf": [
       {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}$"
       },
       {
        "type": "null"
       }
      ],
      "title": "Month"
     }
    },
    "type": "object",
    "title": "SendMonthRequest"
   },
   "SendMonthResponse": {
    "properties": {
     "company_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Company Code"
     },
     "period": {
      "type": "string",
      "title": "Period"
     },
     "sendable": {
      "type": "integer",
      "title": "Sendable"
     },
     "remaining": {
      "type": "integer",
      "title": "Remaining",
      "default": 0
     },
     "pushed_count": {
      "type": "integer",
      "title": "Pushed Count"
     },
     "skipped_count": {
      "type": "integer",
      "title": "Skipped Count"
     },
     "held_count": {
      "type": "integer",
      "title": "Held Count",
      "default": 0
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "period",
     "sendable",
     "pushed_count",
     "skipped_count"
    ],
    "title": "SendMonthResponse"
   },
   "SetDriveKeyRequest": {
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 20000,
      "minLength": 50,
      "title": "Key"
     }
    },
    "type": "object",
    "required": [
     "key"
    ],
    "title": "SetDriveKeyRequest"
   },
   "SetIntegrationKeyRequest": {
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 4096,
      "minLength": 1,
      "title": "Key",
      "description": "The raw API key/token to store (write-only)."
     }
    },
    "type": "object",
    "required": [
     "key"
    ],
    "title": "SetIntegrationKeyRequest"
   },
   "SignedAgreementCreate": {
    "properties": {
     "company_requisites_id": {
      "type": "string",
      "format": "uuid",
      "title": "Company Requisites Id",
      "description": "ID įmonės rekvizitų"
     }
    },
    "type": "object",
    "required": [
     "company_requisites_id"
    ],
    "title": "SignedAgreementCreate"
   },
   "SignedAgreementDetailResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "user_id": {
      "type": "string",
      "format": "uuid",
      "title": "User Id"
     },
     "company_requisites_id": {
      "type": "string",
      "format": "uuid",
      "title": "Company Requisites Id"
     },
     "contract_number": {
      "type": "string",
      "title": "Contract Number"
     },
     "contract_type": {
      "type": "string",
      "title": "Contract Type"
     },
     "generated_contract_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Generated Contract Path"
     },
     "generated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Generated At"
     },
     "signed_contract_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Signed Contract Path"
     },
     "uploaded_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded At"
     },
     "admin_status": {
      "type": "string",
      "title": "Admin Status"
     },
     "admin_reviewed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Admin Reviewed By"
     },
     "admin_reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Admin Reviewed At"
     },
     "admin_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Admin Notes"
     },
     "rejection_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rejection Reason"
     },
     "credit_limit_eur": {
      "type": "string",
      "title": "Credit Limit Eur"
     },
     "price_per_page_eur": {
      "type": "string",
      "title": "Price Per Page Eur"
     },
     "billing_cycle": {
      "type": "string",
      "title": "Billing Cycle"
     },
     "payment_terms_days": {
      "type": "integer",
      "title": "Payment Terms Days"
     },
     "contract_start_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Start Date"
     },
     "contract_end_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract End Date"
     },
     "is_active": {
      "type": "boolean",
      "title": "Is Active"
     },
     "blocked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Blocked At"
     },
     "blocked_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Blocked By"
     },
     "block_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Block Reason"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     },
     "can_upload": {
      "type": "boolean",
      "title": "Can Upload",
      "default": false
     },
     "can_use_service": {
      "type": "boolean",
      "title": "Can Use Service",
      "default": false
     },
     "status_message": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Status Message"
     },
     "company_requisites": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CompanyRequisitesResponse"
       },
       {
        "type": "null"
       }
      ]
     },
     "credit_balance_eur": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Credit Balance Eur"
     },
     "total_usage_eur": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Total Usage Eur"
     }
    },
    "type": "object",
    "required": [
     "id",
     "user_id",
     "company_requisites_id",
     "contract_number",
     "contract_type",
     "admin_status",
     "credit_limit_eur",
     "price_per_page_eur",
     "billing_cycle",
     "payment_terms_days",
     "is_active",
     "created_at",
     "updated_at"
    ],
    "title": "SignedAgreementDetailResponse"
   },
   "SignedAgreementResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "user_id": {
      "type": "string",
      "format": "uuid",
      "title": "User Id"
     },
     "company_requisites_id": {
      "type": "string",
      "format": "uuid",
      "title": "Company Requisites Id"
     },
     "contract_number": {
      "type": "string",
      "title": "Contract Number"
     },
     "contract_type": {
      "type": "string",
      "title": "Contract Type"
     },
     "generated_contract_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Generated Contract Path"
     },
     "generated_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Generated At"
     },
     "signed_contract_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Signed Contract Path"
     },
     "uploaded_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Uploaded At"
     },
     "admin_status": {
      "type": "string",
      "title": "Admin Status"
     },
     "admin_reviewed_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Admin Reviewed By"
     },
     "admin_reviewed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Admin Reviewed At"
     },
     "admin_notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Admin Notes"
     },
     "rejection_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rejection Reason"
     },
     "credit_limit_eur": {
      "type": "string",
      "title": "Credit Limit Eur"
     },
     "price_per_page_eur": {
      "type": "string",
      "title": "Price Per Page Eur"
     },
     "billing_cycle": {
      "type": "string",
      "title": "Billing Cycle"
     },
     "payment_terms_days": {
      "type": "integer",
      "title": "Payment Terms Days"
     },
     "contract_start_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract Start Date"
     },
     "contract_end_date": {
      "anyOf": [
       {
        "type": "string",
        "format": "date"
       },
       {
        "type": "null"
       }
      ],
      "title": "Contract End Date"
     },
     "is_active": {
      "type": "boolean",
      "title": "Is Active"
     },
     "blocked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Blocked At"
     },
     "blocked_by": {
      "anyOf": [
       {
        "type": "string",
        "format": "uuid"
       },
       {
        "type": "null"
       }
      ],
      "title": "Blocked By"
     },
     "block_reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Block Reason"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
     },
     "can_upload": {
      "type": "boolean",
      "title": "Can Upload",
      "default": false
     },
     "can_use_service": {
      "type": "boolean",
      "title": "Can Use Service",
      "default": false
     },
     "status_message": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Status Message"
     }
    },
    "type": "object",
    "required": [
     "id",
     "user_id",
     "company_requisites_id",
     "contract_number",
     "contract_type",
     "admin_status",
     "credit_limit_eur",
     "price_per_page_eur",
     "billing_cycle",
     "payment_terms_days",
     "is_active",
     "created_at",
     "updated_at"
    ],
    "title": "SignedAgreementResponse"
   },
   "TestRunInvoice": {
    "properties": {
     "invoice_id": {
      "type": "string",
      "title": "Invoice Id"
     },
     "filename": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Filename"
     },
     "status": {
      "type": "string",
      "title": "Status"
     },
     "erp_invoice_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Erp Invoice Id"
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems",
      "default": []
     },
     "lines": {
      "items": {
       "$ref": "#/components/schemas/TestRunLine"
      },
      "type": "array",
      "title": "Lines",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "invoice_id",
     "status"
    ],
    "title": "TestRunInvoice"
   },
   "TestRunLine": {
    "properties": {
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "card_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Card Code"
     },
     "card_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Card Name"
     },
     "tax_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tax Code"
     },
     "amount": {
      "anyOf": [
       {},
       {
        "type": "null"
       }
      ],
      "title": "Amount"
     }
    },
    "type": "object",
    "title": "TestRunLine"
   },
   "TestRunResponse": {
    "properties": {
     "attempted": {
      "type": "integer",
      "title": "Attempted"
     },
     "pushed_count": {
      "type": "integer",
      "title": "Pushed Count"
     },
     "skipped_count": {
      "type": "integer",
      "title": "Skipped Count"
     },
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Problems"
     },
     "invoices": {
      "items": {
       "$ref": "#/components/schemas/TestRunInvoice"
      },
      "type": "array",
      "title": "Invoices"
     },
     "no_candidates": {
      "type": "boolean",
      "title": "No Candidates",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "attempted",
     "pushed_count",
     "skipped_count",
     "problems",
     "invoices"
    ],
    "title": "TestRunResponse"
   },
   "TrendBucket": {
    "properties": {
     "date": {
      "type": "string",
      "title": "Date",
      "description": "ISO date (YYYY-MM-DD)"
     },
     "invoice_count": {
      "type": "integer",
      "title": "Invoice Count",
      "description": "Invoices processed that day"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages",
      "description": "Total pages processed that day"
     },
     "confidence_avg": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Confidence Avg",
      "description": "Mean confidence 0-100 (null if no invoices that day)"
     },
     "total_cost": {
      "type": "number",
      "title": "Total Cost",
      "description": "Cost in EUR for that day"
     }
    },
    "type": "object",
    "required": [
     "date",
     "invoice_count",
     "total_pages",
     "total_cost"
    ],
    "title": "TrendBucket"
   },
   "TrendsResponse": {
    "properties": {
     "window_days": {
      "type": "integer",
      "title": "Window Days",
      "description": "Window size in days (7, 30, or 90)"
     },
     "buckets": {
      "items": {
       "$ref": "#/components/schemas/TrendBucket"
      },
      "type": "array",
      "title": "Buckets",
      "description": "One bucket per day in window, oldest first, including zero-volume days"
     },
     "total_invoices": {
      "type": "integer",
      "title": "Total Invoices",
      "description": "Sum of invoice_count across buckets"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages",
      "description": "Sum of total_pages across buckets"
     },
     "total_cost": {
      "type": "number",
      "title": "Total Cost",
      "description": "Sum of total_cost across buckets"
     },
     "confidence_avg": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Confidence Avg",
      "description": "Overall mean confidence across all invoices in window"
     }
    },
    "type": "object",
    "required": [
     "window_days",
     "buckets",
     "total_invoices",
     "total_pages",
     "total_cost"
    ],
    "title": "TrendsResponse"
   },
   "UpdateLanguageRequest": {
    "properties": {
     "language": {
      "type": "string",
      "maxLength": 5,
      "minLength": 2,
      "title": "Language"
     }
    },
    "type": "object",
    "required": [
     "language"
    ],
    "title": "UpdateLanguageRequest"
   },
   "UsageHistoryResponse": {
    "properties": {
     "periods": {
      "items": {
       "$ref": "#/components/schemas/UsagePeriodResponse"
      },
      "type": "array",
      "title": "Periods",
      "description": "List of monthly usage periods"
     },
     "total_pages_all_time": {
      "type": "integer",
      "title": "Total Pages All Time",
      "description": "Total pages across all periods"
     },
     "total_cost_all_time": {
      "type": "number",
      "title": "Total Cost All Time",
      "description": "Total cost across all periods"
     },
     "total_invoices_all_time": {
      "type": "integer",
      "title": "Total Invoices All Time",
      "description": "Total invoices processed across all periods — the billed unit",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "periods",
     "total_pages_all_time",
     "total_cost_all_time"
    ],
    "title": "UsageHistoryResponse"
   },
   "UsagePeriodResponse": {
    "properties": {
     "period_year": {
      "type": "integer",
      "title": "Period Year",
      "description": "Year of the usage period"
     },
     "period_month": {
      "type": "integer",
      "maximum": 12.0,
      "minimum": 1.0,
      "title": "Period Month",
      "description": "Month of the usage period (1-12)"
     },
     "total_pages": {
      "type": "integer",
      "title": "Total Pages",
      "description": "Total pages processed this period"
     },
     "total_invoices": {
      "type": "integer",
      "title": "Total Invoices",
      "description": "Total invoices processed this period"
     },
     "cost_per_page": {
      "type": "number",
      "title": "Cost Per Page",
      "description": "Rate per page in EUR"
     },
     "total_cost": {
      "type": "number",
      "title": "Total Cost",
      "description": "Total cost for the period"
     },
     "total_input_tokens": {
      "type": "integer",
      "title": "Total Input Tokens",
      "description": "Total input tokens used this period",
      "default": 0
     },
     "total_output_tokens": {
      "type": "integer",
      "title": "Total Output Tokens",
      "description": "Total output tokens generated this period",
      "default": 0
     },
     "total_tokens": {
      "type": "integer",
      "title": "Total Tokens",
      "description": "Total tokens used this period",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "period_year",
     "period_month",
     "total_pages",
     "total_invoices",
     "cost_per_page",
     "total_cost"
    ],
    "title": "UsagePeriodResponse"
   },
   "UsageSummaryResponse": {
    "properties": {
     "current_month": {
      "$ref": "#/components/schemas/CurrentMonthUsageResponse",
      "description": "Current month usage"
     },
     "total_pages_all_time": {
      "type": "integer",
      "title": "Total Pages All Time",
      "description": "Total pages processed ever"
     },
     "total_cost_all_time": {
      "type": "number",
      "title": "Total Cost All Time",
      "description": "Total cost incurred ever"
     },
     "months_active": {
      "type": "integer",
      "title": "Months Active",
      "description": "Number of months with activity"
     },
     "total_invoices_all_time": {
      "type": "integer",
      "title": "Total Invoices All Time",
      "description": "Total invoices processed ever — the unit the price is per",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "current_month",
     "total_pages_all_time",
     "total_cost_all_time",
     "months_active"
    ],
    "title": "UsageSummaryResponse",
    "example": {
     "current_month": {
      "cost_per_page": 0.25,
      "period_month": 3,
      "period_year": 2026,
      "total_cost": 37.5,
      "total_invoices": 25,
      "total_pages": 150
     },
     "months_active": 6,
     "total_cost_all_time": 180.0,
     "total_pages_all_time": 1200
    }
   },
   "UserResponse": {
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
     },
     "email": {
      "type": "string",
      "title": "Email"
     },
     "full_name": {
      "type": "string",
      "title": "Full Name"
     },
     "is_active": {
      "type": "boolean",
      "title": "Is Active"
     },
     "email_verified": {
      "type": "boolean",
      "title": "Email Verified",
      "default": false
     },
     "role": {
      "type": "string",
      "title": "Role",
      "default": "user"
     },
     "total_uploaded_files": {
      "type": "integer",
      "title": "Total Uploaded Files",
      "default": 0
     },
     "total_processed_files": {
      "type": "integer",
      "title": "Total Processed Files",
      "default": 0
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "trial_invoices_remaining": {
      "type": "integer",
      "title": "Trial Invoices Remaining",
      "default": 25
     },
     "trial_started_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Trial Started At"
     },
     "agreement_signed_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Agreement Signed At"
     },
     "pricing_tier": {
      "type": "string",
      "title": "Pricing Tier",
      "default": "standard"
     },
     "language": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Language"
     },
     "is_blocked_for_payment": {
      "type": "boolean",
      "title": "Is Blocked For Payment",
      "default": false
     },
     "credit_balance_eur": {
      "type": "number",
      "title": "Credit Balance Eur",
      "default": 0.0
     },
     "upload_max_file_size_mb": {
      "type": "integer",
      "title": "Upload Max File Size Mb",
      "default": 10
     },
     "upload_max_pdf_pages": {
      "type": "integer",
      "title": "Upload Max Pdf Pages",
      "default": 20
     }
    },
    "type": "object",
    "required": [
     "id",
     "email",
     "full_name",
     "is_active",
     "created_at"
    ],
    "title": "UserResponse"
   },
   "UserStatisticsResponse": {
    "properties": {
     "total_uploaded_files": {
      "type": "integer",
      "title": "Total Uploaded Files",
      "description": "Total number of files uploaded by the user"
     },
     "total_processed_files": {
      "type": "integer",
      "title": "Total Processed Files",
      "description": "Total number of files successfully processed"
     },
     "pending_files": {
      "type": "integer",
      "title": "Pending Files",
      "description": "Files currently uploaded but not yet processed"
     },
     "failed_files": {
      "type": "integer",
      "title": "Failed Files",
      "description": "Files that failed during processing"
     },
     "success_rate": {
      "type": "number",
      "title": "Success Rate",
      "description": "Percentage of successfully processed files (0-100)"
     }
    },
    "type": "object",
    "required": [
     "total_uploaded_files",
     "total_processed_files",
     "pending_files",
     "failed_files",
     "success_rate"
    ],
    "title": "UserStatisticsResponse",
    "example": {
     "failed_files": 2,
     "pending_files": 3,
     "success_rate": 80.0,
     "total_processed_files": 20,
     "total_uploaded_files": 25
    }
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     },
     "input": {
      "title": "Input"
     },
     "ctx": {
      "type": "object",
      "title": "Context"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   },
   "VendorCardChoice": {
    "properties": {
     "code": {
      "type": "string",
      "title": "Code"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     }
    },
    "type": "object",
    "required": [
     "code"
    ],
    "title": "VendorCardChoice"
   },
   "VendorCardOption": {
    "properties": {
     "key": {
      "type": "string",
      "title": "Key"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "vat": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Vat"
     },
     "invoice_count": {
      "type": "integer",
      "title": "Invoice Count",
      "default": 0
     },
     "card_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Card Code"
     },
     "source": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source"
     }
    },
    "type": "object",
    "required": [
     "key"
    ],
    "title": "VendorCardOption"
   },
   "VendorCardsRequest": {
    "properties": {
     "rules": {
      "anyOf": [
       {
        "additionalProperties": {
         "type": "string"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rules"
     },
     "by_name": {
      "additionalProperties": {
       "type": "string"
      },
      "type": "object",
      "title": "By Name"
     }
    },
    "type": "object",
    "title": "VendorCardsRequest"
   },
   "VendorCardsResponse": {
    "properties": {
     "vendors": {
      "items": {
       "$ref": "#/components/schemas/VendorCardOption"
      },
      "type": "array",
      "title": "Vendors"
     },
     "cards": {
      "items": {
       "$ref": "#/components/schemas/VendorCardChoice"
      },
      "type": "array",
      "title": "Cards"
     },
     "default_card_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Default Card Code"
     },
     "orphan_rules": {
      "items": {
       "$ref": "#/components/schemas/VendorCardOption"
      },
      "type": "array",
      "title": "Orphan Rules"
     }
    },
    "type": "object",
    "required": [
     "vendors",
     "cards"
    ],
    "title": "VendorCardsResponse"
   },
   "VerifyEmailRequest": {
    "properties": {
     "token": {
      "type": "string",
      "title": "Token"
     }
    },
    "type": "object",
    "required": [
     "token"
    ],
    "title": "VerifyEmailRequest"
   }
  },
  "securitySchemes": {
   "HTTPBearer": {
    "type": "http",
    "scheme": "bearer"
   }
  }
 },
 "x-error-codes": [
  {
   "code": "invalid_token",
   "retryable": false
  },
  {
   "code": "user_inactive",
   "retryable": false
  },
  {
   "code": "api_key_requires_session",
   "retryable": false
  },
  {
   "code": "api_key_limit_reached",
   "retryable": false
  },
  {
   "code": "payment_blocked",
   "retryable": false
  },
  {
   "code": "trial_exhausted",
   "retryable": false
  },
  {
   "code": "insufficient_credits",
   "retryable": false
  },
  {
   "code": "pdf_only",
   "retryable": false
  },
  {
   "code": "invalid_content_type",
   "retryable": false
  },
  {
   "code": "file_too_large",
   "retryable": false
  },
  {
   "code": "invalid_pdf_content",
   "retryable": false
  },
  {
   "code": "invalid_pdf_mime",
   "retryable": false
  },
  {
   "code": "pdf_too_complex",
   "retryable": false
  },
  {
   "code": "too_many_pages",
   "retryable": false
  },
  {
   "code": "too_many_pages_for_sync",
   "retryable": false
  },
  {
   "code": "too_many_files",
   "retryable": false
  },
  {
   "code": "duplicate_invoice",
   "retryable": false
  },
  {
   "code": "file_empty",
   "retryable": false
  },
  {
   "code": "image_unreadable",
   "retryable": false
  },
  {
   "code": "image_too_large",
   "retryable": false
  },
  {
   "code": "heic_unsupported",
   "retryable": false
  },
  {
   "code": "extraction_failed",
   "retryable": false
  },
  {
   "code": "extraction_too_large",
   "retryable": false
  },
  {
   "code": "invalid_external_id",
   "retryable": false
  },
  {
   "code": "external_id_conflict",
   "retryable": false
  },
  {
   "code": "invalid_filter_value",
   "retryable": false
  },
  {
   "code": "invalid_cursor",
   "retryable": false
  },
  {
   "code": "unknown_company",
   "retryable": false
  },
  {
   "code": "invoice_not_found",
   "retryable": false
  },
  {
   "code": "pdf_not_found",
   "retryable": false
  },
  {
   "code": "export_no_invoices",
   "retryable": false
  },
  {
   "code": "export_all_skipped",
   "retryable": false
  },
  {
   "code": "invalid_export_config",
   "retryable": false
  },
  {
   "code": "key_unsendable",
   "retryable": false
  },
  {
   "code": "invoice_save_failed",
   "retryable": true
  },
  {
   "code": "internal_error",
   "retryable": true
  },
  {
   "code": "service_unavailable",
   "retryable": true
  },
  {
   "code": "extraction_internal_error",
   "retryable": true
  }
 ]
}
