{
  "openapi": "3.0.3",
  "info": {
    "version": "2.72.0",
    "title": "Hypatos REST API",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "description": "# Introduction\n\nThe Hypatos API is organized around REST. The majority of the endpoints provide CRUD \nfunctionality for resources. The API is also exposing Intent Resources which mimic user intents \nor actions.\n\nThe Hypatos API uses [OAuth 2.0 Client Credential Grant](https://www.rfc-editor.org/rfc/rfc6749#section-4.4) \nto authenticate requests. Before making any requests to any endpoint a client must authenticate \nwith the authorization server and requests an access token from the [token endpoint](#operation/requestAccessToken). \n\n````sh\n  POST /auth/token HTTP/1.1\n  Host: api.cloud.hypatos.ai\n  Content-Type: application/x-www-form-urlencoded\n  Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=\n\n  grant_type=client_credentials\n````\n\n`Authorization` header contains `client_id:client_secret` encoded as explained in [RFC Client Password section](https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1).\n     \nIf the authorization server authenticated the client successfully, an access token is issued. \nHere is an example successful response:\n\n````sh\n  HTTP/1.1 200 OK\n  Content-Type: application/json;charset=UTF-8\n  Cache-Control: no-store\n  Pragma: no-cache\n\n  {\n    \"access_token\": \"mF_9.B5f-4.1JqM\",\n    \"expires_in\": 86400,\n    \"scope\": \"enrichment.write files.read\",\n    \"token_type\": \"Bearer\",\n  }\n````\nThis token can be used to authenticate the requests to API endpoints by sending a Bearer token \nin the `Authorization` HTTP header. The following example demonstrates how to use the access token \nto retrieve a list of documents.\n\n````sh\n  GET /v2/documents HTTP/1.1\n  Host: api.cloud.hypatos.ai\n  Authorization: Bearer mF_9.B5f-4.1JqM\n````\n\n# Versioning\n\nChanges to this API are released regularly. We use [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) \nscheme for versioning so that the clients can identify any backward-incompatible changes \neasily. Briefly summarized one can say, if the MAJOR version of the new API version didn't \nchange you can expect the new version to be backward-compatible.\n\n# Rate limits\n\nIn order to maximise the stability of our API, we institue rate limits for all of API \nendpoints. Clients who send too many requests over a given period of time will see error \nresponses that show up as status code [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). \n\nWhen you see error responses with status code 429, it means you exhausted your current \nquota and need to withhold from sending further requests until the quota is reset. We \nencourage you not to wait until you get a 429 error but to monitor your quota in each \nrequest. In each response you receive from the API, you will find HTTP headers providing \nthe details about your current quota. Here is the list of the HTTP headers:\n\n* `x-ratelimit-limit`: Indicates the quota associated to the client in the \ncurrent time-window followed by the description of the quota policy.\n* `x-ratelimit-remaining`: Indicates the number of remaining requests in the current \ntime-window\n* `x-ratelimit-reset`: Indicates the number of seconds until quota reset of the current \ntime-window\n\nPlease note that IETF is currently in the process of publishing a standard for these \nheaders. Please explore the [draft](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/) \nfor more details.\n\nA basic technique to gracefully handle rate limits is watch for your quota permanently \nand increase the time between your request as the quota is decreasing. To recover from a \n429 error you need a retry mechanism following an exponential backoff schedule.\n"
  },
  "servers": [
    {
      "description": "API EU",
      "url": "https://api.cloud.hypatos.ai/v2"
    },
    {
      "description": "API US",
      "url": "https://api.cloud.hypatos.com/v2"
    }
  ],
  "tags": [
    {
      "name": "Authorization",
      "description": "Endpoints for handling the [OAuth 2.0 Client Credentials Grant](https://www.rfc-editor.org/rfc/rfc6749#section-4.4) flow."
    },
    {
      "name": "Files",
      "description": "Endpoints for management of files\n"
    },
    {
      "name": "Documents",
      "description": "Endpoints for document management"
    },
    {
      "name": "Cases",
      "description": "Endpoints for case management"
    },
    {
      "name": "Enrichment",
      "description": "Endpoints for data enrichment"
    },
    {
      "name": "Companies",
      "description": "Endpoints for company management"
    },
    {
      "name": "Projects",
      "description": "Endpoints for project management"
    },
    {
      "name": "E-Invoices",
      "description": "Endpoints for e-invoices"
    },
    {
      "name": "Documents XML",
      "description": "Endpoints serving project-scoped documents as XML"
    },
    {
      "name": "Agent Management",
      "description": "Endpoints for managing agents and agent workflows"
    }
  ],
  "paths": {
    "/auth/token": {
      "post": {
        "tags": [
          "Authorization"
        ],
        "summary": "Request an access token",
        "operationId": "requestAccessToken",
        "description": "Request an access token using your client credentials",
        "security": [
          {
            "Basic": []
          }
        ],
        "responses": {
          "200": {
            "description": "Access token provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTokenResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid Client Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "detail": "The provided client credentials are not valid",
                  "status": 401,
                  "title": "Invalid client credentials"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/AccessTokenRequest"
              }
            }
          },
          "description": "Access token request"
        }
      }
    },
    "/files": {
      "post": {
        "summary": "Upload a file",
        "operationId": "uploadFile",
        "description": "This endpoint allows a client to upload a binary file. The `id` returned in the\nresponse represents the file in Hypatos systems. It can be used in other endpoints,\nfor example to initiate processing of the file to create a document holding captured\ndata, or to include the file in a case.\n",
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "curl",
            "source": "curl -i -X POST https://api.cloud.hypatos.ai/v2/files \\\n  -H \"Authorization: Bearer <YOUR_TOKEN_HERE>\" \\\n  -H \"Content-Type: application/pdf\" \\\n  -H \"X-Hy-Filename: invoice.pdf\" \\\n  --data-binary @/path/to/your/document.pdf\n"
          }
        ],
        "tags": [
          "Files"
        ],
        "security": [
          {
            "OAuth2": [
              "files.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Hy-Filename",
            "description": "Optional name of the file to be stored along with the content.",
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          }
        ],
        "requestBody": {
          "description": "Payload of the file",
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "image/jpeg": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "image/png": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "image/tiff": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "text/csv": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            },
            "text/html": {
              "schema": {
                "$ref": "#/components/schemas/BinaryFile"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "File uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Content type is not supported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "detail": "The provided content type is not supported",
                  "status": 400,
                  "title": "Content type not supported"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/files/{id}": {
      "get": {
        "summary": "Download a file by id",
        "operationId": "retrieveFile",
        "description": "Download the content of a file with the given identifier.\n",
        "tags": [
          "Files"
        ],
        "security": [
          {
            "OAuth2": [
              "files.read"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "File id to download"
          }
        ],
        "responses": {
          "200": {
            "description": "Binary content of a file",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "image/jpeg": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "image/png": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "image/tiff": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              },
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/BinaryFile"
                }
              }
            },
            "headers": {
              "X-Hy-Filename": {
                "description": "If a filename was provided during the file upload via the `X-Hy-Filename` request header, it will be returned in this header.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No file with given identifier exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "detail": "File with given identifier does not exist",
                  "status": 404,
                  "title": "File not found"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents": {
      "get": {
        "summary": "Retrieve a list of documents",
        "operationId": "documentsList",
        "description": "Retrieve a list of documents.",
        "security": [
          {
            "OAuth2": [
              "documents.read"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/projectId"
          },
          {
            "$ref": "#/components/parameters/pagingOffset"
          },
          {
            "$ref": "#/components/parameters/parameters-pagingLimit"
          },
          {
            "$ref": "#/components/parameters/sortByCreatedAtUpdatedAt"
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/DocumentState"
              }
            },
            "style": "form",
            "explode": true,
            "required": false,
            "description": "Used to retrieve documents that are in specific states only. Multiple states can be used for this filtering. By default, documents in all states are returned."
          },
          {
            "in": "query",
            "name": "fileId",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "File identifier to retrieve documents that were created from that file"
          },
          {
            "in": "query",
            "name": "caseId",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Case identifier to retrieve documents that were created for that case."
          }
        ],
        "responses": {
          "200": {
            "description": "List of documents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentsListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "InvalidProjectId": {
                    "value": {
                      "detail": "One of the given project identifier provided as projectId query parameter is invalid",
                      "status": 400,
                      "title": "Provided project identifier is invalid"
                    }
                  },
                  "OffsetOutOfRange": {
                    "value": {
                      "detail": "The provided offset is out of range",
                      "status": 400,
                      "title": "Offset out of range"
                    }
                  },
                  "LimitOutOfRange": {
                    "value": {
                      "detail": "Limit is out of range",
                      "status": 400,
                      "title": "Limit out of range"
                    }
                  },
                  "InvalidSortDefinition": {
                    "value": {
                      "detail": "Limit is out of range",
                      "status": 400,
                      "title": "Limit out of range"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/process-file": {
      "post": {
        "summary": "Request processing of a file",
        "operationId": "processFileIntoDocument",
        "description": "Request a processing of a file that was previously uploaded. \nThe `fileId` in the request body is representing the identifier of the file that was returned by the upload endpoint. \nAs a result of this request a document will be created and its identifier will be returned in the response.\nThe `projectId` in the request body is an identifier of the project to create the document in.\n",
        "security": [
          {
            "OAuth2": [
              "documents.write"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "requestBody": {
          "description": "Payload for processing the given file",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessFileRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Processing accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessingAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/{id}": {
      "get": {
        "summary": "Retrieve a document by id",
        "operationId": "documentsGetById",
        "description": "Retrieve a document by id",
        "security": [
          {
            "OAuth2": [
              "documents.read"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the document to get."
          }
        ],
        "responses": {
          "200": {
            "description": "Document retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResponse"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/{id}/transfer": {
      "post": {
        "summary": "Provide information about a transfer of a document to the target system",
        "operationId": "documentsUpdateTransfer",
        "description": "Update information about the transfer for the given document",
        "security": [
          {
            "OAuth2": [
              "documents.write"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of of the document to update."
          }
        ],
        "requestBody": {
          "description": "Payload about the transfer",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsUpdateTransferRequest"
              },
              "examples": {
                "success": {
                  "summary": "Transferred  successfully",
                  "value": {
                    "successful": true
                  }
                },
                "failure": {
                  "summary": "Transfer  failed",
                  "value": {
                    "successful": false,
                    "message": "Upload failed due to ERP being down"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Document transfer infor accepted"
          },
          "400": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/{id}/reject": {
      "post": {
        "summary": "Provide information about the rejection of a document in the target system",
        "operationId": "documentsUpdateReject",
        "description": "Update information about the rejection for the given document",
        "security": [
          {
            "OAuth2": [
              "documents.write"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of of the document to update."
          }
        ],
        "requestBody": {
          "description": "Payload about the rejection",
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsUpdateRejectionRequest"
              },
              "examples": {
                "success": {
                  "summary": "Rejected  successfully",
                  "value": {
                    "message": "Document was rejected!"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Document rejection request accepted"
          },
          "400": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/{id}/external-data": {
      "post": {
        "summary": "Provide external data for a document with given id",
        "operationId": "documentUpdateExternalData",
        "description": "Update the external data for a document with given identifier. The external data are provided as a flat JSON object. The payload of this requests completley overrides the existing external data of a document. To remove the data, justsend empty JSON object `{}` in the payload.\n\nPlease note that the maximum lenght of an key is 50 characters. Any value with a longer key will be omitted. The maximum amount of key-value pairs is limited to 20.\n",
        "tags": [
          "Documents"
        ],
        "security": [
          {
            "OAuth2": [
              "documents.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the document to update."
          }
        ],
        "requestBody": {
          "description": "Payload containing the external data.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsUpdateExternalDataRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "External data provided for the document accepted."
          },
          "400": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/{id}/external-id": {
      "post": {
        "summary": "Provide an external identifier for a document with given id",
        "operationId": "documentsUpdateExternalId",
        "description": "Provide an external identifier for a document with given id",
        "security": [
          {
            "OAuth2": [
              "documents.write"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the document to update."
          }
        ],
        "requestBody": {
          "description": "Update external id for a given document.",
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsUpdateExternalIdRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "External ID provided for the document accepted."
          },
          "400": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/{id}/title": {
      "post": {
        "summary": "Provide a title for a document with given id",
        "operationId": "documentsUpdateTitle",
        "description": "Provide a title for a document with given id.",
        "security": [
          {
            "OAuth2": [
              "documents.write"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the document to update."
          }
        ],
        "requestBody": {
          "description": "Title for a given document.",
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "$ref": "#/components/schemas/DocumentsUpdateTitleRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Document title provided for the document accepted."
          },
          "400": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/documents/{id}/states": {
      "get": {
        "summary": "Retrieve document states",
        "operationId": "retrieveDocumentStates",
        "description": "Provides a list of states that the specified document has passed through. If the document is still being processed, the number of returned states should not be considered final. Subsequent calls to this endpoint may return additional states as the document continues to progress through the processing pipeline.",
        "security": [
          {
            "OAuth2": [
              "documents.read"
            ]
          }
        ],
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the document to get states of."
          }
        ],
        "responses": {
          "200": {
            "description": "Document states.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentStatesResponse"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/DocumentErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/cases/process-file-batch": {
      "post": {
        "summary": "Request processing of a file batch into cases",
        "operationId": "processFileBatchIntoCases",
        "description": "Request processing of a batch of files that were previously uploaded.\nThe `fileIds` in the request body represent the identifiers of the files\nreturned by the upload endpoint.\n\nThis is an asynchronous operation. A successful response confirms that the\nrequest has been accepted; the actual case creation is carried out in the\nbackground by AI Agents that analyze the file batch to determine which files\nbelong to which case and what role each file plays. Use the returned\n`fileBatchId` to track the resulting cases via `GET /cases`.\n\nThe `projectId` in the request body is the identifier of the project in\nwhich the cases will be created.\n\nThe optional `externalId` and `externalData` fields will be associated with\nboth the file batch and propagated to each case created from it.\n",
        "security": [
          {
            "OAuth2": [
              "cases.write"
            ]
          }
        ],
        "tags": [
          "Cases"
        ],
        "requestBody": {
          "description": "Payload for processing the given file batch",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessFileBatchRequest"
              },
              "examples": {
                "basic": {
                  "summary": "Basic file batch processing request",
                  "value": {
                    "fileIds": [
                      "bf105800-594d-48df-a5df-4d9d0554708d",
                      "3efd83f6-5009-4f9f-bc0c-4891c9a44e06"
                    ],
                    "projectId": "69bbd0fbf8dbeab5f8db7675"
                  }
                },
                "withExternalData": {
                  "summary": "Request with external id and data",
                  "value": {
                    "fileIds": [
                      "bf105800-594d-48df-a5df-4d9d0554708d",
                      "3efd83f6-5009-4f9f-bc0c-4891c9a44e06"
                    ],
                    "projectId": "69bbd0fbf8dbeab5f8db7675",
                    "externalId": "batch-0001",
                    "externalData": {
                      "internalSystemId": "sap-01"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "File batch processing request accepted. Cases will be created asynchronously.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessFileBatchAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "422": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/cases/create": {
      "post": {
        "summary": "Create a case manually",
        "operationId": "createCase",
        "description": "Manually create a case from a list of previously uploaded files. Each file\nin the request must be accompanied by a `type` indicating the role the file\nplays in the case (e.g. main document, attachment).\n\nThis is the manual case creation path, intended for API clients that\ndetermine case composition directly, as opposed to the AI-driven case\ncreation triggered by `POST /cases/process-file-batch`.\n\nThis is an asynchronous operation. A successful response confirms that the\nrequest has been accepted and returns the identifier of the case being\ncreated. The case will be processed in the background.\n\nThe `projectId` in the request body is the identifier of the project in\nwhich the case will be created.\n",
        "security": [
          {
            "OAuth2": [
              "cases.write"
            ]
          }
        ],
        "tags": [
          "Cases"
        ],
        "requestBody": {
          "description": "Payload for creating a case",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCaseRequest"
              },
              "examples": {
                "basic": {
                  "summary": "Basic case creation request",
                  "value": {
                    "files": [
                      {
                        "id": "92b5be52-ce1e-4c74-b1ba-b6897c5d447a",
                        "type": "salesOrder",
                        "mainFile": true
                      },
                      {
                        "id": "76bf4146-3ab2-4a8b-8c93-081f1de780b7",
                        "type": "attachment",
                        "mainFile": false
                      }
                    ],
                    "projectId": "69bbd13093eba3eee76f3918"
                  }
                },
                "withExternalData": {
                  "summary": "Request with external id and data",
                  "value": {
                    "files": [
                      {
                        "id": "92b5be52-ce1e-4c74-b1ba-b6897c5d447a",
                        "type": "salesOrder",
                        "mainFile": true
                      },
                      {
                        "id": "76bf4146-3ab2-4a8b-8c93-081f1de780b7",
                        "type": "attachment",
                        "mainFile": false
                      }
                    ],
                    "projectId": "69bbd13093eba3eee76f3918",
                    "externalId": "case-0001",
                    "externalData": {
                      "internalSystemId": "sap-01"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Case creation request accepted. The case will be created asynchronously.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCaseAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "422": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/cases": {
      "get": {
        "summary": "Retrieve a list of cases",
        "operationId": "casesList",
        "description": "Retrieve a list of cases.",
        "security": [
          {
            "OAuth2": [
              "cases.read"
            ]
          }
        ],
        "tags": [
          "Cases"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "projectIds",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": false,
            "required": false,
            "description": "Used to retrieve cases belonging to specific projects only. Multiple project identifiers can be provided. By default, cases from all accessible projects are returned."
          },
          {
            "$ref": "#/components/parameters/pagingOffset"
          },
          {
            "$ref": "#/components/parameters/parameters-pagingLimit"
          },
          {
            "$ref": "#/components/parameters/sortByCreatedAtUpdatedAt"
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/CaseState"
              }
            },
            "style": "form",
            "explode": true,
            "required": false,
            "description": "Used to retrieve cases that are in specific states only. Multiple states can be used for this filtering. By default, cases in all states are returned."
          },
          {
            "in": "query",
            "name": "fileBatchId",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "File batch identifier to retrieve cases that were created from that file batch."
          }
        ],
        "responses": {
          "200": {
            "description": "List of cases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CasesListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "InvalidProjectId": {
                    "value": {
                      "detail": "One of the given project identifiers provided as projectId query parameter is invalid",
                      "status": 400,
                      "title": "Provided project identifier is invalid"
                    }
                  },
                  "OffsetOutOfRange": {
                    "value": {
                      "detail": "The provided offset is out of range",
                      "status": 400,
                      "title": "Offset out of range"
                    }
                  },
                  "LimitOutOfRange": {
                    "value": {
                      "detail": "Limit is out of range",
                      "status": 400,
                      "title": "Limit out of range"
                    }
                  },
                  "InvalidSortDefinition": {
                    "value": {
                      "detail": "The provided sort definition is invalid",
                      "status": 400,
                      "title": "Invalid sort definition"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/cases/{id}": {
      "get": {
        "summary": "Retrieve a case by id",
        "operationId": "casesGetById",
        "description": "Retrieve a case by id.",
        "security": [
          {
            "OAuth2": [
              "cases.read"
            ]
          }
        ],
        "tags": [
          "Cases"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the case to get.",
            "example": "d43447fc-4e23-42e2-86cc-b35e16fa5e6f"
          }
        ],
        "responses": {
          "200": {
            "description": "Case retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseResponse"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/cases/{id}/transfer": {
      "post": {
        "summary": "Provide information about a transfer of a case to the target system",
        "operationId": "casesUpdateTransfer",
        "description": "Update information about the transfer for the given case.",
        "security": [
          {
            "OAuth2": [
              "cases.write"
            ]
          }
        ],
        "tags": [
          "Cases"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the case to update."
          }
        ],
        "requestBody": {
          "description": "Payload about the transfer",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CasesUpdateTransferRequest"
              },
              "examples": {
                "success": {
                  "summary": "Transferred successfully",
                  "value": {
                    "successful": true
                  }
                },
                "failure": {
                  "summary": "Transfer failed",
                  "value": {
                    "successful": false,
                    "message": "Upload failed due to ERP being down"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Case transfer info accepted"
          },
          "400": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/cases/{id}/files": {
      "get": {
        "summary": "Download files of a case",
        "operationId": "caseFilesDownload",
        "description": "Download the files that are part of a case. The response format is determined\nby the `Accept` header:\n\n- `multipart/mixed` — returns all files as a multipart response, where each\n  part contains the binary content of a file with its own `Content-Type` and\n  `Content-Disposition` headers. This allows the client to iterate over the\n  parts and attach each file individually to a workflow without any unzipping.\n\n- `application/zip` — returns all files packaged as a ZIP archive. Each file\n  is stored under its original filename as provided during upload. Use this if\n  your HTTP client does not support multipart response parsing.\n\nThe files returned can be filtered by their `mainFile` flag or by their `type`\nusing the query parameters below. If no filters are provided, all files of the\ncase are returned.\n",
        "security": [
          {
            "OAuth2": [
              "cases.read"
            ]
          }
        ],
        "tags": [
          "Cases"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the case whose files should be downloaded."
          },
          {
            "in": "query",
            "name": "mainFile",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "If set to `true`, only the main file of the case is returned. If set to `false`, only non-main files are returned. If omitted, all files are returned regardless of their main file flag."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-zA-Z]+$"
              }
            },
            "style": "form",
            "explode": true,
            "required": false,
            "description": "Used to retrieve only files of specific types. Multiple types can be provided. If omitted, files of all types are returned."
          }
        ],
        "responses": {
          "200": {
            "description": "Files of the case.",
            "headers": {
              "Content-Disposition": {
                "description": "For `application/zip` responses, suggests a filename for the downloaded archive\nin the format `case-{id}-files.zip`.\n",
                "schema": {
                  "type": "string",
                  "example": "attachment; filename=\"case-6040dc9680b782b365ea77d5-files.zip\""
                }
              }
            },
            "content": {
              "multipart/mixed": {
                "schema": {
                  "type": "object",
                  "description": "A multipart response where each part corresponds to one file of the case.\nEach part contains the binary content of the file and the following headers:\n- `Content-Type`: the media type of the file (e.g. `application/pdf`, `image/jpeg`)\n- `Content-Disposition`: contains the filename of the file\n- `X-Hy-File-Id`: the identifier of the file\n- `X-Hy-File-Type`: the type of the file as defined in the case\n- `X-Hy-File-Main`: `true` if this is the main file of the case, `false` otherwise\n"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "A ZIP archive containing all matching files of the case, each stored under its original filename."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/CaseErrorResponse"
          },
          "406": {
            "description": "The requested response format specified in the Accept header is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "detail": "The requested response format is not supported. Supported formats are multipart/mixed and application/zip.",
                  "status": 406,
                  "title": "Response format not supported"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/invoices": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert invoice including invoice lines",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "operationId": "insertInvoice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/invoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/invoices/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update invoice",
        "operationId": "patchInvoice",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/invoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete invoice",
        "operationId": "deleteInvoice",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "lineNumber",
            "description": "Line number of one of the line numbers inside the Invoice.\nOptional, omitting means the whole Invoice is deleted.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/companies": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert company",
        "operationId": "insertCompany",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/company"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/companies/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update company",
        "operationId": "patchCompany",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/company"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/company"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete company",
        "operationId": "deleteCompany",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/suppliers": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert supplier including related subsidiaries",
        "operationId": "insertSupplier",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/supplier"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/suppliers/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update supplier",
        "operationId": "patchSupplier",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/supplier"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/supplier"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete supplier",
        "operationId": "deleteSupplier",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/purchase-orders": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert purchase order including purchase order lines",
        "operationId": "insertPurchaseOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/purchaseOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/purchase-orders/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update purchase order",
        "operationId": "patchPurchaseOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/purchaseOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/purchaseOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete purchase Order",
        "operationId": "deletePurchaseOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "lineNumber",
            "description": "Line number of one of the line numbers inside the PO.\nOptional, omitting means the whole PO is deleted.\n",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/gl-accounts": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert general ledger account",
        "operationId": "insertGLAccount",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/glAccount"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/gl-accounts/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update general ledger account",
        "operationId": "patchGLAccount",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/glAccount"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/glAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete general ledger account",
        "operationId": "deleteGlAccount",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/cost-centers": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert cost center",
        "operationId": "insertCostCenter",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/costCenter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/cost-centers/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update cost center",
        "operationId": "patchCostCenter",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/costCenter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/costCenter"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete cost Center",
        "operationId": "deleteCostCenter",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/approvers": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert approver",
        "operationId": "insertApprover",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/approver"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/approvers/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update approver",
        "operationId": "patchApprover",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/approver"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/approver"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete approver",
        "operationId": "deleteApprover",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/customers": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert customer",
        "operationId": "insertCustomer",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/customer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/customers/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update customer",
        "operationId": "patchCustomer",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/customer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete customer",
        "operationId": "deleteCustomer",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/lookup-tables/{type}": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert data row to lookup table",
        "operationId": "insertLookupTableRow",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "description": "type of data being sent",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/lookup-table-row"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/lookup-tables/{type}/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update data row in lookup table",
        "operationId": "patchLookupTableRow",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "description": "type of data being updated",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/lookup-table-row"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lookup-table-row"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete data row in lookup table",
        "operationId": "deleteLookupTableRow",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "description": "type of data from which we should delete the row",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/contracts": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert contract",
        "operationId": "insertContract",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/contract"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/contracts/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update contract",
        "operationId": "patchContract",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/contract"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contract"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete contract",
        "operationId": "deleteContract",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/sales-orders": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert sales order",
        "operationId": "insertSalesOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/salesOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/sales-orders/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update sales order",
        "operationId": "patchSalesOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/salesOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/salesOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete sales order",
        "operationId": "deleteSalesOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/products": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert product",
        "operationId": "insertProduct",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/product"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/products/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update product",
        "operationId": "patchProduct",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/product"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/product"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete product",
        "operationId": "deleteProduct",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/customer-products": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert customer product",
        "operationId": "insertCustomerProduct",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/customerProduct"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/customer-products/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update customer product",
        "operationId": "patchCustomerProduct",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/customerProduct"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customerProduct"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete customer product",
        "operationId": "deleteCustomerProduct",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/addresses": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert address",
        "operationId": "insertAddress",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/address"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/addresses/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update address",
        "operationId": "patchAddress",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/address"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/address"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete address",
        "operationId": "deleteAddress",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/quotes": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert quotes",
        "operationId": "insertQuotes",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/quote"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/quotes/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update quote",
        "operationId": "patchQuotes",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/quote"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete quote",
        "operationId": "deleteQuotes",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/goods-receipts": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert Goods Receipt",
        "operationId": "insertGoodsReceipts",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/goodsReceipt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/goods-receipts/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update Goods Receipt",
        "operationId": "patchGoodsReceipt",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/goodsReceipt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/goodsReceipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete Goods Receipt",
        "operationId": "deleteGoodsReceipt",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/profit-centers": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert Profit Center",
        "operationId": "insertProfitCenter",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/profitCenter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/profit-centers/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update Profit Center",
        "operationId": "patchProfitCenter",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/profitCenter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/profitCenter"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete Profit Center",
        "operationId": "deleteProfitCenter",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/internal-orders": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert Internal Order",
        "operationId": "insertInternalOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/internalOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/internal-orders/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update Internal Order",
        "operationId": "patchInternalOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/internalOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/internalOrder"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete Internal Order",
        "operationId": "deleteInternalOrder",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/projects": {
      "post": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Insert Project",
        "operationId": "insertProject",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/project"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/successfullyInserted"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment/projects/{externalId}": {
      "patch": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Partially update Project",
        "operationId": "patchProject",
        "security": [
          {
            "OAuth2": [
              "enrichment.write"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/project"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/project"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/validationError"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "415": {
            "$ref": "#/components/responses/unsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment"
        ],
        "summary": "Delete Project",
        "operationId": "deleteProject",
        "security": [
          {
            "OAuth2": [
              "enrichment.delete"
            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "externalId",
            "description": "Previously sent `externalId`",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully deleted"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/companies/{id}": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Retrieve a company by id",
        "operationId": "companiesGetById",
        "security": [
          {
            "OAuth2": [
              "companies.read"
            ]
          }
        ],
        "parameters": [
          {
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CompaniesId"
            },
            "name": "id",
            "in": "path",
            "description": "Id of the company to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompaniesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 400,
                  "title": "Invalid company ID",
                  "detail": "Error details"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Company does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        }
      }
    },
    "/companies": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Retrieve a list of companies",
        "description": "Note: For now pagination is not implemented",
        "operationId": "companiesList",
        "security": [
          {
            "OAuth2": [
              "companies.read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompaniesListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/projects": {
      "post": {
        "summary": "Create a project",
        "operationId": "projectsCreate",
        "description": "Creates a project based on the request.\n\nOnly the `google` and `internal` OCR engines can be used when creating a project.\n",
        "security": [
          {
            "OAuth2": [
              "projects.write"
            ]
          }
        ],
        "tags": [
          "Projects"
        ],
        "requestBody": {
          "description": "Project data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Project created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ProjectClientBadRequestErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundErrorResponse"
          },
          "422": {
            "$ref": "#/components/responses/ProjectRequestValidationErrorResponse"
          }
        }
      },
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "Retrieve a projects list for given search criteria",
        "operationId": "projectsList",
        "parameters": [
          {
            "$ref": "#/components/parameters/pagingOffset"
          },
          {
            "$ref": "#/components/parameters/parameters-pagingLimit"
          },
          {
            "$ref": "#/components/parameters/sortByCreatedAt"
          },
          {
            "$ref": "#/components/parameters/isLive"
          },
          {
            "required": false,
            "schema": {
              "title": "Search text used to find projects.",
              "type": "string",
              "description": "Search text is used against projects name and id"
            },
            "name": "search",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Projects list retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenErrorResponse"
          },
          "422": {
            "$ref": "#/components/responses/ProjectRequestValidationErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerErrorResponse"
          }
        },
        "security": [
          {
            "OAuth2": [
              "projects.read"
            ]
          }
        ]
      }
    },
    "/projects/{id}": {
      "get": {
        "summary": "Retrieve a project by id",
        "operationId": "projectsGetById",
        "description": "Retrieve a project by id",
        "security": [
          {
            "OAuth2": [
              "projects.read"
            ]
          }
        ],
        "tags": [
          "Projects"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "Project by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundErrorResponse"
          }
        }
      },
      "patch": {
        "summary": "Update a project",
        "operationId": "projectsUpdate",
        "description": "Update a project by id. This endpoint supports partial updates using PATCH semantics:\n- Only fields present in the request will be updated\n- Null values will clear optional fields (note, retentionDays)\n- Absent fields will remain unchanged\n- Required fields (name, extractionModelId, ocr, completion, duplicates, isLive, members, schema) cannot be set to null\n- At least one field must be provided in the request\n\nOnly the `google` and `internal` OCR engines can be set. A project that currently\nuses `abbyy` or `chinese` can still be updated, but the `ocr` property must be\nomitted from the request — sending the project's existing `ocr` block back\nunchanged is rejected with a `422`.\n",
        "security": [
          {
            "OAuth2": [
              "projects.write"
            ]
          }
        ],
        "tags": [
          "Projects"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          }
        ],
        "requestBody": {
          "description": "Project update data (all fields optional for partial update)",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ProjectClientBadRequestErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundErrorResponse"
          },
          "422": {
            "$ref": "#/components/responses/ProjectRequestValidationErrorResponse"
          }
        }
      }
    },
    "/projects/{id}/schema": {
      "get": {
        "summary": "Retrieve a schema by project id",
        "operationId": "schemasGetByProjectId",
        "description": "Retrieve a schema by project id",
        "security": [
          {
            "OAuth2": [
              "projects.read"
            ]
          }
        ],
        "tags": [
          "Projects"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdPathParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "Schema retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schema"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SchemaClientBadRequestErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundErrorResponse"
          }
        }
      }
    },
    "/emails/{id}/content": {
      "get": {
        "tags": [
          "Emails"
        ],
        "summary": "Retrieve an email merged content for given document ID",
        "operationId": "emailsContentGetByDocumentId",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Document identifier",
              "type": "string"
            },
            "example": "6295dcd39db1ab740c3e296c",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Emails information does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "emails.read"
            ]
          }
        ]
      }
    },
    "/emails/{id}": {
      "get": {
        "tags": [
          "Emails"
        ],
        "summary": "Retrieve an email metadata for given document ID",
        "operationId": "emailsMetadataGetByDocumentId",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Document identifier",
              "type": "string"
            },
            "example": "6295dcd39db1ab740c3e296c",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Emails information does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "emails.read"
            ]
          }
        ]
      }
    },
    "/emails/{id}/eml": {
      "get": {
        "tags": [
          "Emails"
        ],
        "summary": "Retrieve an email eml content for given document ID",
        "operationId": "emailsEmlGetByDocumentId",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "Document identifier",
              "type": "string"
            },
            "example": "6295dcd39db1ab740c3e296c",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Emails information does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "emails.read"
            ]
          }
        ]
      }
    },
    "/routings/{id}": {
      "get": {
        "tags": [
          "Document Routing"
        ],
        "summary": "Retrieve document routing with given id",
        "operationId": "routingsGetById",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Routing identifier",
              "example": "6295dcd39db1ab740c3e296c"
            },
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 400,
                  "title": "Routing project does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Document routing does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 422,
                  "title": "Request validation error",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "routings.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Document Routing"
        ],
        "summary": "Update document routing",
        "operationId": "routingsUpdate",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Routing identifier"
            },
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoutingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 400,
                  "title": "Routing project does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Document routing does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 422,
                  "title": "Request validation error",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "routings.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Document Routing"
        ],
        "summary": "Delete document routing",
        "operationId": "routingsDelete",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Routing identifier 6295dcd39db1ab740c3e296c"
            },
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 400,
                  "title": "Routing project does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Document routing does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 422,
                  "title": "Request validation error",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "routings.write"
            ]
          }
        ]
      }
    },
    "/routings": {
      "get": {
        "tags": [
          "Document Routing"
        ],
        "summary": "Retrieve document routings list",
        "operationId": "routingsList",
        "parameters": [
          {
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "title": "The limit used for this page of results.",
              "default": 20
            },
            "name": "limit",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "title": "The offset used for this page of results.",
              "default": 0
            },
            "name": "offset",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutingListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 400,
                  "title": "Routing project does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Document routing does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 422,
                  "title": "Request validation error",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "routings.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Document Routing"
        ],
        "summary": "Create document routing",
        "operationId": "routingsCreate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoutingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 400,
                  "title": "Routing project does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Document routing does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 422,
                  "title": "Request validation error",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "routings.write"
            ]
          }
        ]
      }
    },
    "/routings/{id}/order": {
      "post": {
        "tags": [
          "Document Routing"
        ],
        "summary": "Change document routing order",
        "operationId": "routingsOrder",
        "parameters": [
          {
            "required": true,
            "schema": {
              "type": "string",
              "title": "Routing identifier 6295dcd39db1ab740c3e296c"
            },
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutingOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 400,
                  "title": "Routing project does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "Document routing does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 422,
                  "title": "Request validation error",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "routings.write"
            ]
          }
        ]
      }
    },
    "/enrichment-workflows": {
      "get": {
        "tags": [
          "Enrichment workflows"
        ],
        "summary": "Get all enrichment workflow definitions",
        "operationId": "getAllWorkflowDefinitions",
        "security": [
          {
            "OAuth2": [
              "enrichment-workflows.read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PagingOffset"
          },
          {
            "$ref": "#/components/parameters/PagingLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDefinitionsListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "post": {
        "tags": [
          "Enrichment workflows"
        ],
        "summary": "Create enrichment workflow definition",
        "operationId": "createWorkflowDefinition",
        "security": [
          {
            "OAuth2": [
              "enrichment-workflows.write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowDefinitionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Workflow definition created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDefinition"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment-workflows/{workflowId}": {
      "get": {
        "tags": [
          "Enrichment workflows"
        ],
        "summary": "Get enrichment workflow definition by ID",
        "operationId": "getWorkflowDefinition",
        "security": [
          {
            "OAuth2": [
              "enrichment-workflows.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "ID of the workflow to be read",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDefinition"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "put": {
        "tags": [
          "Enrichment workflows"
        ],
        "summary": "Update existing enrichment workflow definition",
        "operationId": "updateWorkflowDefinition",
        "security": [
          {
            "OAuth2": [
              "enrichment-workflows.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "ID of the workflow to be updated",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowDefinitionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workflow definition updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDefinition"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "tags": [
          "Enrichment workflows"
        ],
        "summary": "Delete enrichment workflow definition by ID",
        "operationId": "deleteWorkflowDefinition",
        "security": [
          {
            "OAuth2": [
              "enrichment-workflows.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "ID of the workflow to be deleted",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Workflow definition deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/enrichment-workflows/{workflowId}/history": {
      "get": {
        "tags": [
          "Enrichment workflows"
        ],
        "summary": "Get enrichment workflow definition history",
        "operationId": "getWorkflowDefinitionsHistory",
        "security": [
          {
            "OAuth2": [
              "enrichment-workflows.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "workflowId",
            "in": "path",
            "required": true,
            "description": "ID of the workflow to read history for",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/PagingOffset"
          },
          {
            "$ref": "#/components/parameters/PagingLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowDefinitionsListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/e-invoices/{id}/preview": {
      "get": {
        "summary": "Retrieve a document PDF preview for e-invoices",
        "operationId": "retrieveEInvoicesPreview",
        "description": "Provides a binary file of a document PDF preview for e-invoices",
        "security": [
          {
            "OAuth2": [
              "e-invoices.read"
            ]
          }
        ],
        "tags": [
          "E-Invoices"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Id of the document."
          }
        ],
        "responses": {
          "200": {
            "description": "Binary content of a file",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "documentNotFound": {
                    "summary": "Document does not exist",
                    "value": {
                      "detail": "The document with given identifier does not exist",
                      "status": 404,
                      "title": "Document does not exist"
                    }
                  },
                  "previewNotFound": {
                    "summary": "Document preview does not exist",
                    "value": {
                      "detail": "The document preview with given identifier does not exist",
                      "status": 404,
                      "title": "Document preview does not exist"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Retrieve user information by id",
        "operationId": "usersGetById",
        "parameters": [
          {
            "required": true,
            "schema": {
              "title": "User identifier",
              "type": "string"
            },
            "example": "6295dcd39db1ab740c3e296c",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "User does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "users.read"
            ]
          }
        ]
      }
    },
    "/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Retrieve a users list for given search criteria",
        "operationId": "usersList",
        "parameters": [
          {
            "required": false,
            "schema": {
              "type": "string",
              "title": "Search text used to find users."
            },
            "name": "search",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "type": "boolean",
              "title": "Is active flag used to filter users."
            },
            "name": "active",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/RoleName"
              },
              "type": "array",
              "title": "User roles used to filter on."
            },
            "name": "roles",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "type": "integer",
              "title": "The limit used for this page of results.",
              "minimum": 0,
              "default": 20
            },
            "name": "limit",
            "in": "query"
          },
          {
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "title": "The offset used for this page of results.",
              "default": 0
            },
            "name": "offset",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 404,
                  "title": "User does not exists",
                  "detail": "Error details"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "users.read"
            ]
          }
        ]
      }
    },
    "/document-xml/documents": {
      "get": {
        "tags": [
          "Documents XML"
        ],
        "summary": "List documents for a project as XML",
        "description": "Fetches the list of documents from Studio scoped to `projectId`, then\napplies the transformation rule tagged `{projectId}-list` to produce\nXML. If the rule has `addBinaryFile` enabled, binary attachments are\ninlined as base64.\n",
        "operationId": "listDocumentsXml",
        "security": [
          {
            "OAuth2": [
              "documents.read"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectIdQuery"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Filter by one or more document states (forwarded to Studio).",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of documents to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of documents to skip.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort expressions forwarded to Studio (e.g. `createdAt,desc`).\n",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Transformed XML document list.",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentsXml"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest1"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized1"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden1"
          },
          "404": {
            "$ref": "#/components/responses/NotFound1"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/document-xml/documents/{id}": {
      "get": {
        "tags": [
          "Documents XML"
        ],
        "summary": "Get a single document as XML",
        "description": "Fetches a document by id from Studio and applies the transformation\nrule tagged `{projectId}` to produce XML. If the rule has\n`addBinaryFile` enabled, the binary attachment is inlined as base64.\n",
        "operationId": "getDocumentXml",
        "security": [
          {
            "OAuth2": [
              "documents.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Studio document identifier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ProjectIdQuery"
          }
        ],
        "responses": {
          "200": {
            "description": "Transformed XML document.",
            "content": {
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentXml"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest1"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized1"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden1"
          },
          "404": {
            "$ref": "#/components/responses/NotFound1"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/agents": {
      "get": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Get Agents",
        "description": "List agents for the authenticated company.\n\nA summary projection by default: `prompt`, `configuration`, `systemPrompt`, `outputFormat` and\n`toolIds` are null, meaning \"not loaded\" rather than empty. Pass `full=true` to load all five on\nevery row — including the `namesAndVersions` lookup, which returns whole agents but resolves tool\nassignments only when asked. Version history is never part of a list; retrieve an agent by id for it.",
        "operationId": "external_get_agents",
        "security": [
          {
            "OAuth2": [
              "agents.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "namesAndVersions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "nullable": true,
              "description": "Comma separated list of names and versions, eg agent1:v1,agent2:v2. At most 50 entries.",
              "title": "Namesandversions"
            },
            "description": "Comma separated list of names and versions, eg agent1:v1,agent2:v2. At most 50 entries."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Maximum number of agents to return. Capped at 50; ignored when namesAndVersions is set.",
              "default": 20,
              "title": "Limit"
            },
            "description": "Maximum number of agents to return. Capped at 50; ignored when namesAndVersions is set."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of agents to skip. Ignored when namesAndVersions is set.",
              "default": 0,
              "title": "Offset"
            },
            "description": "Number of agents to skip. Ignored when namesAndVersions is set."
          },
          {
            "name": "editor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "nullable": true,
              "description": "Return only agents whose editors contain this value. Cannot be combined with namesAndVersions.",
              "title": "Editor"
            },
            "description": "Return only agents whose editors contain this value. Cannot be combined with namesAndVersions."
          },
          {
            "name": "full",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Load the whole agent. In the paged list, prompt, configuration, systemPrompt, outputFormat and toolIds are null on every row by default, meaning 'not loaded' rather than empty. The namesAndVersions lookup always returns whole agents; there this flag only adds toolIds.",
              "default": false,
              "title": "Full"
            },
            "description": "Load the whole agent. In the paged list, prompt, configuration, systemPrompt, outputFormat and toolIds are null on every row by default, meaning 'not loaded' rather than empty. The namesAndVersions lookup always returns whole agents; there this flag only adds toolIds."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAgentPage"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "post": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Create Agent",
        "description": "Create a custom agent; non-default OOTB identity or source provenance returns HTTP 422.",
        "operationId": "external_create_agent",
        "security": [
          {
            "OAuth2": [
              "agents.write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAgentCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAgent"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      }
    },
    "/agents/{id}": {
      "get": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Get Agent",
        "operationId": "external_get_agent",
        "security": [
          {
            "OAuth2": [
              "agents.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          },
          {
            "name": "withVersions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Whether to load versions",
              "default": false,
              "title": "Withversions"
            },
            "description": "Whether to load versions"
          },
          {
            "name": "withVersionsMetadata",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Whether to load lightweight version metadata (id, version, description, createdAt, createdBy)",
              "default": false,
              "title": "Withversionsmetadata"
            },
            "description": "Whether to load lightweight version metadata (id, version, description, createdAt, createdBy)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAgent"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "put": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Update Agent",
        "description": "Replace a custom agent. Persisted OOTB agents return HTTP 422; use root PATCH to customize them.",
        "operationId": "external_update_agent",
        "security": [
          {
            "OAuth2": [
              "agents.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAgentWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAgent"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "patch": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Patch Agent",
        "description": "Patch by persisted kind: OOTB allows prompt/description/editors; custom keeps partial-update semantics.\n\nFor custom agents, omitted fields stay unchanged, explicit null clears nullable fields, and companyId and\nname are immutable. A custom-only or otherwise protected field sent to an OOTB agent is rejected with 422.",
        "operationId": "external_patch_agent",
        "security": [
          {
            "OAuth2": [
              "agents.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ExternalAgentPatch"
                  },
                  {
                    "$ref": "#/components/schemas/ExternalOotbAgentPatch"
                  }
                ],
                "title": "AgentRootPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAgent"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "delete": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Delete Agent",
        "operationId": "external_delete_agent",
        "security": [
          {
            "OAuth2": [
              "agents.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      }
    },
    "/agent-workflows": {
      "get": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Get Workflows",
        "operationId": "external_get_workflows",
        "security": [
          {
            "OAuth2": [
              "agent-workflows.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "projectId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The ID of the project",
              "title": "Projectid"
            },
            "description": "The ID of the project"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Maximum number of workflows to return. Capped at 50.",
              "default": 20,
              "title": "Limit"
            },
            "description": "Maximum number of workflows to return. Capped at 50."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of workflows to skip.",
              "default": 0,
              "title": "Offset"
            },
            "description": "Number of workflows to skip."
          },
          {
            "name": "editor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "nullable": true,
              "description": "Return only workflows whose editors contain this value.",
              "title": "Editor"
            },
            "description": "Return only workflows whose editors contain this value."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWorkflowPage"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "post": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Create Workflow",
        "description": "Create a custom workflow; OOTB identity or source provenance in the request returns HTTP 422.",
        "operationId": "external_create_workflow",
        "security": [
          {
            "OAuth2": [
              "agent-workflows.write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalWorkflowCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWorkflow"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      }
    },
    "/agent-workflows/{id}": {
      "get": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Get Workflow",
        "operationId": "external_get_workflow",
        "security": [
          {
            "OAuth2": [
              "agent-workflows.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWorkflow"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "put": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Update Workflow",
        "description": "Replace a custom workflow. Persisted OOTB workflows return HTTP 422; use root PATCH to customize them.",
        "operationId": "external_update_workflow",
        "security": [
          {
            "OAuth2": [
              "agent-workflows.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalWorkflowWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWorkflow"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "patch": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Patch Workflow",
        "description": "Patch by persisted kind after ownership is established.\n\nOOTB workflows accept only workflowConfiguration.steps, name, description, projects, and editors;\na protected field sent to an OOTB workflow is rejected with 422. Custom workflows keep their existing\npartial-update contract.",
        "operationId": "external_patch_workflow",
        "security": [
          {
            "OAuth2": [
              "agent-workflows.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ExternalWorkflowPatch"
                  },
                  {
                    "$ref": "#/components/schemas/ExternalOotbWorkflowPatch"
                  }
                ],
                "title": "WorkflowRootPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWorkflow"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "delete": {
        "tags": [
          "Agent Management"
        ],
        "summary": "Delete Workflow",
        "operationId": "external_delete_workflow",
        "security": [
          {
            "OAuth2": [
              "agent-workflows.write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      }
    },
    "/processing-modes": {
      "get": {
        "tags": [
          "Processing Modes"
        ],
        "summary": "Retrieve available processing modes list",
        "operationId": "processingModesList",
        "security": [
          {
            "OAuth2": [
              "processing-modes.read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "exclusiveMinimum": true,
              "title": "The limit used for this page of results.",
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "title": "The offset used for this page of results.",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessingModeListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "example": {
                  "status": 400,
                  "title": "Invalid company ID",
                  "detail": "Error details"
                },
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse1"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "example": {
                  "status": 401,
                  "title": "Invalid token",
                  "detail": "Error details"
                },
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse1"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "example": {
                  "status": 403,
                  "title": "Forbidden",
                  "detail": "Error details"
                },
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse1"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "example": {
                  "status": 404,
                  "title": "Company does not exists",
                  "detail": "Error details"
                },
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse1"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse1"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "example": {
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Error details"
                },
                "schema": {
                  "$ref": "#/components/schemas/APIErrorResponse1"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccessTokenRequest": {
        "type": "object",
        "required": [
          "grant_type"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "client_credentials"
            ]
          }
        }
      },
      "AccessTokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The access token issued by the authorization server",
            "example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"
          },
          "expires_in": {
            "type": "integer",
            "description": "The lifetime of the access token in seconds",
            "example": 3600
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          },
          "scope": {
            "type": "string",
            "description": "Scopes allowed for the client",
            "example": "documents.write projects.write"
          }
        }
      },
      "BinaryFile": {
        "type": "string",
        "format": "binary"
      },
      "UploadResponse": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "6040dc9680b782b365ea77d5"
          }
        }
      },
      "DocumentsUpdateExternalDataRequest": {
        "type": "object",
        "description": "External data to be associated with the document. The data are provided as a flat JSON object. The properties of that object are case-insensitive. The maximum amount of properties is limited to 20.",
        "properties": {
          "key1": {
            "type": "string",
            "example": "value1"
          },
          "key2": {
            "type": "string",
            "example": "value2"
          }
        }
      },
      "DocumentsUpdateExternalIdRequest": {
        "type": "string",
        "description": "External ID",
        "example": "15b884b0-d551-4865-bda9-4168800c9d87"
      },
      "DocumentsUpdateTitleRequest": {
        "type": "string",
        "description": "New Title",
        "example": "New Title of Document",
        "maxLength": 256
      },
      "DocumentsUpdateTransferRequest": {
        "type": "object",
        "required": [
          "successful"
        ],
        "properties": {
          "successful": {
            "type": "boolean",
            "description": "Indicates if the transfer was successful or not",
            "example": true
          },
          "message": {
            "type": "string",
            "description": "May be used to provide additional details about the transfer. Especially in the erroneous case this field is valueable."
          }
        }
      },
      "DocumentsUpdateRejectionRequest": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "May be used to provide additional details about the rejection."
          }
        }
      },
      "DocumentsListResponse": {
        "type": "object",
        "required": [
          "documents"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentResponse"
            }
          },
          "limit": {
            "type": "integer",
            "description": "The limit used for this page of results. This will be the same as the limit query parameter unless it exceeds the maximal allowed value.",
            "example": 20
          },
          "offset": {
            "type": "integer",
            "description": "The offset used for this page of results. This will be the same as the offset query parameter",
            "example": 0
          },
          "totalCount": {
            "type": "integer",
            "description": "The total number of elements in the data attribute",
            "example": 1000
          }
        }
      },
      "DocumentResponse": {
        "type": "object",
        "required": [
          "id",
          "createdAt",
          "createdBy",
          "state",
          "title"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "6040dc9680b782b365ea77d5"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "example": "1990-12-31T15:59:60-08:00"
          },
          "completedBy": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "1990-12-31T15:59:60-08:00"
          },
          "createdBy": {
            "type": "string"
          },
          "fileId": {
            "type": "string",
            "description": "Identifier of the primary file associated with this document.",
            "example": "5349b4ddd2781d08c09890f4"
          },
          "caseId": {
            "type": "string",
            "nullable": true,
            "example": "5349b4ddd1111d08c09890f4"
          },
          "files": {
            "type": "array",
            "nullable": true,
            "description": "List of files associated with this document, each with their assigned role and main file flag.",
            "items": {
              "$ref": "#/components/schemas/DocumentFile"
            },
            "example": [
              {
                "id": "5349b4ddd2781d08c09890f4",
                "type": "salesOrder",
                "mainFile": true
              },
              {
                "id": "5349b4ddd2781d08c09890f5",
                "type": "supportingDocument",
                "mainFile": false
              }
            ]
          },
          "previewFileId": {
            "type": "string",
            "nullable": true,
            "description": "Identifier of the preview file for this document, if available.",
            "example": "5349b4ddd2781d08c09890f6"
          },
          "entities": {
            "type": "object",
            "example": {
              "currency": "EUR",
              "items": [
                {
                  "name": "High quality cement for rabbit hole sealing",
                  "qty": 1
                }
              ],
              "number": "2018-DE-0011122351",
              "qty": 2
            }
          },
          "externalId": {
            "type": "string",
            "example": "doc-0001"
          },
          "externalData": {
            "type": "object",
            "example": {
              "internalSystemId": "sap-01"
            }
          },
          "projectId": {
            "type": "string",
            "example": "6040dc9680b782b365ea77d5"
          },
          "state": {
            "$ref": "#/components/schemas/DocumentState"
          },
          "title": {
            "type": "string",
            "example": "scan-doc-1.jpg"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "1990-12-31T15:59:60-08:00"
          },
          "updatedBy": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "example": "https://example.com/documents/6040dc9680b782b365ea77d5",
            "description": "URL to access the document"
          }
        }
      },
      "DocumentFile": {
        "type": "object",
        "required": [
          "id",
          "type",
          "mainFile"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier of the file as returned by the upload endpoint.",
            "example": "5349b4ddd2781d08c09890f4"
          },
          "type": {
            "type": "string",
            "nullable": true,
            "description": "The role the file plays in the document (e.g. salesOrder, attachment). Must only contain letters from the Latin alphabet with no whitespace or special characters.",
            "pattern": "^[a-zA-Z]+$",
            "example": "salesOrder"
          },
          "mainFile": {
            "type": "boolean",
            "nullable": true,
            "description": "Indicates whether this file is the main file of the document.",
            "example": true
          }
        }
      },
      "DocumentState": {
        "type": "string",
        "enum": [
          "done",
          "doneAutomatically",
          "extracted",
          "failed",
          "inCompletion",
          "junk",
          "new",
          "processing",
          "rejected",
          "reviewRequired",
          "split",
          "transferFailed",
          "transferred"
        ]
      },
      "DocumentStatesResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "state": {
              "$ref": "#/components/schemas/DocumentState"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "example": "1990-12-31T15:59:60-08:00"
            }
          }
        }
      },
      "ProcessFileRequest": {
        "type": "object",
        "required": [
          "fileId",
          "projectId"
        ],
        "properties": {
          "fileId": {
            "type": "string",
            "example": "5349b4ddd2781d08c09890f4"
          },
          "projectId": {
            "type": "string",
            "example": "00000020f51bb4362eee2a4d"
          },
          "externalId": {
            "type": "string",
            "description": "External id of the file. Can be used if you want to link the file with an identifier in your system.",
            "example": "doc-0001"
          },
          "externalData": {
            "$ref": "#/components/schemas/DocumentsUpdateExternalDataRequest"
          }
        }
      },
      "ProcessingAccepted": {
        "type": "object",
        "required": [
          "documentId",
          "fileId",
          "projectId"
        ],
        "properties": {
          "documentId": {
            "type": "string",
            "example": "6040dc9680b782b365ea77d5"
          },
          "fileId": {
            "type": "string",
            "example": "5349b4ddd2781d08c09890f4"
          },
          "projectId": {
            "type": "string",
            "example": "00000020f51bb4362eee2a4d"
          }
        }
      },
      "ProcessFileBatchRequest": {
        "type": "object",
        "required": [
          "fileIds",
          "projectId"
        ],
        "properties": {
          "fileIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "minItems": 1,
            "description": "List of file identifiers to be processed as a batch into cases.",
            "example": [
              "375514e5-dac7-4b8d-963f-7f7b9e6d3d04",
              "96844098-0059-4664-95b8-c4c072aa94e3"
            ]
          },
          "projectId": {
            "type": "string",
            "description": "Identifier of the project in which the cases will be created.",
            "example": "69bbd0546290cc2162b433de"
          },
          "externalId": {
            "type": "string",
            "description": "External identifier of the file batch. Can be used to link the batch with an identifier in your system. Will be propagated to all cases created from this batch.",
            "example": "batch-0001"
          },
          "externalData": {
            "$ref": "#/components/schemas/ExternalData"
          }
        }
      },
      "ProcessFileBatchAccepted": {
        "type": "object",
        "required": [
          "fileBatchId",
          "fileIds",
          "projectId"
        ],
        "properties": {
          "fileBatchId": {
            "type": "string",
            "description": "Identifier of the file batch. Can be used to retrieve the cases created from this batch via GET /cases once processing is complete.",
            "example": "0e99a5b2-9010-4e86-a906-19c45e903fe8"
          },
          "fileIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of file identifiers that are part of this batch.",
            "example": [
              "2a77b5c8-30de-4e35-b078-3bba981cf80c",
              "2c6fe52d-26c0-4a7a-80a9-97d497b1a078"
            ]
          },
          "projectId": {
            "type": "string",
            "description": "Identifier of the project in which the cases will be created.",
            "example": "69bbd1d72f6eb584a70e79f0"
          }
        }
      },
      "CreateCaseRequest": {
        "type": "object",
        "required": [
          "files",
          "projectId"
        ],
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaseFile"
            },
            "minItems": 1,
            "description": "List of files to include in the case, each with their assigned role."
          },
          "projectId": {
            "type": "string",
            "description": "Identifier of the project in which the case will be created.",
            "example": "69bbd1e18cab258833c9ecf8"
          },
          "externalId": {
            "type": "string",
            "description": "External identifier of the case. Can be used to link the case with an identifier in your system.",
            "example": "case-0001"
          },
          "externalData": {
            "$ref": "#/components/schemas/ExternalData"
          }
        }
      },
      "CaseFile": {
        "type": "object",
        "required": [
          "id",
          "type",
          "mainFile"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "Identifier of the file as returned by the upload endpoint.",
            "example": "197c997c-4bab-41e7-b33d-bad287046914"
          },
          "type": {
            "type": "string",
            "description": "The role the file plays in the case (e.g. mainDocument, attachment). Must only contain letters from the Latin alphabet with no whitespace or special characters.",
            "pattern": "^[a-zA-Z]+$",
            "example": "salesOrder"
          },
          "mainFile": {
            "type": "boolean",
            "description": "Indicates whether this file is the main document of the case.",
            "example": true
          }
        }
      },
      "CreateCaseAccepted": {
        "type": "object",
        "required": [
          "caseId",
          "projectId"
        ],
        "properties": {
          "caseId": {
            "type": "string",
            "description": "Identifier of the case being created. Can be used to retrieve the case via GET /cases/{id} once processing is complete.",
            "example": "8512a5dd-91b9-4363-a869-db17394a955d"
          },
          "projectId": {
            "type": "string",
            "description": "Identifier of the project in which the case is being created.",
            "example": "69bbd20e5c155a70e763bc8d"
          }
        }
      },
      "CasesListResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaseResponse"
            }
          },
          "limit": {
            "type": "integer",
            "description": "The limit used for this page of results. This will be the same as the limit query parameter unless it exceeds the maximum allowed value.",
            "example": 20
          },
          "offset": {
            "type": "integer",
            "description": "The offset used for this page of results. This will be the same as the offset query parameter.",
            "example": 0
          },
          "totalCount": {
            "type": "integer",
            "description": "The total number of elements in the data attribute.",
            "example": 1000
          }
        }
      },
      "CaseResponse": {
        "type": "object",
        "required": [
          "id",
          "createdAt",
          "createdBy",
          "state",
          "files",
          "projectId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "69c5a545-7b2f-4f4a-833b-45feff1056c7"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T15:00:00Z"
          },
          "createdBy": {
            "type": "string"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T15:00:00Z"
          },
          "completedBy": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T15:00:00Z"
          },
          "updatedBy": {
            "type": "string"
          },
          "transferSuccessful": {
            "type": "boolean",
            "description": "Indicates whether the case was transferred successfully to the target system. Will be `null` if the transfer status is not yet known (e.g. because the case is still being processed or the transfer information has not been provided yet).",
            "example": true
          },
          "transferMessage": {
            "type": "string",
            "description": "May contain additional information about the transfer, especially in the case of a failed transfer.",
            "example": "Upload failed due to ERP being down"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaseFile"
            },
            "description": "List of files that are part of the case, each with their assigned role and main document flag."
          },
          "entities": {
            "type": "object",
            "description": "Entities extracted from the case by the AI Agents.",
            "example": {
              "currency": "EUR",
              "items": [
                {
                  "name": "High quality cement for rabbit hole sealing",
                  "qty": 1
                }
              ],
              "number": "2018-DE-0011122351",
              "qty": 2
            }
          },
          "externalId": {
            "type": "string",
            "example": "case-0001"
          },
          "externalData": {
            "type": "object",
            "example": {
              "internalSystemId": "sap-01"
            }
          },
          "projectId": {
            "type": "string",
            "example": "69bbd22c92f3c3ee4a097784"
          },
          "fileBatchId": {
            "type": "string",
            "description": "Identifier of the file batch this case was created from. Only present for cases created via POST /cases/process-file-batch.",
            "example": "a1b0020b-8ef9-4801-aeef-979224af0bab"
          },
          "previewFileId": {
            "type": "string",
            "description": "Identifier of the file used as the case preview, if any.",
            "example": "197c997c-4bab-41e7-b33d-bad287046914"
          },
          "state": {
            "$ref": "#/components/schemas/CaseState"
          },
          "url": {
            "type": "string",
            "example": "https://example.com/cases/6040dc9680b782b365ea77d5",
            "description": "URL to access the case."
          }
        }
      },
      "CaseState": {
        "type": "string",
        "enum": [
          "done",
          "doneAutomatically",
          "failed",
          "inCompletion",
          "new",
          "processing",
          "rejected",
          "reviewRequired",
          "transferFailed",
          "transferred"
        ]
      },
      "CasesUpdateTransferRequest": {
        "type": "object",
        "required": [
          "successful"
        ],
        "properties": {
          "successful": {
            "type": "boolean",
            "description": "Indicates if the transfer was successful or not.",
            "example": true
          },
          "message": {
            "type": "string",
            "description": "May be used to provide additional details about the transfer. Especially valuable in the erroneous case."
          }
        }
      },
      "ExternalData": {
        "type": "object",
        "description": "Associated external data. Will be applied to the case or to all cases in a batch.\nProvided as a flat JSON object. The properties are case-insensitive.\nThe maximum amount of properties is limited to 20.\n",
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string",
              "nullable": true
            },
            {
              "type": "number",
              "nullable": true
            },
            {
              "type": "boolean",
              "nullable": true
            }
          ]
        }
      },
      "validationError": {
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "type": "object",
        "properties": {
          "loc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "msg": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "HTTPValidationError": {
        "type": "object",
        "properties": {
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/validationError"
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference",
            "description": "A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferenceable and point to a human-readable documentation nor globally unique for the problem type.\n",
            "default": "about:blank",
            "example": "/some/uri-reference"
          },
          "title": {
            "type": "string",
            "description": "A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.\n",
            "example": "some title for the error situation"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "The HTTP status code generated by the origin server for this occurrence of the problem.\n",
            "minimum": 100,
            "maximum": 599
          },
          "detail": {
            "type": "string",
            "description": "A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.\n",
            "example": "some description for the error situation"
          },
          "instance": {
            "type": "string",
            "format": "uri-reference",
            "description": "A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code.\n",
            "example": "/some/uri-reference#specific-occurrence-context"
          }
        }
      },
      "CompaniesId": {
        "title": "CompaniesId",
        "type": "string",
        "example": "63e6663823b4c1f5287398bb"
      },
      "CompaniesListResponse": {
        "title": "CompaniesListResponse",
        "required": [
          "data",
          "limit",
          "offset",
          "totalCount"
        ],
        "type": "object",
        "properties": {
          "data": {
            "title": "Companies list",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompaniesResponse"
            }
          },
          "limit": {
            "title": "The limit used for this page of results. This will be the same as the limit query parameter unless it exceeds the maximal allowed value.",
            "type": "integer",
            "example": 20
          },
          "offset": {
            "title": "The offset used for this page of results. This will be the same as the offset query parameter.",
            "type": "integer",
            "example": 0
          },
          "totalCount": {
            "title": "The total number of elements of the data attribute.",
            "type": "integer",
            "example": 1000
          }
        }
      },
      "CompaniesResponse": {
        "title": "CompaniesResponse",
        "required": [
          "name",
          "id",
          "active",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "Companies display name",
            "type": "string",
            "example": "Companies Name Inc."
          },
          "id": {
            "title": "Companies identifier",
            "type": "string",
            "example": "63e6663823b4c1f5287398bb"
          },
          "active": {
            "title": "Companies activity flag",
            "type": "boolean",
            "example": true
          },
          "createdAt": {
            "title": "Companies creation date",
            "type": "string",
            "example": "1990-12-31T15:46:19.384990Z"
          }
        }
      },
      "ProjectResponse": {
        "type": "object",
        "description": "Project response",
        "required": [
          "id",
          "name",
          "ocr",
          "extractionModelId",
          "createdAt",
          "createdBy",
          "updatedAt",
          "updatedBy",
          "completion",
          "duplicates",
          "members",
          "isLive"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProjectId"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "1990-12-31T15:46:19.384990Z"
          },
          "createdBy": {
            "$ref": "#/components/schemas/ProjectMemberId"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "1990-12-31T15:46:19.384990Z"
          },
          "updatedBy": {
            "$ref": "#/components/schemas/ProjectMemberId"
          },
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "note": {
            "$ref": "#/components/schemas/ProjectNote"
          },
          "extractionModelId": {
            "$ref": "#/components/schemas/ProjectExtractionModelId"
          },
          "ocr": {
            "$ref": "#/components/schemas/ProjectOCRResponse"
          },
          "completion": {
            "$ref": "#/components/schemas/ProjectCompletion"
          },
          "duplicates": {
            "$ref": "#/components/schemas/ProjectDuplicates"
          },
          "members": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProjectAllMembers"
              },
              {
                "$ref": "#/components/schemas/ProjectMembers"
              }
            ],
            "discriminator": {
              "propertyName": "allow",
              "mapping": {
                "all": "#/components/schemas/ProjectAllMembers",
                "members": "#/components/schemas/ProjectMembers"
              }
            }
          },
          "retentionDays": {
            "$ref": "#/components/schemas/ProjectRetentionDays"
          },
          "isLive": {
            "$ref": "#/components/schemas/ProjectIsLive"
          }
        }
      },
      "ProjectId": {
        "title": "ProjectId",
        "description": "Project ID",
        "type": "string",
        "example": "63e6663823b4c1f5287398bb"
      },
      "ProjectName": {
        "description": "Project name",
        "type": "string",
        "example": "My Project",
        "minLength": 1,
        "maxLength": 60
      },
      "ProjectNote": {
        "description": "Project note",
        "type": "string",
        "example": "My project description note",
        "minLength": 1,
        "maxLength": 1000
      },
      "ProjectExtractionModelId": {
        "title": "ProjectExtractionModelId",
        "description": "Extraction Model id",
        "type": "string",
        "example": "63e6663823b4c1f5287398bb"
      },
      "ProjectOCRRequest": {
        "title": "ProjectOCRRequest",
        "description": "OCR configuration accepted when creating or updating a project.\n\nOnly the `google` and `internal` engines can be set. The `abbyy` and `chinese`\nengines are returned by read endpoints for existing projects but are rejected\nwith a `422` when sent in a request.\n",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProjectOCRGoogle"
          },
          {
            "$ref": "#/components/schemas/ProjectOCRInternal"
          }
        ],
        "discriminator": {
          "propertyName": "engine",
          "mapping": {
            "google": "#/components/schemas/ProjectOCRGoogle",
            "internal": "#/components/schemas/ProjectOCRInternal"
          }
        }
      },
      "ProjectOCRResponse": {
        "title": "ProjectOCRResponse",
        "description": "OCR configuration returned for a project.\n\nCovers every engine a project may currently be configured with, including the\nread-only `abbyy` and `chinese` engines.\n",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProjectOCRAbbyy"
          },
          {
            "$ref": "#/components/schemas/ProjectOCRGoogle"
          },
          {
            "$ref": "#/components/schemas/ProjectOCRChinese"
          },
          {
            "$ref": "#/components/schemas/ProjectOCRInternal"
          }
        ],
        "discriminator": {
          "propertyName": "engine",
          "mapping": {
            "abbyy": "#/components/schemas/ProjectOCRAbbyy",
            "google": "#/components/schemas/ProjectOCRGoogle",
            "chinese": "#/components/schemas/ProjectOCRChinese",
            "internal": "#/components/schemas/ProjectOCRInternal"
          }
        }
      },
      "ProjectOCRAbbyy": {
        "type": "object",
        "description": "Abbyy OCR configuration.\n\nRead-only: returned for existing projects, but rejected with a `422` when sent in\na create or update request.\n",
        "required": [
          "engine",
          "features",
          "languages"
        ],
        "properties": {
          "engine": {
            "type": "string",
            "enum": [
              "abbyy"
            ]
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectOCRAbbyyFeatures"
            }
          },
          "languages": {
            "$ref": "#/components/schemas/ProjectOCRAbbyyLanguages"
          }
        }
      },
      "ProjectOCRAbbyyFeatures": {
        "type": "string",
        "enum": [
          "barcodes"
        ]
      },
      "ProjectOCRAbbyyLanguages": {
        "type": "array",
        "description": "Array of abbyy ocr languages used within a project",
        "maxItems": 5,
        "minItems": 1,
        "items": {
          "$ref": "#/components/schemas/ProjectOCRAbbyyLanguage"
        },
        "example": [
          "German",
          "English"
        ]
      },
      "ProjectOCRAbbyyLanguage": {
        "type": "string",
        "description": "Abbyy ocr supported languages",
        "enum": [
          "Arabic",
          "ArmenianEastern",
          "ArmenianGrabar",
          "ArmenianWestern",
          "Bulgarian",
          "Catalan",
          "ChinesePRC",
          "ChineseTaiwan",
          "Croatian",
          "Czech",
          "Danish",
          "Dutch",
          "DutchBelgian",
          "English",
          "Estonian",
          "Farsi",
          "Finnish",
          "French",
          "German",
          "Greek",
          "Hebrew",
          "Hungarian",
          "Icelandic",
          "Indonesian",
          "Irish",
          "Italian",
          "Japanese",
          "Korean",
          "KoreanHangul",
          "Latin",
          "Latvian",
          "Lithuanian",
          "Macedonian",
          "Malay",
          "Mongol",
          "Norwegian",
          "Polish",
          "PortugueseBrazilian",
          "PortugueseStandard",
          "Romanian",
          "Russian",
          "SerbianCyrillic",
          "SerbianLatin",
          "Slovenian",
          "Spanish",
          "Swedish",
          "Thai",
          "Turkish",
          "UighurCyrillic",
          "UighurLatin",
          "Ukrainian",
          "Vietnamese",
          "Welsh"
        ]
      },
      "ProjectOCRGoogle": {
        "type": "object",
        "description": "Google OCR configuration",
        "required": [
          "engine",
          "features"
        ],
        "properties": {
          "engine": {
            "type": "string",
            "enum": [
              "google"
            ]
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectOCRGoogleFeatures"
            }
          }
        }
      },
      "ProjectOCRGoogleFeatures": {
        "type": "string",
        "enum": [
          "barcodes",
          "disableBoxFilter",
          "plainText"
        ]
      },
      "ProjectOCRInternal": {
        "type": "object",
        "description": "Internal OCR configuration.\n\nThe internal engine takes no features and no languages.\n",
        "required": [
          "engine"
        ],
        "properties": {
          "engine": {
            "type": "string",
            "enum": [
              "internal"
            ]
          }
        }
      },
      "ProjectOCRChinese": {
        "type": "object",
        "description": "Chinese OCR configuration.\n\nRead-only: returned for existing projects, but rejected with a `422` when sent in\na create or update request. The chinese engine takes no features and no languages.\n",
        "required": [
          "engine"
        ],
        "properties": {
          "engine": {
            "type": "string",
            "enum": [
              "chinese"
            ]
          }
        }
      },
      "ProjectCompletion": {
        "type": "string",
        "description": "ProjectCompletion type\n* `automatic` - Mark documents as completed after succesfull validation\n* `manual` - Mark documents to review after succesfull validation\n",
        "enum": [
          "automatic",
          "manual"
        ],
        "example": "manual",
        "default": "manual"
      },
      "ProjectDuplicates": {
        "type": "string",
        "description": "How duplicates documents show be handle\n* `allow` - Allow documents duplicates to be processed\n* `fail` - Mark documents duplicates as failed\n",
        "enum": [
          "allow",
          "fail"
        ],
        "example": "allow",
        "default": "fail"
      },
      "ProjectAllMembers": {
        "title": "ProjectAllMembers",
        "description": "Allow all users to access a project",
        "type": "object",
        "properties": {
          "allow": {
            "type": "string",
            "enum": [
              "all"
            ]
          }
        }
      },
      "ProjectMembers": {
        "title": "ProjectMembers",
        "description": "Allow provided members to access project",
        "type": "object",
        "properties": {
          "allow": {
            "type": "string",
            "enum": [
              "members"
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectMemberId"
            }
          }
        }
      },
      "ProjectMemberId": {
        "description": "Project member id",
        "type": "string",
        "example": "63e6663823b4c1f5287398bb"
      },
      "ProjectRetentionDays": {
        "description": "Project document retention in days",
        "type": "integer",
        "example": 180,
        "minimum": 1,
        "maximum": 3650
      },
      "ProjectIsLive": {
        "description": "Indicates if a project is live or not",
        "type": "boolean",
        "default": false
      },
      "ProjectCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "ocr",
          "extractionModelId",
          "members"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "note": {
            "$ref": "#/components/schemas/ProjectNote"
          },
          "ocr": {
            "$ref": "#/components/schemas/ProjectOCRRequest"
          },
          "extractionModelId": {
            "$ref": "#/components/schemas/ProjectExtractionModelId"
          },
          "completion": {
            "$ref": "#/components/schemas/ProjectCompletion"
          },
          "duplicates": {
            "$ref": "#/components/schemas/ProjectDuplicates"
          },
          "members": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProjectAllMembers"
              },
              {
                "$ref": "#/components/schemas/ProjectMembers"
              }
            ],
            "discriminator": {
              "propertyName": "allow",
              "mapping": {
                "all": "#/components/schemas/ProjectAllMembers",
                "members": "#/components/schemas/ProjectMembers"
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Schema"
          },
          "retentionDays": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProjectRetentionDays"
              },
              {
                "default": 180
              }
            ]
          },
          "isLive": {
            "$ref": "#/components/schemas/ProjectIsLive"
          }
        }
      },
      "ProjectUpdateRequest": {
        "type": "object",
        "description": "Request for partial project update (PATCH). All fields are optional.\n- Fields not included in the request will remain unchanged\n- Fields explicitly set to null will clear the value (only for optional fields: note, retentionDays)\n- Required fields (name, extractionModelId, ocr, completion, duplicates, isLive, members, schema) cannot be set to null\n- At least one field must be provided\n\nOnly the `google` and `internal` OCR engines can be set. To update a project that\ncurrently uses `abbyy` or `chinese`, omit the `ocr` property.\n",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/ProjectName"
          },
          "note": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProjectNote"
              }
            ]
          },
          "ocr": {
            "$ref": "#/components/schemas/ProjectOCRRequest"
          },
          "extractionModelId": {
            "$ref": "#/components/schemas/ProjectExtractionModelId"
          },
          "completion": {
            "$ref": "#/components/schemas/ProjectCompletion"
          },
          "duplicates": {
            "$ref": "#/components/schemas/ProjectDuplicates"
          },
          "retentionDays": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProjectRetentionDays"
              }
            ]
          },
          "isLive": {
            "$ref": "#/components/schemas/ProjectIsLive"
          },
          "members": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProjectAllMembers"
              },
              {
                "$ref": "#/components/schemas/ProjectMembers"
              }
            ],
            "discriminator": {
              "propertyName": "allow",
              "mapping": {
                "all": "#/components/schemas/ProjectAllMembers",
                "members": "#/components/schemas/ProjectMembers"
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/Schema"
          }
        }
      },
      "ProjectListResponse": {
        "title": "ProjectListResponse",
        "required": [
          "data",
          "totalCount",
          "limit",
          "offset"
        ],
        "type": "object",
        "properties": {
          "data": {
            "title": "Data",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectResponse"
            }
          },
          "limit": {
            "title": "limit",
            "type": "integer",
            "example": 20
          },
          "offset": {
            "title": "offset",
            "type": "integer",
            "example": 0
          },
          "totalCount": {
            "title": "Totalcount",
            "type": "integer",
            "example": 1
          }
        }
      },
      "Schema": {
        "title": "Schema",
        "type": "object",
        "properties": {
          "version": {
            "title": "Version",
            "type": "integer",
            "example": 1
          },
          "dataPoints": {
            "title": "DataPoints",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "internalName": {
                  "type": "string"
                },
                "displayName": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "normalization": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "rules": {
                  "type": "object"
                }
              }
            },
            "example": [
              {
                "internalName": "type",
                "displayName": "Type",
                "type": "string",
                "source": {
                  "type": "extractor"
                },
                "normalization": [],
                "rules": {}
              },
              {
                "internalName": "number",
                "displayName": "Number",
                "type": "string",
                "source": {
                  "type": "extractor"
                },
                "normalization": [],
                "rules": {}
              },
              {
                "internalName": "issuedAt",
                "displayName": "Issued At",
                "type": "date",
                "preferDayOfMonth": "last",
                "source": {
                  "type": "extractor"
                },
                "normalization": [],
                "rules": {}
              },
              {
                "internalName": "deliveredAt",
                "displayName": "Delivered At",
                "type": "date",
                "preferDayOfMonth": "last",
                "source": {
                  "type": "extractor"
                },
                "normalization": [],
                "rules": {}
              },
              {
                "internalName": "currency",
                "displayName": "Currency",
                "type": "string",
                "source": {
                  "type": "extractor"
                },
                "normalization": [],
                "rules": {}
              }
            ]
          },
          "features": {
            "type": "object",
            "properties": {
              "derivation": {
                "type": "boolean",
                "example": false
              }
            }
          },
          "enrichment": {
            "type": "object"
          },
          "normalization": {
            "type": "object"
          },
          "validation": {
            "type": "object"
          }
        }
      },
      "EmailResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Document id",
            "example": "6040dc9680b782b365ea77d5"
          },
          "senderAddresses": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Email sender adresses",
            "example": [
              "no-replay@hypatos.com",
              "joe.doe@example.com"
            ]
          },
          "subject": {
            "type": "string",
            "title": "Email subject",
            "example": "Document from this month"
          }
        },
        "type": "object",
        "required": [
          "id",
          "senderAddresses"
        ],
        "title": "EmailResponse"
      },
      "ConditionEdgesEvaluation": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "conditionalEdges"
            ],
            "title": "Type",
            "default": "conditionalEdges"
          },
          "condition": {
            "$ref": "#/components/schemas/ConditionType"
          }
        },
        "type": "object",
        "required": [
          "condition"
        ],
        "title": "ConditionEdgesEvaluation"
      },
      "ConditionType": {
        "type": "string",
        "enum": [
          "or",
          "and"
        ],
        "title": "ConditionType",
        "description": "An enumeration."
      },
      "RoutingAction": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/RoutingMoveAction"
          },
          {
            "$ref": "#/components/schemas/RoutingCopyAction"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "move": "#/components/schemas/RoutingMoveAction",
            "copy": "#/components/schemas/RoutingCopyAction"
          }
        },
        "title": "RoutingAction"
      },
      "PostMoveAction": {
        "type": "string",
        "enum": [
          "none",
          "refresh",
          "reprocess",
          "merge"
        ],
        "title": "PostMoveAction",
        "default": "reprocess",
        "description": "Defines the action to be executed for the document in the target project."
      },
      "PostCopyAction": {
        "type": "string",
        "enum": [
          "none",
          "reprocess",
          "resetState"
        ],
        "title": "PostCopyAction",
        "default": "reprocess",
        "description": "Defines the action to be executed for the document in the target project."
      },
      "RoutingMoveAction": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "move"
            ],
            "default": "move",
            "title": "Type"
          },
          "postMoveAction": {
            "$ref": "#/components/schemas/PostMoveAction"
          }
        },
        "required": [
          "type",
          "postMoveAction"
        ],
        "title": "RoutingMoveAction",
        "example": {
          "type": "move",
          "postMoveAction": "reprocess"
        }
      },
      "RoutingCopyAction": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "copy"
            ],
            "default": "copy",
            "title": "Type"
          },
          "postCopyAction": {
            "$ref": "#/components/schemas/PostCopyAction"
          }
        },
        "required": [
          "type",
          "postCopyAction"
        ],
        "title": "RoutingCopyAction"
      },
      "RoutingRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Routing name",
            "example": "Document routing name"
          },
          "fromProjectId": {
            "type": "string",
            "title": "Identifier of a project where routings evaluation will happen",
            "example": "63e6663823b4c1f5287398bb"
          },
          "toProjectId": {
            "type": "string",
            "title": "Identifier of a project where documents will be moved to if routings evaluation passes",
            "example": "63e6663823b4c1f5287398bb"
          },
          "postRoutingAction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PostRoutingAction"
              }
            ],
            "title": "Action done after document is routed",
            "default": "reprocess",
            "description": "Deprecated, use `routingAction` instead"
          },
          "active": {
            "type": "boolean",
            "title": "Only active routings will be evaluated",
            "example": true
          },
          "routingNode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RoutingNode"
              }
            ],
            "title": "Routing node evaluation definition"
          },
          "routingAction": {
            "$ref": "#/components/schemas/RoutingAction"
          }
        },
        "required": [
          "name",
          "fromProjectId",
          "toProjectId",
          "active",
          "routingNode",
          "routingAction"
        ]
      },
      "CreateRoutingRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoutingRequest"
          },
          {
            "type": "object",
            "properties": {
              "createdBy": {
                "type": "string",
                "title": "Routing creator",
                "example": "671f771235cd520084dd655f"
              }
            }
          }
        ],
        "title": "CreateRoutingRequest"
      },
      "UpdateRoutingRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoutingRequest"
          },
          {
            "type": "object",
            "properties": {
              "modifiedBy": {
                "type": "string",
                "title": "Routing modifier",
                "example": "671f771235cd520084dd655f"
              }
            }
          }
        ],
        "title": "UpdateRoutingRequest"
      },
      "DocumentEvaluation": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "document"
            ],
            "title": "Type",
            "default": "document"
          },
          "operator": {
            "$ref": "#/components/schemas/EvaluationOperator"
          },
          "evaluateWithValue": {
            "title": "Evaluatewithvalue",
            "type": "string"
          },
          "evaluateIfMissing": {
            "type": "boolean",
            "title": "Evaluateifmissing"
          },
          "documentPath": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Path"
            }
          }
        },
        "type": "object",
        "required": [
          "operator",
          "documentPath"
        ],
        "title": "DocumentEvaluation"
      },
      "EvaluationOperator": {
        "type": "string",
        "enum": [
          "contains",
          "equal",
          "notEqual",
          "==",
          "!=",
          ">",
          ">=",
          "<",
          "<="
        ],
        "title": "EvaluationOperator",
        "description": "Evaluation operators. >, >=, <, <= are used only for numbers. ==/equal, !=/notEqual means same, consider equal/notEqual words as deprecated."
      },
      "OrderDirection": {
        "type": "string",
        "enum": [
          "up",
          "down"
        ],
        "title": "OrderDirection",
        "description": "An enumeration."
      },
      "PostRoutingAction": {
        "type": "string",
        "enum": [
          "none",
          "refresh",
          "reprocess",
          "merge"
        ],
        "title": "PostRoutingAction",
        "description": "Defines the action to be executed for the routed document in the target project."
      },
      "RoutingListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/RoutingResponse"
            },
            "type": "array",
            "title": "Data"
          },
          "totalCount": {
            "type": "integer",
            "title": "Totalcount"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "data",
          "totalCount",
          "limit",
          "offset"
        ],
        "title": "RoutingListResponse"
      },
      "RoutingNode": {
        "properties": {
          "evaluation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SchemaEvaluation"
              },
              {
                "$ref": "#/components/schemas/ConditionEdgesEvaluation"
              },
              {
                "$ref": "#/components/schemas/DocumentEvaluation"
              }
            ],
            "title": "Evaluation"
          },
          "edges": {
            "items": {
              "$ref": "#/components/schemas/RoutingNode"
            },
            "type": "array",
            "title": "Edges",
            "example": []
          }
        },
        "type": "object",
        "required": [
          "evaluation"
        ],
        "title": "RoutingNode"
      },
      "RoutingOrderRequest": {
        "properties": {
          "direction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderDirection"
              }
            ],
            "title": "Moving order direction",
            "example": "down"
          },
          "count": {
            "type": "integer",
            "title": "Moving order count in given direction",
            "example": 2
          }
        },
        "type": "object",
        "required": [
          "direction",
          "count"
        ],
        "title": "RoutingOrderRequest"
      },
      "RoutingResponse": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Routing name",
            "example": "Document routing name"
          },
          "fromProjectId": {
            "type": "string",
            "title": "Identifier of a project where routings evaluation will happen",
            "example": "263e6663823b4c1f5287398bb"
          },
          "toProjectId": {
            "type": "string",
            "title": "Identifier of a project where documents will be moved to if routings evaluation passes",
            "example": "263e6663823b4c1f5287398bb"
          },
          "postRoutingAction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PostRoutingAction"
              }
            ],
            "title": "Action done after document is routed",
            "default": "reprocess",
            "example": "reprocess"
          },
          "active": {
            "type": "boolean",
            "title": "Only active routings will be evaluated",
            "example": true
          },
          "routingNode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RoutingNode"
              }
            ],
            "title": "Routing node evaluation definition"
          },
          "id": {
            "type": "string",
            "title": "Routing identifier",
            "example": "63e6663823b4c1f5287398bb"
          },
          "modifiedAt": {
            "type": "string",
            "title": "Routing last modification date",
            "example": "2023-02-10T15:46:19.384990Z"
          },
          "modifiedBy": {
            "type": "string",
            "title": "Routing last modification by",
            "example": "671f771235cd520084dd655f"
          },
          "createdBy": {
            "type": "string",
            "title": "Routing last creation by",
            "example": "671f771235cd520084dd655f"
          },
          "createdAt": {
            "type": "string",
            "title": "Routing last creation date",
            "example": "2023-02-10T15:46:19.384990Z"
          },
          "order": {
            "type": "integer",
            "title": "Routing order",
            "example": 0
          },
          "routingAction": {
            "$ref": "#/components/schemas/RoutingAction"
          }
        },
        "type": "object",
        "required": [
          "name",
          "fromProjectId",
          "toProjectId",
          "active",
          "routingNode",
          "id",
          "order",
          "routingAction"
        ],
        "title": "RoutingResponse"
      },
      "SchemaEvaluation": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "schema"
            ],
            "title": "Type",
            "default": "schema"
          },
          "operator": {
            "$ref": "#/components/schemas/EvaluationOperator"
          },
          "evaluateWithValue": {
            "title": "Evaluatewithvalue",
            "type": "string"
          },
          "evaluateIfMissing": {
            "type": "boolean",
            "title": "Evaluateifmissing"
          },
          "dataPointPath": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Path"
            }
          }
        },
        "type": "object",
        "required": [
          "operator",
          "dataPointPath"
        ],
        "title": "SchemaEvaluation"
      },
      "Path": {
        "type": "string",
        "title": "Path",
        "description": "Path location."
      },
      "Problem1": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          }
        }
      },
      "WorkflowDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique ID of the workflow definition"
          },
          "name": {
            "type": "string",
            "description": "Name of the workflow"
          },
          "description": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "definition": {
            "type": "string",
            "description": "YAML definition of the workflow"
          },
          "projectIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "version": {
            "type": "integer"
          },
          "versionString": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "createdById": {
            "type": "string"
          },
          "updatedById": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "definition"
        ]
      },
      "WorkflowDefinitionsListResponse": {
        "type": "object",
        "required": [
          "data",
          "totalCount",
          "limit",
          "offset"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowDefinition"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int64",
            "description": "The total number of workflow definitions available."
          },
          "limit": {
            "type": "integer",
            "description": "The limit used for this page of results."
          },
          "offset": {
            "type": "integer",
            "description": "The zero-based offset used for this page of results."
          }
        }
      },
      "WorkflowDefinitionRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the workflow"
          },
          "definition": {
            "type": "string",
            "description": "YAML definition of the workflow"
          },
          "description": {
            "type": "string"
          },
          "projectIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "definition"
        ]
      },
      "CompanyAccess": {
        "title": "CompanyAccess",
        "required": [
          "companyId",
          "companyName",
          "active",
          "createdAt",
          "roles"
        ],
        "type": "object",
        "properties": {
          "companyId": {
            "title": "Company identifier",
            "type": "string",
            "example": "660572bc7a3cd6803f112252"
          },
          "companyName": {
            "title": "Company name",
            "type": "string",
            "example": "Company Inc."
          },
          "active": {
            "title": "If user is active for particular company",
            "type": "boolean",
            "example": true
          },
          "createdAt": {
            "title": "User membership creation date",
            "type": "string",
            "example": "2023-03-28T15:46:19.384990Z"
          },
          "createdBy": {
            "title": "Creator user identifier",
            "type": "string",
            "example": "660572bc7a3cd6803f112252"
          },
          "modifiedAt": {
            "title": "Modification date",
            "type": "string",
            "example": "2023-03-28T15:46:19.384990Z"
          },
          "modifiedBy": {
            "title": "Modfier user identifier",
            "type": "string",
            "example": "660572bc7a3cd6803f112252"
          },
          "roles": {
            "title": "User roles in particular company",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleName"
            },
            "example": [
              "clerk"
            ]
          }
        }
      },
      "RoleName": {
        "title": "RoleName",
        "enum": [
          "installationAdmin",
          "installationClerk",
          "admin",
          "clerk",
          "manager",
          "supportSpecialist"
        ],
        "type": "string",
        "description": "User role for particular company."
      },
      "UserListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/UserResponse"
            },
            "type": "array",
            "title": "Data"
          },
          "totalCount": {
            "type": "integer",
            "title": "Totalcount"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "data",
          "totalCount",
          "limit",
          "offset"
        ],
        "title": "UserListResponse"
      },
      "UserResponse": {
        "title": "UserResponse",
        "required": [
          "id",
          "email",
          "name",
          "companiesAccess",
          "active",
          "isInternal"
        ],
        "type": "object",
        "properties": {
          "id": {
            "title": "User identifier",
            "type": "string",
            "example": "660572bc7a3cd6803f112252"
          },
          "email": {
            "title": "User email",
            "type": "string",
            "example": "firstname.lastname@company.inc"
          },
          "name": {
            "title": "User display name",
            "type": "string",
            "example": "Firstname Lastname"
          },
          "companiesAccess": {
            "title": "User companies memberships",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanyAccess"
            }
          },
          "active": {
            "title": "If user is active",
            "type": "boolean",
            "example": true
          },
          "isInternal": {
            "title": "If user is considered internal Hypatos one",
            "type": "boolean",
            "example": false
          }
        }
      },
      "DocumentsXml": {
        "type": "string",
        "format": "xml",
        "description": "XML document produced by applying the project-specific list\ntransformation (XSLT) to the Studio response. The concrete element\nstructure is defined per project.\n",
        "example": "<documents>\n  <document id=\"...\"/>\n</documents>\n"
      },
      "DocumentXml": {
        "type": "string",
        "format": "xml",
        "description": "XML document produced by applying the project-specific single-document\ntransformation (XSLT) to the Studio response. May include inlined\nbase64 attachments when the rule has `addBinaryFile` enabled.\n",
        "example": "<document id=\"...\">\n  <attachment contentType=\"application/pdf\">BASE64...</attachment>\n</document>\n"
      },
      "GenericError": {
        "type": "object",
        "description": "Error envelope returned by the API.",
        "required": [
          "status",
          "title",
          "detail"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "HTTP status code.",
            "example": 400
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the error.",
            "example": "Incorrect input"
          },
          "detail": {
            "type": "string",
            "description": "Human-readable explanation specific to this occurrence.",
            "example": "Required request parameter 'projectId' is not present."
          },
          "errorAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp at which the error was produced."
          }
        }
      },
      "ValidationError": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GenericError"
          },
          {
            "type": "object",
            "properties": {
              "hypatosErrorMetaInfo": {
                "$ref": "#/components/schemas/ValidationErrorMetaInfo"
              }
            }
          }
        ]
      },
      "ValidationErrorMetaInfo": {
        "type": "object",
        "properties": {
          "invalidFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorField"
            }
          }
        }
      },
      "ErrorField": {
        "type": "object",
        "required": [
          "status",
          "title",
          "detail",
          "fieldName"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "fieldName": {
            "type": "string",
            "description": "Name of the field that failed validation."
          }
        }
      },
      "APIErrorResponse": {
        "properties": {
          "status": {
            "type": "integer",
            "title": "Status code",
            "example": 422
          },
          "title": {
            "type": "string",
            "title": "Error title",
            "example": "Request validation error"
          },
          "detail": {
            "type": "string",
            "nullable": true,
            "title": "Error description",
            "example": "Validation error details"
          }
        },
        "type": "object",
        "required": [
          "status",
          "title"
        ],
        "title": "APIErrorResponse"
      },
      "AgentVersionMetadata": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "version": {
            "type": "string",
            "title": "Version"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "title": "Description"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "title": "Createdat"
          },
          "createdBy": {
            "type": "string",
            "nullable": true,
            "title": "Createdby"
          }
        },
        "type": "object",
        "required": [
          "id",
          "version"
        ],
        "title": "AgentVersionMetadata"
      },
      "BoundingBoxRegionDetectionMode": {
        "type": "string",
        "enum": [
          "WORD_MATCHING",
          "LLM"
        ],
        "title": "BoundingBoxRegionDetectionMode"
      },
      "Dict": {
        "properties": {},
        "additionalProperties": true,
        "type": "object",
        "title": "Dict"
      },
      "ExternalAgentCreate": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Id"
          },
          "companyId": {
            "type": "string",
            "nullable": true,
            "title": "Companyid"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "example": "Agent name"
          },
          "version": {
            "type": "string",
            "nullable": true,
            "title": "Version"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "example": "Some description"
          },
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "Prompt used for agent",
            "example": "Hello GPT, how are you?"
          },
          "model": {
            "type": "string",
            "nullable": true,
            "title": "Model",
            "description": "Model UID used for this agent. If not specified, the default model will be used.",
            "example": "b099cb97-4a5c-458f-8dcf-91139e731214"
          },
          "systemPrompt": {
            "type": "string",
            "nullable": true,
            "title": "Systemprompt",
            "description": "System prompt for the agent",
            "example": "You are a helpful assistant."
          },
          "outputFormat": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Output format specification for the agent"
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit agent"
          },
          "configuration": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Additional agent configuration"
          },
          "toolIds": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "nullable": true,
            "title": "Toolids",
            "description": "Ids of the tools assigned to this agent. On create/update: null or omitted leaves the assignments unchanged (a new agent starts with none), [] removes them all, and a list replaces them with exactly this set (a change creates a new agent version). Populated on by-id reads and on a list with full=true; null in a list otherwise."
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "The type of agent (BASIC, BASIC_V2, AGENTIC, METADATA, PAGE_BY_PAGE, LLM_OCR, STATIC, CASE_CLASSIFICATION, FILE_SUMMARIZATION, SCRIPT). SCRIPT runs author-provided TypeScript (from the prompt field, rendered with full mustache context) in a sandbox and returns JSON instead of calling an LLM.",
            "example": "BASIC"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "prompt",
          "type"
        ],
        "title": "ExternalAgentCreate",
        "description": "Custom-agent create body; benign OOTB defaults are ignored, while OOTB claims are rejected."
      },
      "ExternalAgent": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "example": "dcbc075f-a99c-4199-86ed-fb4ed5684dd9"
          },
          "rootAgentId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Rootagentid",
            "example": "dcbc075f-a99c-4199-86ed-fb4ed5684dd9"
          },
          "companyId": {
            "type": "string",
            "title": "Companyid",
            "example": "6081acde0377a83b93f05a10"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "example": "Agent name"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "example": "Agent version"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "example": "Some description"
          },
          "prompt": {
            "type": "string",
            "nullable": true,
            "title": "Prompt",
            "description": "Prompt used for agent. Null in a lean list row — request `full=true` to load it.",
            "example": "Hello GPT, how are you?"
          },
          "model": {
            "type": "string",
            "nullable": true,
            "title": "Model",
            "description": "Model UID used for this agent. If not specified, the default model will be used.",
            "example": "b099cb97-4a5c-458f-8dcf-91139e731214"
          },
          "systemPrompt": {
            "type": "string",
            "nullable": true,
            "title": "Systemprompt",
            "description": "System prompt for the agent",
            "example": "You are a helpful assistant."
          },
          "outputFormat": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Output format specification for the agent"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "title": "Createdat",
            "description": "Date when Agent was added",
            "example": "2023-10-27T11:38:18.000Z"
          },
          "createdBy": {
            "type": "string",
            "nullable": true,
            "title": "Createdby",
            "description": "Agent creator",
            "example": "2023-10-27T11:38:18.000Z"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true,
            "title": "Updatedby",
            "description": "Agent updater",
            "example": "Updater"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "title": "Updatedat",
            "description": "Date when Agent was last modified",
            "example": "2023-10-27T12:38:18.000Z"
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit agent"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/ExternalAgent"
            },
            "type": "array",
            "title": "Versions",
            "description": "Other versions of this agent"
          },
          "versionsMetadata": {
            "items": {
              "$ref": "#/components/schemas/AgentVersionMetadata"
            },
            "type": "array",
            "title": "Versionsmetadata",
            "description": "Lightweight version summaries, populated when withVersionsMetadata=true"
          },
          "configuration": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Additional agent configuration"
          },
          "toolIds": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "nullable": true,
            "title": "Toolids",
            "description": "Ids of the tools assigned to this agent. On create/update: null or omitted leaves the assignments unchanged (a new agent starts with none), [] removes them all, and a list replaces them with exactly this set (a change creates a new agent version). Populated on by-id reads and on a list with full=true; null in a list otherwise."
          },
          "isOotb": {
            "type": "boolean",
            "title": "Isootb",
            "description": "Whether the agent is an out-of-the-box agent",
            "default": false
          },
          "sourceTemplateAgentId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Sourcetemplateagentid",
            "description": "Source template agent identifier"
          },
          "sourceTemplateAgentVersion": {
            "type": "string",
            "nullable": true,
            "title": "Sourcetemplateagentversion",
            "description": "Concrete source template agent version used for import"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "The type of agent (BASIC, BASIC_V2, AGENTIC, METADATA, PAGE_BY_PAGE, LLM_OCR, STATIC, CASE_CLASSIFICATION, FILE_SUMMARIZATION, SCRIPT). SCRIPT runs author-provided TypeScript (from the prompt field, rendered with full mustache context) in a sandbox and returns JSON instead of calling an LLM.",
            "example": "BASIC"
          }
        },
        "type": "object",
        "required": [
          "id",
          "companyId",
          "name",
          "version",
          "description",
          "type"
        ],
        "title": "ExternalAgent",
        "description": "An agent, as returned by the agents API."
      },
      "ExternalAgentPage": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ExternalAgent"
            },
            "type": "array",
            "title": "Data",
            "description": "The page of results."
          },
          "limit": {
            "type": "integer",
            "title": "Limit",
            "description": "The limit applied to this page. Equal to the `limit` query parameter unless it exceeded the maximum allowed value, in which case it is that maximum.",
            "example": 20
          },
          "offset": {
            "type": "integer",
            "title": "Offset",
            "description": "The offset applied to this page (echoes the `offset` query parameter).",
            "example": 0
          },
          "totalCount": {
            "type": "integer",
            "title": "Totalcount",
            "description": "The total number of elements across all pages.",
            "example": 137
          }
        },
        "type": "object",
        "required": [
          "data",
          "limit",
          "offset",
          "totalCount"
        ],
        "title": "AgentPage",
        "description": "A page of agents."
      },
      "ExternalAgentPatch": {
        "properties": {
          "companyId": {
            "type": "string",
            "nullable": true,
            "title": "Companyid"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "title": "Name"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "title": "Description"
          },
          "prompt": {
            "type": "string",
            "nullable": true,
            "title": "Prompt",
            "description": "Prompt used for agent"
          },
          "model": {
            "type": "string",
            "nullable": true,
            "title": "Model",
            "description": "Model UID used for this agent"
          },
          "systemPrompt": {
            "type": "string",
            "nullable": true,
            "title": "Systemprompt",
            "description": "System prompt for the agent"
          },
          "outputFormat": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Output format specification for the agent"
          },
          "configuration": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Additional agent configuration"
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true,
            "title": "Editors",
            "description": "Editor ids that can edit agent"
          },
          "type": {
            "type": "string",
            "nullable": true,
            "title": "Type",
            "description": "The type of agent"
          },
          "toolIds": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "nullable": true,
            "title": "Toolids",
            "description": "Ids of the tools assigned to this agent. Omitted or null leaves the assignments unchanged; [] removes them all; a list replaces them with exactly this set (a change creates a new agent version)."
          }
        },
        "type": "object",
        "title": "ExternalAgentPatch",
        "description": "Partial-update body for an agent; send only the fields to change. `name` and `companyId` are immutable."
      },
      "ExternalAgentWrite": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Id"
          },
          "companyId": {
            "type": "string",
            "nullable": true,
            "title": "Companyid"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "example": "Agent name"
          },
          "version": {
            "type": "string",
            "nullable": true,
            "title": "Version"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "example": "Some description"
          },
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "Prompt used for agent",
            "example": "Hello GPT, how are you?"
          },
          "model": {
            "type": "string",
            "nullable": true,
            "title": "Model",
            "description": "Model UID used for this agent. If not specified, the default model will be used.",
            "example": "b099cb97-4a5c-458f-8dcf-91139e731214"
          },
          "systemPrompt": {
            "type": "string",
            "nullable": true,
            "title": "Systemprompt",
            "description": "System prompt for the agent",
            "example": "You are a helpful assistant."
          },
          "outputFormat": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Output format specification for the agent"
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit agent"
          },
          "configuration": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "Additional agent configuration"
          },
          "toolIds": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "nullable": true,
            "title": "Toolids",
            "description": "Ids of the tools assigned to this agent. On create/update: null or omitted leaves the assignments unchanged (a new agent starts with none), [] removes them all, and a list replaces them with exactly this set (a change creates a new agent version). Populated on by-id reads and on a list with full=true; null in a list otherwise."
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "The type of agent (BASIC, BASIC_V2, AGENTIC, METADATA, PAGE_BY_PAGE, LLM_OCR, STATIC, CASE_CLASSIFICATION, FILE_SUMMARIZATION, SCRIPT). SCRIPT runs author-provided TypeScript (from the prompt field, rendered with full mustache context) in a sandbox and returns JSON instead of calling an LLM.",
            "example": "BASIC"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "prompt",
          "type"
        ],
        "title": "ExternalAgentWrite"
      },
      "ExternalOotbAgentPatch": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "Prompt used for agent"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Human-readable agent description"
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit agent"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ExternalOotbAgentPatch",
        "description": "Narrow external PATCH variant for a persisted OOTB agent."
      },
      "ExternalOotbWorkflowPatch": {
        "properties": {
          "workflowConfiguration": {
            "$ref": "#/components/schemas/Dict",
            "title": "Workflowconfiguration",
            "description": "Complete replacement for workflowConfiguration.steps. Send only the steps field; do not echo managed workflowConfiguration fields from a GET response. The server preserves those managed fields."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "title": "Name",
            "description": "Workflow name"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Workflow description"
          },
          "projects": {
            "type": "string",
            "title": "Projects",
            "description": "Comma separated list of projectIds"
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit workflow"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ExternalOotbWorkflowPatch",
        "description": "Narrow external PATCH variant for a persisted OOTB workflow."
      },
      "ExternalWorkflowCreate": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Id"
          },
          "companyId": {
            "type": "string",
            "nullable": true,
            "title": "Companyid"
          },
          "projects": {
            "type": "string",
            "title": "Projects",
            "description": "Comma separated list of projectIds",
            "example": "6299d91c04dd5dd5d81c99bb,63bc7bf22b5bc8f3d0625092"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name for Workflow",
            "example": "Some very nice workflow"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Model id used for prompting",
            "example": "dcbc075f-a99c-4199-86ed-fb4ed5684dd9"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "title": "Description",
            "description": "Description of Workflow",
            "example": "Some more verbose description"
          },
          "trainingCompanyId": {
            "type": "string",
            "nullable": true,
            "title": "Trainingcompanyid",
            "example": "6081acde0377a83b93f05a10"
          },
          "trainingProjects": {
            "type": "string",
            "nullable": true,
            "title": "Trainingprojects",
            "description": "Comma separated list of training projectIds used as source documents repository",
            "example": "6523b5bcac1cb469d7fc1bd9"
          },
          "similarityThreshold": {
            "type": "number",
            "nullable": true,
            "title": "Similaritythreshold",
            "description": "Defines the minimum similarity between the uploaded document and context examples from the training project",
            "example": 0.78
          },
          "useOcrTextPages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useocrtextpages",
            "description": "Ability to use ocrTextPages (Google OCR) in the prompt ",
            "default": false,
            "example": false
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit workflow"
          },
          "similarityApi": {
            "type": "boolean",
            "nullable": true,
            "title": "Similarityapi",
            "description": "Ability to set similarity service API for document training data",
            "default": true,
            "example": true
          },
          "useImages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useimages",
            "description": "Ability to set images usage to workflow",
            "default": true,
            "example": false
          },
          "maxNumTrainingDocuments": {
            "type": "integer",
            "title": "Maxnumtrainingdocuments",
            "description": "Maximum number of training documents used in the workflow",
            "default": 1,
            "example": 2
          },
          "bboxRegionDetectionMode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BoundingBoxRegionDetectionMode"
              }
            ],
            "type": "string",
            "nullable": true,
            "description": "The bounding boxes region detection mode of prompting-settings",
            "example": "WORD_MATCHING"
          },
          "workflowType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowType"
              }
            ],
            "type": "string",
            "nullable": true,
            "description": "Type of workflow (EXTRACTION returns value-form entities, PREPROCESSING returns raw JSON)",
            "default": "EXTRACTION"
          },
          "workflowConfiguration": {
            "$ref": "#/components/schemas/Dict",
            "description": "The workflow's step configuration: the agents to run and how they are chained"
          }
        },
        "type": "object",
        "required": [
          "projects",
          "name",
          "model",
          "workflowConfiguration"
        ],
        "title": "ExternalWorkflowCreate",
        "description": "Custom-workflow create body; OOTB identity and import provenance are server-managed."
      },
      "ExternalWorkflow": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Id",
            "example": "dcbc075f-a99c-4199-86ed-fb4ed5684dd9"
          },
          "companyId": {
            "type": "string",
            "title": "Companyid",
            "example": "6081acde0377a83b93f05a10"
          },
          "projects": {
            "type": "string",
            "title": "Projects",
            "description": "Comma separated list of projectIds",
            "example": "6299d91c04dd5dd5d81c99bb,63bc7bf22b5bc8f3d0625092"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name for Workflow",
            "example": "Some very nice workflow"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Model id used for prompting",
            "example": "dcbc075f-a99c-4199-86ed-fb4ed5684dd9"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "title": "Description",
            "description": "Description of Workflow",
            "example": "Some more verbose description"
          },
          "trainingCompanyId": {
            "type": "string",
            "nullable": true,
            "title": "Trainingcompanyid",
            "example": "6081acde0377a83b93f05a10"
          },
          "trainingProjects": {
            "type": "string",
            "nullable": true,
            "title": "Trainingprojects",
            "description": "Comma separated list of training projectIds used as source documents repository",
            "example": "6523b5bcac1cb469d7fc1bd9"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "title": "Createdat",
            "description": "Date when Workflow was added",
            "example": "2023-10-27T11:38:18.000Z"
          },
          "createdBy": {
            "type": "string",
            "nullable": true,
            "title": "Createdby",
            "description": "Id of the caller that created the workflow; an OAuth client id when created via this API",
            "example": "acme-integration"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true,
            "title": "Updatedby",
            "description": "Id of the caller that last updated the workflow; an OAuth client id when updated via this API",
            "example": "acme-integration"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "title": "Updatedat",
            "description": "Date when Workflow was last modified",
            "example": "2023-10-27T12:38:18.000Z"
          },
          "similarityThreshold": {
            "type": "number",
            "nullable": true,
            "title": "Similaritythreshold",
            "description": "Defines the minimum similarity between the uploaded document and context examples from the training project",
            "example": 0.78
          },
          "useOcrTextPages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useocrtextpages",
            "description": "Ability to use ocrTextPages (Google OCR) in the prompt ",
            "default": false,
            "example": false
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit workflow"
          },
          "similarityApi": {
            "type": "boolean",
            "nullable": true,
            "title": "Similarityapi",
            "description": "Ability to set similarity service API for document training data",
            "default": true,
            "example": true
          },
          "useImages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useimages",
            "description": "Ability to set images usage to workflow",
            "default": true,
            "example": false
          },
          "maxNumTrainingDocuments": {
            "type": "integer",
            "title": "Maxnumtrainingdocuments",
            "description": "Maximum number of training documents used in the workflow",
            "default": 1,
            "example": 2
          },
          "bboxRegionDetectionMode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BoundingBoxRegionDetectionMode"
              }
            ],
            "type": "string",
            "nullable": true,
            "description": "The bounding boxes region detection mode of prompting-settings",
            "example": "WORD_MATCHING"
          },
          "workflowType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowType"
              }
            ],
            "type": "string",
            "nullable": true,
            "description": "Type of workflow (EXTRACTION returns value-form entities, PREPROCESSING returns raw JSON)",
            "default": "EXTRACTION"
          },
          "workflowConfiguration": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true,
            "description": "The workflow's step configuration: the agents to run and how they are chained"
          },
          "version": {
            "type": "string",
            "nullable": true,
            "title": "Version",
            "description": "Workflow version"
          },
          "sourceWorkflowId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Sourceworkflowid",
            "description": "Source workflow identifier for imported workflows"
          },
          "sourceWorkflowVersion": {
            "type": "string",
            "nullable": true,
            "title": "Sourceworkflowversion",
            "description": "Concrete source workflow version used for import"
          },
          "isOotb": {
            "type": "boolean",
            "title": "Isootb",
            "description": "Whether persisted import provenance classifies this workflow as OOTB",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "companyId",
          "projects",
          "name",
          "model"
        ],
        "title": "Workflow",
        "description": "A workflow, as returned by the workflows API."
      },
      "ExternalWorkflowPage": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ExternalWorkflow"
            },
            "type": "array",
            "title": "Data",
            "description": "The page of results."
          },
          "limit": {
            "type": "integer",
            "title": "Limit",
            "description": "The limit applied to this page. Equal to the `limit` query parameter unless it exceeded the maximum allowed value, in which case it is that maximum.",
            "example": 20
          },
          "offset": {
            "type": "integer",
            "title": "Offset",
            "description": "The offset applied to this page (echoes the `offset` query parameter).",
            "example": 0
          },
          "totalCount": {
            "type": "integer",
            "title": "Totalcount",
            "description": "The total number of elements across all pages.",
            "example": 137
          }
        },
        "type": "object",
        "required": [
          "data",
          "limit",
          "offset",
          "totalCount"
        ],
        "title": "WorkflowPage",
        "description": "A page of workflows."
      },
      "ExternalWorkflowPatch": {
        "properties": {
          "companyId": {
            "type": "string",
            "nullable": true,
            "title": "Companyid"
          },
          "projects": {
            "type": "string",
            "nullable": true,
            "title": "Projects",
            "description": "Comma separated list of projectIds"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "title": "Name",
            "description": "Name for Workflow"
          },
          "model": {
            "type": "string",
            "nullable": true,
            "title": "Model",
            "description": "Model id used for prompting"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "title": "Description",
            "description": "Description of Workflow"
          },
          "trainingCompanyId": {
            "type": "string",
            "nullable": true,
            "title": "Trainingcompanyid"
          },
          "trainingProjects": {
            "type": "string",
            "nullable": true,
            "title": "Trainingprojects",
            "description": "Comma separated list of training projectIds"
          },
          "similarityThreshold": {
            "type": "number",
            "nullable": true,
            "title": "Similaritythreshold"
          },
          "useOcrTextPages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useocrtextpages"
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true,
            "title": "Editors",
            "description": "Editor ids that can edit workflow"
          },
          "similarityApi": {
            "type": "boolean",
            "nullable": true,
            "title": "Similarityapi"
          },
          "useImages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useimages"
          },
          "maxNumTrainingDocuments": {
            "type": "integer",
            "nullable": true,
            "title": "Maxnumtrainingdocuments"
          },
          "bboxRegionDetectionMode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BoundingBoxRegionDetectionMode"
              }
            ],
            "type": "string",
            "nullable": true
          },
          "workflowType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowType"
              }
            ],
            "type": "string",
            "nullable": true
          },
          "workflowConfiguration": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dict"
              }
            ],
            "type": "object",
            "nullable": true
          }
        },
        "type": "object",
        "title": "ExternalWorkflowPatch",
        "description": "Partial-update body for a workflow; send only the fields to change. `companyId` is immutable."
      },
      "ExternalWorkflowWrite": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "title": "Id"
          },
          "companyId": {
            "type": "string",
            "nullable": true,
            "title": "Companyid"
          },
          "projects": {
            "type": "string",
            "title": "Projects",
            "description": "Comma separated list of projectIds",
            "example": "6299d91c04dd5dd5d81c99bb,63bc7bf22b5bc8f3d0625092"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name for Workflow",
            "example": "Some very nice workflow"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Model id used for prompting",
            "example": "dcbc075f-a99c-4199-86ed-fb4ed5684dd9"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "title": "Description",
            "description": "Description of Workflow",
            "example": "Some more verbose description"
          },
          "trainingCompanyId": {
            "type": "string",
            "nullable": true,
            "title": "Trainingcompanyid",
            "example": "6081acde0377a83b93f05a10"
          },
          "trainingProjects": {
            "type": "string",
            "nullable": true,
            "title": "Trainingprojects",
            "description": "Comma separated list of training projectIds used as source documents repository",
            "example": "6523b5bcac1cb469d7fc1bd9"
          },
          "similarityThreshold": {
            "type": "number",
            "nullable": true,
            "title": "Similaritythreshold",
            "description": "Defines the minimum similarity between the uploaded document and context examples from the training project",
            "example": 0.78
          },
          "useOcrTextPages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useocrtextpages",
            "description": "Ability to use ocrTextPages (Google OCR) in the prompt ",
            "default": false,
            "example": false
          },
          "editors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Editors",
            "description": "Editor ids that can edit workflow"
          },
          "similarityApi": {
            "type": "boolean",
            "nullable": true,
            "title": "Similarityapi",
            "description": "Ability to set similarity service API for document training data",
            "default": true,
            "example": true
          },
          "useImages": {
            "type": "boolean",
            "nullable": true,
            "title": "Useimages",
            "description": "Ability to set images usage to workflow",
            "default": true,
            "example": false
          },
          "maxNumTrainingDocuments": {
            "type": "integer",
            "title": "Maxnumtrainingdocuments",
            "description": "Maximum number of training documents used in the workflow",
            "default": 1,
            "example": 2
          },
          "bboxRegionDetectionMode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BoundingBoxRegionDetectionMode"
              }
            ],
            "type": "string",
            "nullable": true,
            "description": "The bounding boxes region detection mode of prompting-settings",
            "example": "WORD_MATCHING"
          },
          "workflowType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowType"
              }
            ],
            "type": "string",
            "nullable": true,
            "description": "Type of workflow (EXTRACTION returns value-form entities, PREPROCESSING returns raw JSON)",
            "default": "EXTRACTION"
          },
          "workflowConfiguration": {
            "$ref": "#/components/schemas/Dict",
            "description": "The workflow's step configuration: the agents to run and how they are chained"
          },
          "version": {
            "type": "string",
            "nullable": true,
            "title": "Version"
          }
        },
        "type": "object",
        "required": [
          "projects",
          "name",
          "model",
          "workflowConfiguration"
        ],
        "title": "ExternalWorkflowWrite",
        "description": "Replace (PUT) body for a custom workflow."
      },
      "WorkflowType": {
        "type": "string",
        "enum": [
          "EXTRACTION",
          "PREPROCESSING"
        ],
        "title": "WorkflowType"
      },
      "APIErrorResponse1": {
        "properties": {
          "status": {
            "type": "integer",
            "title": "Status code",
            "example": 404
          },
          "title": {
            "type": "string",
            "title": "Error title",
            "example": "Not Found"
          },
          "detail": {
            "type": "string",
            "title": "Error details",
            "example": "Details information"
          }
        },
        "type": "object",
        "required": [
          "status",
          "title"
        ],
        "title": "APIErrorResponse"
      },
      "ProcessingModeListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ProcessingModeResponse"
            },
            "type": "array",
            "title": "Processing modes list"
          },
          "totalCount": {
            "type": "integer",
            "title": "The total number of elements of the data attribute.",
            "example": 3
          },
          "limit": {
            "type": "integer",
            "title": "The limit used for this page of results. This will be the same as the limit query parameter unless it exceeds the maximal allowed value.",
            "example": 20
          },
          "offset": {
            "type": "integer",
            "title": "The offset used for this page of results. This will be the same as the offset query parameter.",
            "example": 0
          }
        },
        "type": "object",
        "required": [
          "data",
          "totalCount",
          "limit",
          "offset"
        ],
        "title": "ProcessingModeListResponse"
      },
      "ProcessingModeResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Processing mode identifier",
            "example": "65327bc75e386382268d13d3"
          },
          "name": {
            "type": "string",
            "title": "Processing mode display name",
            "example": "Invoice Extraction"
          },
          "disabled": {
            "type": "boolean",
            "title": "Whether the processing mode is disabled",
            "example": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "disabled"
        ],
        "title": "ProcessingModeResponse"
      },
      "Error": {
        "required": [
          "detail",
          "status",
          "title"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "description": "A human readable explanation of the error."
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "The HTTP status code.",
            "minimum": 100,
            "maximum": 599
          },
          "title": {
            "type": "string",
            "description": "A short summary of the error"
          }
        }
      },
      "document": {
        "type": "object",
        "description": "Reference to document uploaded to Hypatos Studio",
        "properties": {
          "id": {
            "type": "string",
            "description": "Document id that was assigned during upload to Hypatos",
            "example": "63cac12c37bb02accb396cae",
            "pattern": "^[0-9a-fA-F]{24}$"
          },
          "type": {
            "type": "string",
            "description": "Document type that was assigned during upload to Hypatos",
            "example": "invoice",
            "pattern": "^\\S+$"
          }
        }
      },
      "CurrencyCode": {
        "type": "string",
        "nullable": true,
        "description": "Three letter currency code as defined in ISO 4217",
        "example": "EUR",
        "enum": [
          "AED",
          "AFN",
          "ALL",
          "AMD",
          "ANG",
          "AOA",
          "ARS",
          "AUD",
          "AWG",
          "AZN",
          "BAM",
          "BBD",
          "BDT",
          "BGN",
          "BHD",
          "BIF",
          "BMD",
          "BND",
          "BOB",
          "BOV",
          "BRL",
          "BSD",
          "BTN",
          "BWP",
          "BYN",
          "BZD",
          "CAD",
          "CDF",
          "CHE",
          "CHF",
          "CHW",
          "CLF",
          "CLP",
          "CNY",
          "COP",
          "COU",
          "CRC",
          "CUC",
          "CUP",
          "CVE",
          "CZK",
          "DJF",
          "DKK",
          "DOP",
          "DZD",
          "EGP",
          "ERN",
          "ETB",
          "EUR",
          "FJD",
          "FKP",
          "GBP",
          "GEL",
          "GHS",
          "GIP",
          "GMD",
          "GNF",
          "GTQ",
          "GYD",
          "HKD",
          "HNL",
          "HRK",
          "HTG",
          "HUF",
          "IDR",
          "ILS",
          "INR",
          "IQD",
          "IRR",
          "ISK",
          "JMD",
          "JOD",
          "JPY",
          "KES",
          "KGS",
          "KHR",
          "KMF",
          "KPW",
          "KRW",
          "KWD",
          "KYD",
          "KZT",
          "LAK",
          "LBP",
          "LKR",
          "LRD",
          "LSL",
          "LYD",
          "MAD",
          "MDL",
          "MGA",
          "MKD",
          "MMK",
          "MNT",
          "MOP",
          "MRU",
          "MUR",
          "MVR",
          "MWK",
          "MXN",
          "MXV",
          "MYR",
          "MZN",
          "NAD",
          "NGN",
          "NIO",
          "NOK",
          "NPR",
          "NZD",
          "OMR",
          "PAB",
          "PEN",
          "PGK",
          "PHP",
          "PKR",
          "PLN",
          "PYG",
          "QAR",
          "RON",
          "RSD",
          "RUB",
          "RWF",
          "SAR",
          "SBD",
          "SCR",
          "SDG",
          "SEK",
          "SGD",
          "SHP",
          "SLE",
          "SLL",
          "SOS",
          "SRD",
          "SSP",
          "STN",
          "SVC",
          "SYP",
          "SZL",
          "THB",
          "TJS",
          "TMT",
          "TND",
          "TOP",
          "TRY",
          "TTD",
          "TWD",
          "TZS",
          "UAH",
          "UGX",
          "USD",
          "USN",
          "UYI",
          "UYU",
          "UYW",
          "UZS",
          "VED",
          "VES",
          "VND",
          "VUV",
          "WST",
          "XAF",
          "XAG",
          "XAU",
          "XBA",
          "XBB",
          "XBC",
          "XBD",
          "XCD",
          "XDR",
          "XOF",
          "XPD",
          "XPF",
          "XPT",
          "XSU",
          "XTS",
          "XUA",
          "XXX",
          "YER",
          "ZAR",
          "ZMW",
          "ZWL",
          null
        ]
      },
      "LanguageCode": {
        "type": "string",
        "nullable": true,
        "description": "Two letter language code as defined in ISO 639-1",
        "example": "en",
        "enum": [
          "aa",
          "ab",
          "ae",
          "af",
          "ak",
          "am",
          "an",
          "ar",
          "as",
          "av",
          "ay",
          "az",
          "ba",
          "be",
          "bg",
          "bh",
          "bi",
          "bm",
          "bn",
          "bo",
          "br",
          "bs",
          "ca",
          "ce",
          "ch",
          "co",
          "cr",
          "cs",
          "cu",
          "cv",
          "cy",
          "da",
          "de",
          "dv",
          "dz",
          "ee",
          "el",
          "en",
          "eo",
          "es",
          "et",
          "eu",
          "fa",
          "ff",
          "fi",
          "fj",
          "fo",
          "fr",
          "fy",
          "ga",
          "gd",
          "gl",
          "gn",
          "gu",
          "gv",
          "ha",
          "he",
          "hi",
          "ho",
          "hr",
          "ht",
          "hu",
          "hy",
          "hz",
          "ia",
          "id",
          "ie",
          "ig",
          "ii",
          "ik",
          "io",
          "is",
          "it",
          "iu",
          "ja",
          "jv",
          "ka",
          "kg",
          "ki",
          "kj",
          "kk",
          "kl",
          "km",
          "kn",
          "ko",
          "kr",
          "ks",
          "ku",
          "kv",
          "kw",
          "ky",
          "la",
          "lb",
          "lg",
          "li",
          "ln",
          "lo",
          "lt",
          "lu",
          "lv",
          "mg",
          "mh",
          "mi",
          "mk",
          "ml",
          "mn",
          "mr",
          "ms",
          "mt",
          "my",
          "na",
          "nb",
          "nd",
          "ne",
          "ng",
          "nl",
          "nn",
          "no",
          "nr",
          "nv",
          "ny",
          "oc",
          "oj",
          "om",
          "or",
          "os",
          "pa",
          "pi",
          "pl",
          "ps",
          "pt",
          "qu",
          "rm",
          "rn",
          "ro",
          "ru",
          "rw",
          "sa",
          "sc",
          "sd",
          "se",
          "sg",
          "si",
          "sk",
          "sl",
          "sm",
          "sn",
          "so",
          "sq",
          "sr",
          "ss",
          "st",
          "su",
          "sv",
          "sw",
          "ta",
          "te",
          "tg",
          "th",
          "ti",
          "tk",
          "tl",
          "tn",
          "to",
          "tr",
          "ts",
          "tt",
          "tw",
          "ty",
          "ug",
          "uk",
          "ur",
          "uz",
          "ve",
          "vi",
          "vo",
          "wa",
          "wo",
          "xh",
          "yi",
          "yo",
          "za",
          "zh",
          "zu",
          null
        ]
      },
      "languagedText": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Text content",
            "example": "Fish & Chips"
          },
          "language": {
            "$ref": "#/components/schemas/LanguageCode"
          }
        }
      },
      "paymentTerms": {
        "type": "object",
        "properties": {
          "paymentTermKey": {
            "type": "string",
            "description": "Key of the payment term as defined in the source system",
            "example": "T10"
          },
          "descriptions": {
            "type": "array",
            "description": "Descriptions of the payment terms in different languages",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Please pay us",
                "language": "en"
              }
            ]
          }
        }
      },
      "customFields": {
        "type": "object",
        "description": "List of key value pairs containing custom fields from the source system",
        "additionalProperties": {
          "type": "string"
        }
      },
      "JsonObject": {
        "type": "object",
        "description": "Any nested structure with metadata that source system needs to send",
        "additionalProperties": true,
        "example": {
          "someTopLevelProperty": "value1",
          "someNestedProperty": {
            "nestedProperty": "value2"
          },
          "someArrayProperty": [
            "value3",
            "value4"
          ]
        }
      },
      "accountAssignment": {
        "type": "object",
        "properties": {
          "externalGlAccountId": {
            "type": "string",
            "description": "External unique id of the general ledger account in the source system",
            "example": "0000100GL1"
          },
          "externalCostCenterId": {
            "type": "string",
            "description": "External unique id of the cost center in the source system",
            "example": "0000100CO1"
          },
          "glAccountCode": {
            "type": "string",
            "description": "General ledger account code",
            "example": "GL1"
          },
          "costCenterCode": {
            "type": "string",
            "description": "Cost center code",
            "example": "CO1"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the invoice line (split of the quantity in case of several accountAssignments)",
            "example": 2
          },
          "externalProjectId": {
            "type": "string",
            "description": "External id for project assignment",
            "example": "EPI1"
          },
          "externalOrderId": {
            "type": "string",
            "description": "External id for order assignment",
            "example": "EOI1"
          },
          "costElementCode": {
            "type": "string",
            "description": "Cost element code assignment",
            "example": "CE1"
          },
          "externalProfitCenterId": {
            "type": "string",
            "description": "External unique id of the profit center in the source system",
            "example": "EPCI1"
          },
          "profitCenterCode": {
            "type": "string",
            "description": "Profit center code",
            "example": "PCC1"
          }
        }
      },
      "taxCode": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Unique code of the type of tax in the source system",
            "example": "DEU_Standard"
          },
          "description": {
            "type": "string",
            "description": "Description of the type of tax in the source system",
            "example": "DEU - Standard (19%)"
          }
        }
      },
      "invoiceLine": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the invoice line that is globally unique across the provided invoice line data",
            "example": "00000001",
            "pattern": "^\\S+$"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "Company that the invoice line is assigned to",
            "example": "DE01"
          },
          "accountAssignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/accountAssignment"
            }
          },
          "type": {
            "type": "string",
            "description": "type of the invoice line as defined in the source system",
            "example": "Service"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the invoice line (sum of all quantity splits in case of several accountAssignments)",
            "example": 2
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount of the invoice line",
            "example": 1.23
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount of the invoice line",
            "example": 1.23
          },
          "grossAmount": {
            "type": "number",
            "description": "Gross amount of the invoice line",
            "example": 100.01
          },
          "unitOfMeasure": {
            "type": "string",
            "description": "Unit of measure of the invoice line",
            "example": "kg"
          },
          "unitPrice": {
            "type": "number",
            "description": "Price for one unit of the invoice line",
            "example": 19.0123
          },
          "taxCode": {
            "$ref": "#/components/schemas/taxCode"
          },
          "taxJurisdictionCode": {
            "type": "string",
            "description": "tax jurisdiction code assigned to the invoice",
            "example": "PA0000000"
          },
          "itemText": {
            "type": "string",
            "description": "Text describing the invoice line item",
            "example": "Virtual Event ABC"
          },
          "externalPurchaseOrderId": {
            "type": "string",
            "description": "Purchase order related to the invoice line item",
            "example": "4500016221"
          },
          "purchaseOrderLineNumber": {
            "type": "string",
            "description": "Reference to the purchase order line item assigned to the invoice line item",
            "example": "00010"
          },
          "salesOrderNumber": {
            "type": "string",
            "description": "Sales order related to the invoice line item",
            "example": "45001234"
          },
          "salesOrderLineNumber": {
            "type": "string",
            "description": "Reference to the sales order line item assigned to the invoice line item",
            "example": "20"
          },
          "centralBankIndicator": {
            "type": "string",
            "description": "State Central Bank Indicator for reporting foreign payment transactions according to the German Foreign Trade and Payments Ordinance (Außenwirtschaftsverordnung - AWV)",
            "example": "123"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "withholdingTax": {
        "type": "object",
        "description": "Withholding tax information related to a posted invoice",
        "properties": {
          "key": {
            "type": "string",
            "description": "Key that the source system uses to clearly identify the type of withholding tax that needs to be paid",
            "example": "WHT-432"
          },
          "baseAmount": {
            "type": "number",
            "description": "Base amount that the tax rate of the specific withholding tax type is applied to",
            "example": 632.78
          },
          "amount": {
            "type": "number",
            "description": "Tax amount that was paid for the specific withholding tax type",
            "example": 21.39
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          }
        }
      },
      "invoice": {
        "required": [
          "externalId",
          "invoiceLines"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the invoice that is globally unique across the provided invoice data",
            "example": "SUPPLIER_INVOICE-3-1",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "documentId": {
            "type": "string",
            "description": "Document id that was assigned during upload to Hypatos",
            "example": "63cac12c37bb02accb396cae",
            "pattern": "^[0-9a-fA-F]{24}$"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/document"
            }
          },
          "supplierInvoiceNumber": {
            "type": "string",
            "description": "Invoice number provided by the issuing supplier",
            "example": "10000001"
          },
          "invoiceNumber": {
            "type": "string",
            "description": "Number of the invoice in the source system (not unique across clients)",
            "example": "12345"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "External unique id of the company in the source system",
            "example": "DE01"
          },
          "externalSupplierId": {
            "type": "string",
            "description": "External unique id of the supplier in the source system",
            "example": "0000100000"
          },
          "externalBankAccountId": {
            "type": "string",
            "description": "External unique id of the bank account that the invoice payment was transferred to",
            "example": "12341234"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Label used in the source system for the fiscal year that the invoice was posted in",
            "example": "2023"
          },
          "issuedDate": {
            "type": "string",
            "description": "Date when the invoice was issued by the supplier (printed on invoice document)",
            "format": "date",
            "example": "2000-12-31"
          },
          "receivedDate": {
            "type": "string",
            "description": "Date when the invoice was recieved by the company",
            "format": "date",
            "example": "2000-12-31"
          },
          "postingDate": {
            "type": "string",
            "description": "Date when the invoice was posted in the source system",
            "format": "date",
            "example": "2000-12-31"
          },
          "isCanceled": {
            "type": "boolean",
            "description": "Indicator if the invoice is canceled",
            "example": false
          },
          "isCreditNote": {
            "type": "boolean",
            "description": "Indicator if the document is a credit note"
          },
          "externalCustomerId": {
            "type": "string",
            "description": "External unique id of the customer in the source system"
          },
          "relatedInvoice": {
            "type": "string",
            "description": "externalInvoiceId of related invoice",
            "example": "SUPPLIER_INVOICE-3-2"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "totalNetAmount": {
            "type": "number",
            "description": "Total net amount of invoice (sum of line item net amounts)",
            "example": 81
          },
          "totalFreightCharges": {
            "type": "number",
            "description": "Sum of all freight charges",
            "example": 9
          },
          "totalOtherCharges": {
            "type": "number",
            "description": "Sum of all charges other than freight charges",
            "example": 10
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount of invoice (sum of all taxes)",
            "example": 19
          },
          "totalGrossAmount": {
            "type": "number",
            "description": "Total gross amount of invoice (total net amount + total freight charges + total other charges + total tax amount)",
            "example": 119
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/paymentTerms"
          },
          "externalApproverId": {
            "type": "string",
            "description": "External unique id of the first approver of an invoice in the source system",
            "example": "UserID#1234"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "headerText": {
            "type": "string",
            "description": "Header Text describing the invoice",
            "example": "doc header text"
          },
          "type": {
            "type": "string",
            "description": "type of the invoice as defined in th source system",
            "example": "FI"
          },
          "invoiceLines": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/invoiceLine"
            }
          },
          "withholdingTax": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/withholdingTax"
            }
          },
          "documentType": {
            "type": "string",
            "description": "document type as defined in the source system",
            "example": "supplier invoice"
          }
        }
      },
      "CountryCode": {
        "type": "string",
        "nullable": true,
        "description": "Two letter country code as defined in ISO 3166-1 alpha-2",
        "example": "DE",
        "enum": [
          "AF",
          "AX",
          "AL",
          "DZ",
          "AS",
          "AD",
          "AO",
          "AI",
          "AQ",
          "AG",
          "AR",
          "AM",
          "AW",
          "AU",
          "AT",
          "AZ",
          "BS",
          "BH",
          "BD",
          "BB",
          "BY",
          "BE",
          "BZ",
          "BJ",
          "BM",
          "BT",
          "BO",
          "BQ",
          "BA",
          "BW",
          "BV",
          "BR",
          "IO",
          "BN",
          "BG",
          "BF",
          "BI",
          "KH",
          "CM",
          "CA",
          "CV",
          "KY",
          "CF",
          "TD",
          "CL",
          "CN",
          "CX",
          "CC",
          "CO",
          "KM",
          "CG",
          "CD",
          "CK",
          "CR",
          "CI",
          "HR",
          "CU",
          "CW",
          "CY",
          "CZ",
          "DK",
          "DJ",
          "DM",
          "DO",
          "EC",
          "EG",
          "SV",
          "GQ",
          "ER",
          "EE",
          "ET",
          "FK",
          "FO",
          "FJ",
          "FI",
          "FR",
          "GF",
          "PF",
          "TF",
          "GA",
          "GM",
          "GE",
          "DE",
          "GH",
          "GI",
          "GR",
          "GL",
          "GD",
          "GP",
          "GU",
          "GT",
          "GG",
          "GN",
          "GW",
          "GY",
          "HT",
          "HM",
          "VA",
          "HN",
          "HK",
          "HU",
          "IS",
          "IN",
          "ID",
          "IR",
          "IQ",
          "IE",
          "IM",
          "IL",
          "IT",
          "JM",
          "JP",
          "JE",
          "JO",
          "KZ",
          "KE",
          "KI",
          "KP",
          "KR",
          "KW",
          "KG",
          "LA",
          "LV",
          "LB",
          "LS",
          "LR",
          "LY",
          "LI",
          "LT",
          "LU",
          "MO",
          "MK",
          "MG",
          "MW",
          "MY",
          "MV",
          "ML",
          "MT",
          "MH",
          "MQ",
          "MR",
          "MU",
          "YT",
          "MX",
          "FM",
          "MD",
          "MC",
          "MN",
          "ME",
          "MS",
          "MA",
          "MZ",
          "MM",
          "NA",
          "NR",
          "NP",
          "NL",
          "NC",
          "NZ",
          "NI",
          "NE",
          "NG",
          "NU",
          "NF",
          "MP",
          "NO",
          "OM",
          "PK",
          "PW",
          "PS",
          "PA",
          "PG",
          "PY",
          "PE",
          "PH",
          "PN",
          "PL",
          "PT",
          "PR",
          "QA",
          "RE",
          "RO",
          "RU",
          "RW",
          "BL",
          "SH",
          "KN",
          "LC",
          "MF",
          "PM",
          "VC",
          "WS",
          "SM",
          "ST",
          "SA",
          "SN",
          "RS",
          "SC",
          "SL",
          "SG",
          "SX",
          "SK",
          "SI",
          "SB",
          "SO",
          "ZA",
          "GS",
          "SS",
          "ES",
          "LK",
          "SD",
          "SR",
          "SJ",
          "SZ",
          "SE",
          "CH",
          "SY",
          "TW",
          "TJ",
          "TZ",
          "TH",
          "TL",
          "TG",
          "TK",
          "TO",
          "TT",
          "TN",
          "TR",
          "TM",
          "TC",
          "TV",
          "UG",
          "UA",
          "AE",
          "GB",
          "US",
          "UM",
          "UY",
          "UZ",
          "VU",
          "VE",
          "VN",
          "VG",
          "VI",
          "WF",
          "EH",
          "YE",
          "ZM",
          "ZW",
          null
        ]
      },
      "vatId": {
        "type": "object",
        "description": "List of VAT IDs assigned to the company",
        "properties": {
          "id": {
            "type": "string"
          },
          "countryCode": {
            "$ref": "#/components/schemas/CountryCode"
          }
        },
        "example": [
          {
            "id": "DE123456789",
            "countryCode": "DE"
          }
        ]
      },
      "taxId": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "example": [
          {
            "id": "123-456-789",
            "type": "TIN"
          }
        ]
      },
      "company": {
        "required": [
          "name",
          "externalId"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the company that is globally unique across the provided company data",
            "example": "DE01",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "code": {
            "type": "string",
            "description": "Code of the company in the source system (not unique across clients)",
            "example": "CODE1"
          },
          "name": {
            "type": "string",
            "description": "Name of the company",
            "example": "Acmne Corp.",
            "pattern": "^[\\S ]*\\S[\\S ]*$"
          },
          "nameAlternative1": {
            "type": "string",
            "description": "Alternative name of the company",
            "example": "Acmne Corp."
          },
          "nameAlternative2": {
            "type": "string",
            "description": "Alternative name of the company",
            "example": "Acmne Corp."
          },
          "nameAlternative3": {
            "type": "string",
            "description": "Alternative name of the company",
            "example": "Acmne Corp."
          },
          "nameAlternative4": {
            "type": "string",
            "description": "Alternative name of the company",
            "example": "Acmne Corp."
          },
          "street": {
            "type": "string",
            "description": "Street and street number where the company is located",
            "example": "Hauptstr. 1"
          },
          "addressAdditional": {
            "type": "string",
            "description": "Additional address data (e.g. apartment or suite)",
            "example": "Eingang B"
          },
          "postcode": {
            "type": "string",
            "description": "Postcode where the company is located",
            "example": "10001"
          },
          "city": {
            "type": "string",
            "description": "City where the company is located",
            "example": "Berlin"
          },
          "state": {
            "type": "string",
            "description": "State where the company is located",
            "example": "Berlin"
          },
          "countryCode": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "vatIds": {
            "type": "array",
            "description": "List of VAT IDs assigned to the company",
            "example": [
              {
                "id": "DE123456789",
                "countryCode": "DE"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/vatId"
            }
          },
          "taxIds": {
            "type": "array",
            "description": "List of Tax IDs assigned to the company",
            "example": [
              {
                "id": "123-456-789",
                "type": "TIN"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/taxId"
            }
          },
          "globalLocationNumber": {
            "type": "string",
            "description": "13-digit Global Location Number (GLN) used for unique location identification in B2B transactions",
            "example": "4000001000002"
          },
          "duns": {
            "type": "string",
            "description": "D-U-N-S Number issued by Dun & Bradstreet. A globally used identifier for business entities.",
            "example": "123456789"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "defaultAssignments": {
        "type": "object",
        "properties": {
          "defaultAccountAssignment": {
            "type": "object",
            "properties": {
              "glAccountCode": {
                "type": "string",
                "description": "Default general ledger account that is assigned to the supplier",
                "example": "0000100GL1"
              },
              "costCenterCode": {
                "type": "string",
                "description": "Default cost center account that is assigned to the supplier",
                "example": "0000100CC1"
              },
              "externalApproverId": {
                "type": "string",
                "description": "Default external approver ID that is assigned to the supplier",
                "example": "MMUSTERMANN"
              },
              "externalProjectId": {
                "type": "string",
                "description": "Default external project ID that is assigned to the supplier",
                "example": "PROJ1234"
              },
              "externalOrderId": {
                "type": "string",
                "description": "Default external order ID that is assigned to the supplier",
                "example": "ORDER1234"
              }
            }
          }
        }
      },
      "withholdingTaxInfo": {
        "type": "object",
        "description": "Withholding tax information related to a supplier",
        "properties": {
          "key": {
            "type": "string",
            "description": "Key that the source system uses to clearly identify the type of withholding tax that needs to be paid",
            "example": "WHT-432"
          },
          "descriptions": {
            "type": "array",
            "description": "Descriptions of the type of withholding tax",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Some very deep description of the type of withholding tax",
                "language": "en"
              }
            ]
          }
        }
      },
      "subsidiary": {
        "allOf": [
          {
            "$ref": "#/components/schemas/defaultAssignments"
          },
          {
            "type": "object",
            "required": [
              "externalCompanyId"
            ],
            "properties": {
              "externalCompanyId": {
                "type": "string",
                "description": "External unique id of the company that the subsidiary is assigned to",
                "example": "DE01"
              },
              "paymentTerms": {
                "$ref": "#/components/schemas/paymentTerms"
              },
              "blockedForPosting": {
                "type": "boolean",
                "description": "Indicator if the subsidiary is blocked for posting",
                "example": false
              },
              "blockedForPayment": {
                "type": "boolean",
                "description": "Indicator if the subsidiary is blocked for payment",
                "example": false
              },
              "enabledForAutoPosting": {
                "type": "boolean",
                "description": "Indicator if the subsidiary is enabled for auto posting",
                "example": true
              },
              "withholdingTaxInfo": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/withholdingTaxInfo"
                }
              }
            }
          }
        ]
      },
      "bankAccount": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the bank account that is globally unique across the provided bank account data",
            "example": "12341234",
            "pattern": "^\\S+$"
          },
          "countryCode": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "bankAccountNumber": {
            "type": "string",
            "description": "Bank account number of the bank account",
            "example": "78090"
          },
          "bankAccountHolder": {
            "type": "string",
            "description": "Name of the bank account holder",
            "example": "Maximilian Mustermann"
          },
          "iban": {
            "type": "string",
            "description": "IBAN of the bank account",
            "example": "DE91100000000123456789"
          },
          "bic": {
            "type": "string",
            "description": "Bank identifier code",
            "example": "CHASUS33XXX"
          },
          "bankName": {
            "type": "string",
            "description": "Name of the bank where the bank account is held",
            "example": "Deutsche Bank"
          },
          "bankStreet": {
            "type": "string",
            "description": "Street and street number where the bank is located",
            "example": "Hauptstr. 1"
          },
          "bankPostcode": {
            "type": "string",
            "description": "Postcode where the bank is located.",
            "example": "10001"
          },
          "bankCity": {
            "type": "string",
            "description": "City where the bank is located.",
            "example": "Berlin"
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "type": {
            "type": "string",
            "description": "Type of bank account.",
            "example": "SAVINGS"
          },
          "bankKey": {
            "type": "string",
            "description": "Unique key of the bank.",
            "example": "60-16-13"
          }
        }
      },
      "supplier": {
        "allOf": [
          {
            "$ref": "#/components/schemas/defaultAssignments"
          },
          {
            "type": "object",
            "required": [
              "name",
              "externalId"
            ],
            "properties": {
              "externalId": {
                "type": "string",
                "description": "External id of the supplier that is globally unique across the provided supplier data",
                "example": "0000100000",
                "pattern": "^\\S+$"
              },
              "externalClientId": {
                "type": "string",
                "description": "Identifier of the client entity in the source system which can be used to separate data",
                "example": "EXTERNAL_CLIENT_ID"
              },
              "code": {
                "type": "string",
                "description": "Code of the supplier in the source system (not unique across clients)",
                "example": "CODE1"
              },
              "type": {
                "type": "string",
                "description": "Type assigned to the supplier in the source system. Can be used to categorize suppliers and control supplier-specific processing logic.",
                "example": "SUPPLIER_TYPE_01"
              },
              "group": {
                "type": "string",
                "description": "Group identifier assigned to the supplier in the source system. Can be used to associate multiple supplier records that belong to the same corporate group or other supplier grouping.",
                "example": "GROUP_001"
              },
              "name": {
                "type": "string",
                "description": "Name of the supplier",
                "example": "Acmne Corp.",
                "pattern": "^[\\S ]*\\S[\\S ]*$"
              },
              "nameAlternative1": {
                "type": "string",
                "description": "Alternative name of the supplier",
                "example": "Acmne Corp."
              },
              "nameAlternative2": {
                "type": "string",
                "description": "Alternative name of the supplier",
                "example": "Acmne Corp."
              },
              "nameAlternative3": {
                "type": "string",
                "description": "Alternative name of the supplier",
                "example": "Acmne Corp."
              },
              "nameAlternative4": {
                "type": "string",
                "description": "Alternative name of the supplier",
                "example": "Acmne Corp."
              },
              "alternativePayee": {
                "type": "string",
                "pattern": "^\\S+$",
                "description": "externalId of the supplier which is the alternative payee for this supplier"
              },
              "street": {
                "type": "string",
                "description": "Street and street number where the supplier is located",
                "example": "Hauptstr. 1"
              },
              "addressAdditional": {
                "type": "string",
                "description": "Additional address data (e.g. apartment or suite)",
                "example": "Eingang B"
              },
              "postcode": {
                "type": "string",
                "description": "Postcode where the supplier is located",
                "example": "10001"
              },
              "city": {
                "type": "string",
                "description": "City where the supplier is located",
                "example": "Berlin"
              },
              "state": {
                "type": "string",
                "description": "State where the company is located",
                "example": "Berlin"
              },
              "countryCode": {
                "$ref": "#/components/schemas/CountryCode"
              },
              "vatIds": {
                "type": "array",
                "description": "List of VAT IDs assigned to the supplier",
                "example": [
                  {
                    "id": "DE123456789",
                    "countryCode": "DE"
                  }
                ],
                "items": {
                  "$ref": "#/components/schemas/vatId"
                }
              },
              "taxIds": {
                "type": "array",
                "description": "List of Tax IDs assigned to the supplier",
                "example": [
                  {
                    "id": "123-456-789",
                    "type": "TIN"
                  }
                ],
                "items": {
                  "$ref": "#/components/schemas/taxId"
                }
              },
              "blockedForPosting": {
                "type": "boolean",
                "description": "Indicator if the supplier is blocked for posting",
                "example": false
              },
              "blockedForPayment": {
                "type": "boolean",
                "description": "Indicator if the supplier is blocked for payment",
                "example": false
              },
              "globalLocationNumber": {
                "type": "string",
                "description": "13-digit Global Location Number (GLN) used for unique location identification in B2B transactions",
                "example": "4000001000002"
              },
              "duns": {
                "type": "string",
                "description": "D-U-N-S Number issued by Dun & Bradstreet. A globally used identifier for business entities.",
                "example": "123456789"
              },
              "supplierSubsidiaries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/subsidiary"
                }
              },
              "supplierBankAccounts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/bankAccount"
                }
              },
              "customFields": {
                "$ref": "#/components/schemas/customFields"
              },
              "customMetadata": {
                "$ref": "#/components/schemas/JsonObject"
              }
            }
          }
        ]
      },
      "invoicingStatus": {
        "type": "string",
        "description": "Indicates the invoicing progress of the purchase order (line) based on invoices posted against it",
        "example": "partial",
        "enum": [
          "outstanding",
          "partial",
          "complete"
        ],
        "x-enum-descriptions": [
          "No invoice has been posted yet",
          "One or more invoices have been posted, but the total invoiced net amount is still below the expected total net amount",
          "One or more invoices have been posted and the expected total net amount has been fully reached or exceeded"
        ]
      },
      "deliveryStatus": {
        "type": "string",
        "description": "Indicates the delivery progress of the purchase order (line) based on goods receipts or service confirmations",
        "example": "partial",
        "enum": [
          "outstanding",
          "partial",
          "complete"
        ],
        "x-enum-descriptions": [
          "No deliveries have been received yet",
          "One or more deliveries have been received, but the total delivered quantity is still below the expected total quantity",
          "One or more deliveries have been received and the expected total quantity has been fully reached or exceeded"
        ]
      },
      "material": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the material that is globally unique across the provided material data",
            "example": "2a6300181f08402e710ea3f180214bc1",
            "pattern": "^\\S+$"
          },
          "supplierNumber": {
            "type": "string",
            "description": "Number of the material as defined by the supplier",
            "example": "123456789"
          },
          "type": {
            "type": "string",
            "description": "Type of the material as defined in the material master of the company",
            "example": "Operating Supplies"
          },
          "group": {
            "type": "string",
            "description": "Group of the material as defined in the material master of the company",
            "example": "Electronics"
          },
          "description": {
            "type": "string",
            "description": "Description of the material",
            "example": "Dell Laptop Latitude D630"
          },
          "manufacturer": {
            "type": "string",
            "description": "Name of the manufacturer of the material",
            "example": "Acme Corporation"
          },
          "manufacturerNumber": {
            "type": "string",
            "description": "Number of the material as defined by the manufacturer",
            "example": "ACME-12345"
          },
          "unspsc": {
            "type": "string",
            "description": "United Nations Standard Products and Services Code of the material",
            "example": "43211508"
          },
          "ean": {
            "type": "string",
            "description": "European Article Number (EAN-13)",
            "example": "4006381333931"
          },
          "baseUnitOfMeasure": {
            "type": "string",
            "description": "The base unit of measure in which the material is managed in the source system.",
            "example": "PCE"
          }
        }
      },
      "deliveryAddress": {
        "type": "object",
        "description": "Delivery address associated with the purchase order line. Represents the physical destination where goods or services are delivered",
        "properties": {
          "street": {
            "type": "string",
            "description": "Street name and house number of the delivery address",
            "example": "123 Industrial Way"
          },
          "addressAdditional": {
            "type": "string",
            "description": "Additional address data (e.g. apartment or suite)",
            "example": "Suite 500, Dock 4"
          },
          "postcode": {
            "type": "string",
            "description": "Postcode of the delivery address",
            "example": "90001"
          },
          "city": {
            "type": "string",
            "description": "City of the delivery address",
            "example": "Los Angeles"
          },
          "state": {
            "type": "string",
            "description": "State of the delivery address",
            "example": "CA"
          },
          "countryCode": {
            "$ref": "#/components/schemas/CountryCode"
          }
        }
      },
      "orderConfirmation": {
        "type": "object",
        "description": "Object containing order confirmation details provided by the supplier for the purchase order line",
        "properties": {
          "lineNumber": {
            "type": "string",
            "description": "Number of the order conformation line assigned (unique within the order confirmation)",
            "example": "0090"
          },
          "deliveryDate": {
            "type": "string",
            "description": "Confirmed delivery date provided by the supplier (YYYY-MM-DD)",
            "format": "date",
            "example": "2024-10-15"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity confirmed by the supplier for the specified delivery date",
            "example": 95
          },
          "supplierReference": {
            "type": "string",
            "description": "Reference number assigned by the supplier for the order confirmation",
            "example": "SUP-REF-00192"
          },
          "createdAt": {
            "type": "string",
            "description": "Date when the order confirmation was created in the source system (YYYY-MM-DD)",
            "format": "date",
            "example": "2024-09-01"
          }
        }
      },
      "purchaseOrderLine": {
        "required": [
          "purchaseOrderLineNumber"
        ],
        "type": "object",
        "properties": {
          "purchaseOrderLineNumber": {
            "type": "string",
            "description": "Number of the purchase order line assigned to the invoice line item (unique within the purchase order)",
            "example": "00010"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "Company that the purchase order line is assgined to",
            "example": "DE01"
          },
          "accountAssignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/accountAssignment"
            }
          },
          "type": {
            "type": "string",
            "description": "type of the purchase order line as defined in the source system",
            "example": "Service"
          },
          "subType": {
            "type": "string",
            "description": "subtype of the purchase order as defined in the source system",
            "example": "Extra Qualifier"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the purchase order line (sum of all quantity splits in case of several accountAssignments)",
            "example": 2
          },
          "status": {
            "type": "string",
            "description": "Status of purchase order line as defined in source system",
            "example": "OPEN"
          },
          "invoicingStatus": {
            "$ref": "#/components/schemas/invoicingStatus"
          },
          "deliveryStatus": {
            "$ref": "#/components/schemas/deliveryStatus"
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount of the purchase order line",
            "example": 1.23
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount of the purchase order line",
            "example": 1.23
          },
          "grossAmount": {
            "type": "number",
            "description": "Gross amount of the purchase order line",
            "example": 100.01
          },
          "unitOfMeasure": {
            "type": "string",
            "description": "Unit of measure of the purchase order line (usually the unit of measure in which the supplier will deliver the ordered material).",
            "example": "kg"
          },
          "orderUnit": {
            "type": "object",
            "description": "Unit of measure in which the material was ordered on the purchase order line and its conversion to the base unit of measure",
            "properties": {
              "unitOfMeasure": {
                "type": "string",
                "description": "The unit of measure in which the material was ordered on the purchase order line",
                "example": "KAR"
              },
              "conversionFactorToBaseUnit": {
                "type": "number",
                "description": "Conversion factor for converting a quantity in order unit to a quantity in base unit. For example, if the base unit is PCE, the order unit is KAR, and the conversion factor is 30, then 1 KAR = 30 PCE.",
                "example": 30
              }
            }
          },
          "unitPrice": {
            "type": "number",
            "description": "Price for one unit of the purchase order line",
            "example": 19.0123
          },
          "taxCode": {
            "$ref": "#/components/schemas/taxCode"
          },
          "itemText": {
            "type": "string",
            "description": "Text describing the purchase order line",
            "example": "Dell Laptop Latitude D630"
          },
          "material": {
            "$ref": "#/components/schemas/material"
          },
          "plant": {
            "type": "string",
            "description": "Location where purchased goods and services are consumed",
            "example": "PLANT-001"
          },
          "delivered": {
            "type": "boolean",
            "description": "Indicator if the purchase order line item was delivered",
            "example": true
          },
          "completelyInvoiced": {
            "type": "boolean",
            "description": "Indicator if the purchase order line item was fully invoiced",
            "example": true
          },
          "approved": {
            "type": "boolean",
            "description": "Indicator if the purchase order line item has been approved",
            "example": true
          },
          "plannedDeliveryDate": {
            "type": "string",
            "description": "Planned delivery date (YYYY-MM-DD)",
            "format": "date",
            "example": "2025-08-27"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "deliveryAddress": {
            "$ref": "#/components/schemas/deliveryAddress"
          },
          "deliveredQuantity": {
            "type": "number",
            "description": "Quantity that has already been delivered for the purchase order line",
            "example": 55
          },
          "orderConfirmations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/orderConfirmation"
            }
          },
          "externalPlannerId": {
            "type": "string",
            "description": "External unique id of the responsible planner / dispatcher in the source system",
            "example": "PLAN-4410-B"
          },
          "accountAssignmentType": {
            "type": "string",
            "description": "Account assignment type of the purchase order line which defines the type of accounting object (e.g. cost center, asset, project) the costs of the line are assigned to",
            "example": "K"
          }
        }
      },
      "deliveryTerms": {
        "type": "object",
        "description": "Object containing delivery terms information as defined in the source system",
        "properties": {
          "deliveryTermKey": {
            "type": "string",
            "description": "Key of the delivery terms as defined in the source system (e.g. Incoterms or internal delivery condition codes)",
            "example": "FOB"
          },
          "descriptions": {
            "type": "array",
            "description": "Descriptions of the delivery terms in different languages",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Free on Board - Port of Los Angeles",
                "language": "en"
              },
              {
                "text": "Franco a bordo - Puerto de Los Ángeles",
                "language": "es"
              }
            ]
          },
          "additionalInfo": {
            "type": "string",
            "description": "Additional info on the delivery terms (e.g. port or packaging)",
            "example": "Some additional info"
          }
        }
      },
      "purchaseOrder": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the purchase order that is globally unique across the provided purchase order data",
            "example": "4500016221",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "purchaseOrderNumber": {
            "type": "string",
            "description": "Number of the purchase order in the source system (not unique across clients)",
            "example": "PoNumber123"
          },
          "createdDate": {
            "type": "string",
            "description": "Date when the purchase order was created in the external system",
            "format": "date",
            "example": "2000-12-31"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Label used in the source system for the fiscal year that the purchase order was created in",
            "example": "2023"
          },
          "language": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LanguageCode"
              },
              {
                "description": "Language assigned to the purchase order. If the source system allows for storing data of text fields in different languages, the data should be transferred to Hypatos in the language that is assigned to the purchase order (exception: for payment terms all languages should be transferred)."
              }
            ]
          },
          "externalCompanyId": {
            "type": "string",
            "description": "Company that the purchase order is assigned to",
            "example": "DE01"
          },
          "type": {
            "description": "type of the purchase order as defined in the source system",
            "type": "string",
            "example": "Service"
          },
          "externalSupplierId": {
            "type": "string",
            "description": "External unique id of the supplier in the source system",
            "example": "0000100000"
          },
          "status": {
            "type": "string",
            "description": "Status of purchase order as defined in source system",
            "example": "OPEN"
          },
          "invoicingStatus": {
            "$ref": "#/components/schemas/invoicingStatus"
          },
          "deliveryStatus": {
            "$ref": "#/components/schemas/deliveryStatus"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "totalNetAmount": {
            "type": "number",
            "description": "Total net amount of purchase order (sum of line item net amounts)",
            "example": 81
          },
          "totalFreightCharges": {
            "type": "number",
            "description": "Sum of all freight charges as defined on the purchase order",
            "example": 9
          },
          "totalOtherCharges": {
            "type": "number",
            "description": "Sum of all charges other than freight charges as defined on the purchase order",
            "example": 10
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount of purchase order (sum of all taxes)",
            "example": 19
          },
          "totalGrossAmount": {
            "type": "number",
            "description": "Total gross amount of purchase order (total net amount + total freight charges + total other charges + total tax amount)",
            "example": 119
          },
          "totalInvoicedNetAmount": {
            "type": "number",
            "description": "Total net amount invoiced for this purchase order, calculated as the sum of the net amounts of all invoices posted against it",
            "example": 119
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/paymentTerms"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "purchaseOrderLines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/purchaseOrderLine"
            }
          },
          "productNumber": {
            "type": "string",
            "description": "Number of the product as defined by the purchaser",
            "example": "123456789"
          },
          "externalPurchaserId": {
            "type": "string",
            "description": "External unique id of the responsible purchaser in the source system",
            "example": "PUR-88293-X"
          },
          "deliveryTerms": {
            "$ref": "#/components/schemas/deliveryTerms"
          }
        }
      },
      "languagedTextWithValue": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Text Value",
            "example": "OE"
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            }
          }
        }
      },
      "glAccount": {
        "type": "object",
        "required": [
          "externalId",
          "code"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the general ledger account that is globally unique across the provided general ledger account data",
            "example": "0000100GL1",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "code": {
            "type": "string",
            "description": "Code of the general ledger account in the source system (not unique across clients)",
            "example": "GL1",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "companyAssignment": {
            "type": "array",
            "description": "List of externalCompanyIds that the approver is assigned to",
            "example": [
              "DE01",
              "US01"
            ],
            "items": {
              "type": "string"
            }
          },
          "type": {
            "$ref": "#/components/schemas/languagedTextWithValue"
          },
          "category": {
            "$ref": "#/components/schemas/languagedTextWithValue"
          },
          "label": {
            "type": "array",
            "description": "Label describing the general ledger account",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Entertainment Expenses",
                "language": "en"
              }
            ]
          },
          "accountGroup": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "description": "Alphanumeric value of the general ledger account group",
                "example": "123"
              },
              "labels": {
                "type": "array",
                "description": "Label describing the general ledger account",
                "items": {
                  "$ref": "#/components/schemas/languagedText"
                },
                "example": [
                  {
                    "text": "Entertainment Expenses",
                    "language": "en"
                  }
                ]
              }
            }
          },
          "shortLabel": {
            "type": "array",
            "description": "Short label describing the general ledger account",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Entertainment Exp.",
                "language": "en"
              }
            ]
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "costCenter": {
        "type": "object",
        "required": [
          "externalId",
          "code"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the cost center that is globally unique across the provided cost center data",
            "example": "0000100CO1",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "code": {
            "type": "string",
            "description": "Code of the cost center in the source system (not unique across clients)",
            "example": "CO1",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "companyAssignment": {
            "type": "array",
            "description": "List of externalCompanyIds that the approver is assigned to",
            "example": [
              "DE01",
              "US01"
            ],
            "items": {
              "type": "string"
            }
          },
          "type": {
            "$ref": "#/components/schemas/languagedTextWithValue"
          },
          "category": {
            "$ref": "#/components/schemas/languagedTextWithValue"
          },
          "label": {
            "type": "array",
            "description": "Label describing the cost center",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Sales Engineers",
                "language": "en"
              }
            ]
          },
          "shortLabel": {
            "type": "array",
            "description": "Short label describing the cost center",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Sales Eng.",
                "language": "en"
              }
            ]
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "approver": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the approver that is globally unique across the provided approver data",
            "example": "UserID#1234",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "code": {
            "type": "string",
            "description": "Code of the approver in the source system (not unique across clients)",
            "example": "CODE1"
          },
          "companyAssignment": {
            "type": "array",
            "description": "List of externalCompanyIds that the approver is assigned to",
            "example": [
              "DE01",
              "US01"
            ],
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "firstName": {
            "type": "string",
            "description": "First name of the approving person",
            "example": "Koala"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the approving person",
            "example": "Hinze"
          },
          "email": {
            "type": "string",
            "description": "Email address of the approving person",
            "format": "email",
            "example": "accountant@sap.com"
          },
          "phoneNumber": {
            "type": "string",
            "description": "Phone number of the approving person",
            "example": "+491001234567891"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "salesOrganizationInfo": {
        "type": "object",
        "description": "Details of the associated sales organization",
        "properties": {
          "externalSalesOrganizationId": {
            "type": "string",
            "description": "External identifier for the sales organization",
            "example": "1000"
          },
          "distributionChannel": {
            "type": "string",
            "description": "Distribution channel for sales",
            "example": "2000"
          },
          "division": {
            "type": "string",
            "description": "Division under which the sales organization operates",
            "example": "3000"
          },
          "salesGroup": {
            "type": "string",
            "description": "Sales group associated with the contract",
            "example": "4000"
          },
          "salesOffice": {
            "type": "string",
            "description": "Sales office responsible for the contract",
            "example": "5000"
          },
          "blockedForOrdering": {
            "type": "boolean",
            "description": "Indicator if the customer is blocked for ordering in a sales organization",
            "example": true
          },
          "blockedForDelivery": {
            "type": "boolean",
            "description": "Indicator if the subsidiary is blocked for delivery",
            "example": false
          },
          "shippingAddresses": {
            "type": "array",
            "description": "List of external id of the related shipping addresses",
            "example": [
              "ADDR001",
              "ADDR002"
            ],
            "items": {
              "type": "string"
            }
          },
          "billingAddresses": {
            "type": "array",
            "description": "List of external id of the related billing addresses",
            "example": [
              "ADDR003"
            ],
            "items": {
              "type": "string"
            }
          },
          "salesOrganizationCode": {
            "type": "string",
            "description": "Code of the sales organization in the source system (not unique across clients)",
            "example": "SO001"
          },
          "salesUnit": {
            "type": "object",
            "properties": {
              "unitOfMeasure": {
                "type": "string",
                "description": "Unit in which the product is sold, different from base unit",
                "example": "PK"
              },
              "conversionFactorToBaseUnit": {
                "type": "number",
                "description": "Conversion factor for converting a quantity in sales unit to a quantity in base unit. For example, if the base unit is kg, the sales unit is PK, and the conversion factor is 1000, then 1 PK = 1000 kg.",
                "example": 1000
              },
              "description": {
                "type": "string",
                "description": "Description of the sales unit packaging",
                "example": "Package of 10 units"
              }
            }
          }
        }
      },
      "customerSalesOrganizationInfo": {
        "description": "Details of the sales organization associated with the customer",
        "allOf": [
          {
            "$ref": "#/components/schemas/salesOrganizationInfo"
          },
          {
            "type": "object",
            "properties": {
              "paymentTerms": {
                "$ref": "#/components/schemas/paymentTerms"
              }
            }
          }
        ]
      },
      "customer": {
        "type": "object",
        "required": [
          "name",
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the customer that is globally unique across the provided customer data",
            "example": "0000100000",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "code": {
            "type": "string",
            "description": "Code of the customer in the source system (not unique across clients)",
            "example": "CODE1"
          },
          "type": {
            "type": "string",
            "description": "Type (role) of the customer as defined in the source system (e.g. SOLD_TO, SHIP_TO, BILL_TO, PAYER)",
            "example": "SOLD_TO"
          },
          "name": {
            "type": "string",
            "description": "Name of the customer",
            "example": "Acmne Corp.",
            "pattern": "^[\\S ]*\\S[\\S ]*$"
          },
          "nameAlternative1": {
            "type": "string",
            "description": "Alternative name of the customer",
            "example": "Acmne Corp."
          },
          "nameAlternative2": {
            "type": "string",
            "description": "Alternative name of the customer",
            "example": "Acmne Corp."
          },
          "nameAlternative3": {
            "type": "string",
            "description": "Alternative name of the customer",
            "example": "Acmne Corp."
          },
          "nameAlternative4": {
            "type": "string",
            "description": "Alternative name of the customer",
            "example": "Acmne Corp."
          },
          "street": {
            "type": "string",
            "description": "Street and street number where the customer is located",
            "example": "Hauptstr. 1"
          },
          "addressAdditional": {
            "type": "string",
            "description": "Additional address data (e.g. apartment or suite)",
            "example": "Eingang B"
          },
          "postcode": {
            "type": "string",
            "description": "Postcode where the customer is located",
            "example": "10001"
          },
          "city": {
            "type": "string",
            "description": "City where the customer is located",
            "example": "Berlin"
          },
          "countryCode": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "vatIds": {
            "type": "array",
            "description": "List of VAT IDs assigned to the customer",
            "example": [
              {
                "id": "DE123456789",
                "countryCode": "DE"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/vatId"
            }
          },
          "taxIds": {
            "type": "array",
            "description": "List of Tax IDs assigned to the customer",
            "example": [
              {
                "id": "123-456-789",
                "type": "TIN"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/taxId"
            }
          },
          "blockedForPosting": {
            "type": "boolean",
            "description": "Indicator if the customer is blocked for posting",
            "example": false
          },
          "blockedForPayment": {
            "type": "boolean",
            "description": "Indicator if the customer is blocked for payment",
            "example": false
          },
          "blockedForOrdering": {
            "type": "boolean",
            "description": "Indicator if the customer is blocked for ordering globally",
            "example": false
          },
          "blockedForDelivery": {
            "type": "boolean",
            "description": "Indicator if the customer is blocked for delivery globally",
            "example": false
          },
          "globalLocationNumber": {
            "type": "string",
            "description": "13-digit Global Location Number (GLN) used for unique location identification in B2B transactions",
            "example": "4000001000002"
          },
          "duns": {
            "type": "string",
            "description": "D-U-N-S Number issued by Dun & Bradstreet. A globally used identifier for business entities.",
            "example": "123456789"
          },
          "customerSubsidiaries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/subsidiary"
            }
          },
          "customerBankAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/bankAccount"
            }
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "salesOrganizationInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/customerSalesOrganizationInfo"
            }
          }
        }
      },
      "lookup-table-row": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the lookup-table-row that is globally unique across the provided lookup-table-row data"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "code": {
            "type": "string",
            "description": "Number of the lookup table record in the source system (not unique across clients)",
            "example": "CODE1"
          }
        },
        "additionalProperties": {
          "type": "string",
          "maxProperties": 20,
          "description": "externalClientId and code counts for maximum 20 additional properties"
        },
        "example": {
          "externalId": "12345",
          "externalClientId": "EXTERNAL_CLIENT_ID",
          "dimension1": "someValue",
          "dimension2": "anotherValue",
          "customField": "dynamicValue"
        }
      },
      "contractStatus": {
        "type": "string",
        "nullable": true,
        "description": "Indicates the current lifecycle state of the contract",
        "example": "active",
        "enum": [
          "draft",
          "active",
          "pending",
          "suspended",
          "cancelled",
          "expired",
          "terminated",
          null
        ],
        "x-enum-descriptions": [
          "The contract is in draft mode and has not been finalized. It can still be edited",
          "The contract is currently in effect and legally binding",
          "The contract has been submitted for approval or is awaiting finalization",
          "The contract is temporarily on hold but not yet terminated",
          "The contract has been cancelled before becoming active",
          "The contract has reached its end date and is no longer valid",
          "The contract was ended before its expiration date"
        ]
      },
      "businessPartnerType": {
        "type": "string",
        "nullable": true,
        "description": "Type of business partner (e.g., Supplier, Customer)",
        "example": "supplier",
        "enum": [
          "supplier",
          "customer",
          null
        ]
      },
      "businessPartner": {
        "type": "object",
        "description": "Details of the business partner associated with the contract",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the business partner that is globally unique across the provided business partner data",
            "example": "0000100000"
          },
          "type": {
            "$ref": "#/components/schemas/businessPartnerType"
          }
        }
      },
      "parentContract": {
        "type": "object",
        "description": "Details of the business partner associated with the contract",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the parent contract that is globally unique across the provided parent contract data",
            "example": "PARENT-2024-0005"
          },
          "contractNumber": {
            "type": "string",
            "description": "Contract number of the parent contract",
            "example": "CN-2024-005"
          }
        }
      },
      "contractItem": {
        "type": "object",
        "properties": {
          "itemNumber": {
            "type": "string",
            "description": "Unique identifier for the contract item",
            "example": "001"
          },
          "category": {
            "type": "string",
            "description": "Category of the contract item (e.g., Service, Product)",
            "example": "Service"
          },
          "description": {
            "type": "string",
            "description": "Description of the contract item",
            "example": "Annual software maintenance"
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount of the contract item",
            "example": 25000
          },
          "taxAmount": {
            "type": "number",
            "description": "Tax amount applicable to the contract item",
            "example": 4750
          },
          "grossAmount": {
            "type": "number",
            "description": "Gross amount of the contract item (net + tax)",
            "example": 29750
          },
          "unitPrice": {
            "type": "number",
            "description": "Price per unit of the contract item",
            "example": 25000
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the contract item",
            "example": 1
          },
          "unitOfMeasure": {
            "type": "string",
            "description": "Unit of measure for the contract item",
            "example": "EA"
          },
          "billingCycle": {
            "type": "string",
            "description": "Purchase order related to the invoice line item",
            "example": "Billing cycle for the contract item"
          },
          "durationMonths": {
            "type": "number",
            "description": "Duration of the contract item in months",
            "example": 12
          },
          "taxCode": {
            "$ref": "#/components/schemas/taxCode"
          }
        }
      },
      "additionalAgreement": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the agreement that is globally unique across the provided agreement data",
            "example": "AGREEMENT-001"
          },
          "type": {
            "type": "string",
            "description": "Type of agreement",
            "example": "downPaymentAllowed"
          },
          "value": {
            "type": "boolean",
            "description": "Value of the agreement condition",
            "example": true
          }
        }
      },
      "obligation": {
        "type": "object",
        "properties": {
          "party": {
            "type": "string",
            "description": "Party responsible for the obligation",
            "example": "Company A"
          },
          "description": {
            "type": "string",
            "description": "Description of the obligation",
            "example": "Company A will deliver 1000 units of Product X per quarter"
          }
        }
      },
      "contactItem": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "description": "First name of the contact person",
            "example": "Koala"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the contact person",
            "example": "Hinze"
          },
          "email": {
            "type": "string",
            "description": "Email address of the contact person",
            "example": "accountant@sap.com"
          },
          "phoneNumber": {
            "type": "number",
            "description": "Phone number of the contact person",
            "example": 491001234567891
          }
        }
      },
      "contract": {
        "required": [
          "externalId"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the contract that is globally unique across the provided contract data",
            "example": "CONTRACT-2025-0001",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "CONTRACT-2025-0001"
          },
          "documentId": {
            "type": "string",
            "description": "Document id that was assigned during upload to Hypatos",
            "example": "67c02594d4aa80eecbd39bbe",
            "pattern": "^[0-9a-fA-F]{24}$"
          },
          "documents": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/document"
            }
          },
          "contractNumber": {
            "type": "string",
            "description": "Contract number assigned in the source system",
            "example": "CN-2025-001"
          },
          "status": {
            "$ref": "#/components/schemas/contractStatus"
          },
          "businessPartnerContractNumber": {
            "type": "string",
            "description": "Contract number assigned by the business partner",
            "example": "K9120-12"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "External unique identifier of the company in the source system",
            "example": "DE01"
          },
          "salesOrganizationInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/salesOrganizationInfo"
            }
          },
          "businessPartner": {
            "$ref": "#/components/schemas/businessPartner"
          },
          "title": {
            "type": "string",
            "description": "Title or name of the contract",
            "example": "Software Maintenance Agreement"
          },
          "description": {
            "type": "string",
            "description": "Description of the contract and its purpose",
            "example": "Annual software maintenance contract for Acme Corp"
          },
          "createdDate": {
            "type": "string",
            "description": "Date when the contract was created (YYYY-MM-DD)",
            "format": "date",
            "example": "2025-01-15"
          },
          "startDate": {
            "type": "string",
            "description": "Date when the contract becomes effective (YYYY-MM-DD)",
            "format": "date",
            "example": "2025-02-01"
          },
          "endDate": {
            "type": "string",
            "description": "Date when the contract expires (YYYY-MM-DD)",
            "format": "date",
            "example": "2026-01-31"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Fiscal year label associated with the contract",
            "example": "2023"
          },
          "type": {
            "type": "string",
            "description": "Type of contract",
            "example": "Service Agreement"
          },
          "subType": {
            "type": "string",
            "description": "Subtype of contract",
            "example": "Quantity"
          },
          "currency": {
            "type": "string",
            "description": "Currency in which the contract amounts are denominated",
            "example": "EUR"
          },
          "totalNetAmount": {
            "type": "number",
            "description": "Total net amount of the contract",
            "example": 50000
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount applicable to the contract",
            "example": 9500
          },
          "totalGrossAmount": {
            "type": "number",
            "description": "Total gross amount of the contract (net amount + tax)",
            "example": 59500
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/paymentTerms"
          },
          "parentContract": {
            "$ref": "#/components/schemas/parentContract"
          },
          "targetQuantity": {
            "type": "number",
            "description": "Target quantity specified in the contract",
            "example": 1000
          },
          "targetValue": {
            "type": "number",
            "description": "Target value of the contract in the specified currency",
            "example": 200000
          },
          "contractItems": {
            "type": "array",
            "description": "List of items included in the contract",
            "items": {
              "$ref": "#/components/schemas/contractItem"
            }
          },
          "additionalAgreements": {
            "type": "array",
            "description": "List of additional agreements linked to the contract",
            "items": {
              "$ref": "#/components/schemas/additionalAgreement"
            }
          },
          "obligations": {
            "type": "array",
            "description": "List of obligations specified in the contract",
            "items": {
              "$ref": "#/components/schemas/obligation"
            }
          },
          "contacts": {
            "type": "array",
            "description": "List of contact persons associated with the contract",
            "items": {
              "$ref": "#/components/schemas/contactItem"
            }
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "salesOrderLine": {
        "type": "object",
        "properties": {
          "plannedDeliveryDate": {
            "type": "string",
            "description": "Planned delivery date (YYYY-MM-DD)",
            "format": "date",
            "example": "2025-08-27"
          },
          "orderLineNumber": {
            "type": "string",
            "description": "External unique id of the sales order line in the source system",
            "example": "00000001"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "Company that the sales order is assigned to",
            "example": "DE01"
          },
          "externalProductId": {
            "type": "string",
            "description": "External unique id of the product in the source system",
            "example": "PO01"
          },
          "quantity": {
            "type": "number",
            "description": "Ordered quantity of the sales order line",
            "example": 2
          },
          "unitOfMeasure": {
            "type": "string",
            "description": "Unit of measure of the sales order line",
            "example": "kg"
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price of the sales order line",
            "example": 100
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount of the sales order line",
            "example": 200
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Tax amount of the sales order line",
            "example": 38
          },
          "grossAmount": {
            "type": "number",
            "description": "Gross amount of the sales order line",
            "example": 238
          },
          "taxCode": {
            "$ref": "#/components/schemas/taxCode"
          },
          "description": {
            "type": "string",
            "description": "Description of the type of tax in the source system",
            "example": "DEU - Standard (19%)"
          },
          "plant": {
            "type": "string",
            "description": "Plant responsible for fulfilling the sales order line",
            "example": "PLANT-001"
          },
          "storageLocation": {
            "type": "string",
            "description": "Storage location of the sales order line",
            "example": "BOX-001"
          },
          "externalShippingAddressId": {
            "type": "string",
            "description": "Shipping address for the sales order line",
            "example": "DE-123E"
          },
          "externalBillingAddressId": {
            "type": "string",
            "description": "Billing address related to the sales order line",
            "example": "DE-123E"
          },
          "itemText": {
            "type": "string",
            "description": "Text describing the sales order line",
            "example": "Sold item ABC"
          },
          "type": {
            "type": "string",
            "description": "Type of the sales order line",
            "example": "Item type"
          },
          "externalQuoteId": {
            "type": "string",
            "description": "Quote that the sales order line was ordered from",
            "example": "EQ01"
          },
          "quoteLineNumber": {
            "type": "string",
            "description": "Line number from the linked quote",
            "example": "LN01"
          },
          "externalContractId": {
            "type": "string",
            "description": "Contract that the sales order line is related to",
            "example": "ECID01"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "salesOrder": {
        "required": [
          "externalId"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the sales order that is globally unique across the provided sales order data",
            "example": "DE01",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "documentId": {
            "type": "string",
            "description": "Document id that was assigned during upload to Hypatos",
            "example": "63cac12c37bb02accb396cae",
            "pattern": "^[0-9a-fA-F]{24}$"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/document"
            }
          },
          "customerOrderNumber": {
            "type": "string",
            "description": "Sales order number provided by the issuing customer",
            "example": "CUSTOMER_ORDER_NUMBER"
          },
          "salesOrderNumber": {
            "type": "string",
            "description": "Number of the sales order in the source system (not unique across clients)",
            "example": "SALES_ORDER_NUMBER"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "External unique id of the company in the source system",
            "example": "DE01"
          },
          "externalCustomerId": {
            "type": "string",
            "description": "External unique id of the customer in the source system",
            "example": "CO01"
          },
          "salesOrganizationCode": {
            "type": "string",
            "description": "Sales organization code",
            "example": "SO001"
          },
          "distributionChannel": {
            "type": "string",
            "description": "Distribution channel code",
            "example": "CH1"
          },
          "division": {
            "type": "string",
            "description": "Division code",
            "example": "DIV01"
          },
          "salesGroup": {
            "type": "string",
            "description": "Sales group responsible for the order",
            "example": "123456"
          },
          "salesOffice": {
            "type": "string",
            "description": "Sales office responsible for the order",
            "example": "98765"
          },
          "type": {
            "type": "string",
            "description": "Type of the invoice as defined in the source system",
            "example": "OR"
          },
          "subType": {
            "type": "string",
            "description": "Sub type of the invoice as defined in the source system",
            "example": "recurring"
          },
          "issuedDate": {
            "type": "string",
            "description": "Date when the invoice was issued by the supplier (printed on invoice document)",
            "format": "date",
            "example": "2000-12-31"
          },
          "receivedDate": {
            "type": "string",
            "description": "Date when the invoice was received by the company",
            "format": "date",
            "example": "2000-12-31"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Label used in the source system for the fiscal year that the invoice was posted in",
            "example": "2023"
          },
          "requestedDeliveryDate": {
            "type": "string",
            "description": "Requested delivery date",
            "format": "date",
            "example": "2000-12-31"
          },
          "isCanceled": {
            "type": "boolean",
            "description": "Indicator if the invoice is canceled",
            "example": false
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "totalNetAmount": {
            "type": "number",
            "description": "Total net amount of sales order (sum of line item net amounts)",
            "example": 100
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount of sales order (sum of all taxes)",
            "example": 19
          },
          "totalGrossAmount": {
            "type": "number",
            "description": "Total gross amount of sales order (total net amount + total tax amount)",
            "example": 119
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/paymentTerms"
          },
          "headerText": {
            "type": "string",
            "description": "Header Text describing the invoice",
            "example": "doc header text"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "salesOrderLines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/salesOrderLine"
            }
          }
        }
      },
      "productSalesOrganizationInfo": {
        "description": "Details of the sales organization associated with the product",
        "allOf": [
          {
            "$ref": "#/components/schemas/salesOrganizationInfo"
          },
          {
            "type": "object",
            "properties": {
              "productGroup1": {
                "type": "string",
                "description": "Customer- or ERP-defined sales product classification 1. Can be used for reporting, pricing, segmentation, routing, or sales-specific product grouping.",
                "example": "ELECTRONICS"
              },
              "productGroup2": {
                "type": "string",
                "description": "Customer- or ERP-defined sales product classification 2. Can be used for reporting, pricing, segmentation, routing, or sales-specific product grouping.",
                "example": "COMPUTERS"
              },
              "productGroup3": {
                "type": "string",
                "description": "Customer- or ERP-defined sales product classification 3. Can be used for reporting, pricing, segmentation, routing, or sales-specific product grouping.",
                "example": "LAPTOPS"
              },
              "productGroup4": {
                "type": "string",
                "description": "Customer- or ERP-defined sales product classification 4. Can be used for reporting, pricing, segmentation, routing, or sales-specific product grouping.",
                "example": "B2B_DIRECT"
              },
              "productGroup5": {
                "type": "string",
                "description": "Customer- or ERP-defined sales product classification 5. Can be used for reporting, pricing, segmentation, routing, or sales-specific product grouping.",
                "example": "B2B_DIRECT"
              },
              "productCategoryGroup": {
                "type": "string",
                "description": "Sales-specific product category or item category group used to determine how the product is handled in sales processes, such as order processing, item categorization, pricing, or fulfillment logic.",
                "example": "STANDARD_GOOD"
              }
            }
          }
        ]
      },
      "product": {
        "required": [
          "externalId"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External ID of the product that is globally unique across the provided product data",
            "example": "DE01",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "productNumber": {
            "type": "string",
            "description": "Number of the product as defined by the supplier",
            "example": "NO123"
          },
          "type": {
            "type": "string",
            "description": "Type of the product as defined in the company’s product master (e.g., Operating Supplies)",
            "example": "Operating Supplies"
          },
          "group": {
            "type": "string",
            "description": "Group of the product as defined in the product master of the company",
            "example": "Electronics"
          },
          "description": {
            "type": "string",
            "description": "Description of the product",
            "example": "A Laptop XP"
          },
          "shortDescription": {
            "type": "string",
            "description": "Shortened version of the product description",
            "example": "A great laptop"
          },
          "manufacturer": {
            "type": "string",
            "description": "Name of the product manufacturer",
            "example": "Corporation ABC"
          },
          "unspsc": {
            "type": "string",
            "description": "Universal Product Code (UPC-A)",
            "example": "43211508"
          },
          "ean": {
            "type": "string",
            "description": "European Article Number (EAN-13)",
            "example": "4006381333931"
          },
          "upc": {
            "type": "string",
            "description": "Universal Product Code (UPC-A)",
            "example": "036000291452"
          },
          "gtin": {
            "type": "string",
            "description": "Global Trade Item Number (GTIN) according to GS1 standards. A globally unique identifier for trade items and products.",
            "example": "4006381333931"
          },
          "baseUnitOfMeasure": {
            "type": "string",
            "description": "The base unit in which the product is managed in the system",
            "example": "kg"
          },
          "customsTariffNumber": {
            "type": "string",
            "description": "Customs tariff number (HS/TARIC code) used for cross-border trade and customs",
            "example": "8471300000"
          },
          "plants": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Identifier of the plants where the product is stored or managed",
              "example": "PLANT-001"
            }
          },
          "status": {
            "type": "string",
            "description": "Current status of the product",
            "example": "ACTIVE",
            "enum": [
              "ACTIVE",
              "INACTIVE",
              "DISCONTINUED"
            ]
          },
          "grossWeight": {
            "type": "number",
            "description": "Gross weight of the product including packaging",
            "example": 2.5
          },
          "netWeight": {
            "type": "number",
            "description": "Net weight of the product excluding packaging",
            "example": 2.3
          },
          "weightUnit": {
            "type": "string",
            "description": "Unit for weight values",
            "example": "KG"
          },
          "volume": {
            "type": "number",
            "description": "Volume of the product",
            "example": 0.015
          },
          "volumeUnit": {
            "type": "string",
            "description": "Unit for volume values",
            "example": "M3"
          },
          "salesOrganizationInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/productSalesOrganizationInfo"
            }
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "customerProduct": {
        "required": [
          "externalId"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the customer product that is globally unique across the provided customer product data",
            "example": "DE01-1000004711-CUST-ABC-4711",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "externalCustomerId": {
            "type": "string",
            "description": "External unique id of the customer in the source system",
            "example": "1000004711"
          },
          "externalProductId": {
            "type": "string",
            "description": "Unique id of the product in the source system that links the customer product to the internal product master",
            "example": "DE01-MAT-000123"
          },
          "customerProductNumber": {
            "type": "string",
            "description": "Product number used by the customer to identify the product",
            "example": "CUST-ABC-4711"
          },
          "unspsc": {
            "type": "string",
            "description": "United Nations Standard Products and Services Code of the product",
            "example": "43211508"
          },
          "ean": {
            "type": "string",
            "description": "European Article Number (EAN-13)",
            "example": "4006381333931"
          },
          "upc": {
            "type": "string",
            "description": "Universal Product Code (UPC-A)",
            "example": "036000291452"
          },
          "gtin": {
            "type": "string",
            "description": "Global Trade Item Number (GTIN) according to GS1 standards. A globally unique identifier for trade items and products.",
            "example": "4006381333931"
          },
          "customsTariffNumber": {
            "type": "string",
            "description": "Customs tariff number (HS/TARIC code) used for cross-border trade and customs",
            "example": "8471300000"
          },
          "customerProductDescription": {
            "type": "string",
            "description": "Product description used by the customer",
            "example": "Laptop 14 inch business model"
          },
          "salesOrganizationCode": {
            "type": "string",
            "description": "Sales organization for which the customer product is valid",
            "example": "DE01"
          },
          "distributionChannel": {
            "type": "string",
            "description": "Distribution channel for sales",
            "example": "10"
          },
          "division": {
            "type": "string",
            "description": "Division under which the sales organization operates",
            "example": "00"
          },
          "baseUnitOfMeasure": {
            "type": "string",
            "description": "The base unit in which the product is managed in the system",
            "example": "kg"
          },
          "status": {
            "type": "string",
            "description": "Current status of the customer product",
            "example": "ACTIVE"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "address": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the address that is globally unique across the provided address data",
            "pattern": "^\\S+$",
            "example": "ADDR12345"
          },
          "businessPartnerNumber": {
            "type": "string",
            "description": "Number of the business partner related to this address (e.g. customer number)",
            "example": "BP12345"
          },
          "parentBusinessPartnerNumber": {
            "type": "string",
            "description": "Number of the parent business partner of this address (e.g. customer number)",
            "example": "PBP12345"
          },
          "type": {
            "type": "string",
            "description": "Type of the address",
            "enum": [
              "shippingAddress",
              "billingAddress"
            ],
            "example": "shippingAddress"
          },
          "addressOrder": {
            "type": "number",
            "description": "Order of the address (in case there’s several addresses of the same type)",
            "example": 1
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "CLIENT123"
          },
          "globalLocationNumber": {
            "type": "string",
            "description": "13-digit Global Location Number (GLN) used for unique location identification in B2B transactions",
            "example": "1234567890123"
          },
          "companyName": {
            "type": "string",
            "description": "Name of the company associated with the address",
            "pattern": "^[\\S ]*\\S[\\S ]*$",
            "example": "Acme Corporation"
          },
          "nameAlternative1": {
            "type": "string",
            "description": "Alternative name of the company (e.g. trade name or local language)",
            "example": "Acme Corp."
          },
          "nameAlternative2": {
            "type": "string",
            "description": "Alternative name of the company",
            "example": "Acme Inc."
          },
          "nameAlternative3": {
            "type": "string",
            "description": "Alternative name of the company",
            "example": "Acme Ltd."
          },
          "nameAlternative4": {
            "type": "string",
            "description": "Alternative name of the company",
            "example": "Acme GmbH"
          },
          "street": {
            "type": "string",
            "description": "Street and street number where the address is located",
            "example": "123 Main St"
          },
          "addressAdditional": {
            "type": "string",
            "description": "Additional address data (e.g. building, entrance, apartment, or suite)",
            "example": "Building A, Suite 101"
          },
          "postcode": {
            "type": "string",
            "description": "Postcode where the address is located",
            "example": "12345"
          },
          "city": {
            "type": "string",
            "description": "City where the address is located",
            "example": "Berlin"
          },
          "postOfficeBox": {
            "type": "string",
            "description": "Post office box number, if used instead of street address",
            "example": "PO Box 123"
          },
          "countryCode": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "region": {
            "type": "string",
            "description": "Region, state, or province of the address (e.g. \"CA\" for California or \"BE\" for Berlin)",
            "example": "BE"
          },
          "transportationZone": {
            "type": "string",
            "description": "Code identifying the transportation or logistics zone relevant for shipping or route planning",
            "example": "TZ123"
          },
          "phoneNumber": {
            "type": "string",
            "description": "Phone number of the location or contact point",
            "example": "+491234567890"
          },
          "faxNumber": {
            "type": "string",
            "description": "Fax number of the location or contact point",
            "example": "+491234567891"
          },
          "email": {
            "type": "string",
            "description": "Email address associated with the location or contact point",
            "example": "contact@acme.com"
          },
          "validFrom": {
            "type": "string",
            "format": "date",
            "description": "Start date from which the address is considered valid (format: YYYY-MM-DD)",
            "example": "2023-01-01"
          },
          "validTo": {
            "type": "string",
            "format": "date",
            "description": "End date until which the address is considered valid (format: YYYY-MM-DD)",
            "example": "2023-12-31"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Indicator whether this address is the default for the given type (e.g., default ship-to address)",
            "example": true
          },
          "latitude": {
            "type": "number",
            "description": "Geographical latitude coordinate of the address (in decimal degrees)",
            "example": 52.520008
          },
          "longitude": {
            "type": "number",
            "description": "Geographical longitude coordinate of the address (in decimal degrees)",
            "example": 13.404954
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "quote": {
        "type": "object",
        "required": [
          "externalId"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "pattern": "^\\S+$",
            "description": "External id of the sales order that is globally unique across the provided sales order data",
            "example": "QUOTE12345"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "CLIENT123"
          },
          "documentId": {
            "type": "string",
            "description": "Document id that was assigned during upload to Hypatos",
            "example": "DOC12345"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Document id that was assigned during upload to Hypatos",
                  "example": "DOC12345"
                },
                "type": {
                  "type": "string",
                  "description": "Document type that was assigned during upload to Hypatos",
                  "example": "invoice"
                }
              }
            }
          },
          "quoteNumber": {
            "type": "string",
            "description": "Quote number from the source system",
            "example": "Q12345"
          },
          "customerOrderNumber": {
            "type": "string",
            "description": "Customer order number the quote refers to",
            "example": "CO12345"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "External unique id of the company in the source system",
            "example": "COMP123"
          },
          "externalCustomerId": {
            "type": "string",
            "description": "External unique id of the customer in the source system",
            "example": "CUST123"
          },
          "status": {
            "type": "string",
            "description": "Status of the quote",
            "example": "approved"
          },
          "salesOrganizationCode": {
            "type": "string",
            "description": "Sales organization code",
            "example": "SO123"
          },
          "distributionChannel": {
            "type": "string",
            "description": "Distribution channel code",
            "example": "DC123"
          },
          "division": {
            "type": "string",
            "description": "Division code",
            "example": "DIV123"
          },
          "salesGroup": {
            "type": "string",
            "description": "Sales group responsible for the quote",
            "example": "123"
          },
          "salesOffice": {
            "type": "string",
            "description": "Sales office responsible for the quote",
            "example": "456"
          },
          "type": {
            "type": "string",
            "description": "Type of the quote as defined in the source system",
            "example": "standard"
          },
          "subType": {
            "type": "string",
            "description": "Sub-type of the quote as defined in the source system",
            "example": "recurring"
          },
          "issuedDate": {
            "type": "string",
            "format": "date",
            "description": "Date when the quote was issued",
            "example": "2023-01-01"
          },
          "validUntilDate": {
            "type": "string",
            "format": "date",
            "description": "Date until the quote is valid",
            "example": "2023-12-31"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Fiscal year label used in the source system",
            "example": "FY2023"
          },
          "isCanceled": {
            "type": "boolean",
            "description": "Indicator if the quote is canceled",
            "example": false
          },
          "currency": {
            "type": "string",
            "description": "Three letter currency code as defined in ISO 4217",
            "example": "USD"
          },
          "totalNetAmount": {
            "type": "number",
            "description": "Total net amount of the quote",
            "example": 1000
          },
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount of the quote",
            "example": 190
          },
          "totalGrossAmount": {
            "type": "number",
            "description": "Total gross amount of the quote",
            "example": 1190
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/paymentTerms"
          },
          "headerText": {
            "type": "string",
            "description": "Header text describing the quote",
            "example": "This is a sample quote."
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "quoteLines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "quoteLineNumber": {
                  "type": "string",
                  "description": "Quote line number",
                  "example": "QL12345"
                },
                "externalCompanyId": {
                  "type": "string",
                  "description": "Company the quote line is assigned to",
                  "example": "COMP123"
                },
                "product": {
                  "type": "object",
                  "properties": {
                    "externalId": {
                      "type": "string",
                      "description": "External ID of the quoted product",
                      "example": "PROD123"
                    },
                    "productNumber": {
                      "type": "string",
                      "description": "Product number",
                      "example": "PN123"
                    },
                    "customerProductNumber": {
                      "type": "string",
                      "description": "Customer-specific product number",
                      "example": "CPN123"
                    },
                    "type": {
                      "type": "string",
                      "description": "Product type",
                      "example": "standard"
                    },
                    "group": {
                      "type": "string",
                      "description": "Product group",
                      "example": "electronics"
                    },
                    "description": {
                      "type": "string",
                      "description": "Product description",
                      "example": "A high-quality electronic product."
                    },
                    "manufacturer": {
                      "type": "string",
                      "description": "Manufacturer of the product",
                      "example": "Acme Corp."
                    },
                    "manufacturerNumber": {
                      "type": "string",
                      "description": "Manufacturer-specific number",
                      "example": "MN123"
                    },
                    "unspsc": {
                      "type": "string",
                      "description": "UNSPSC classification code",
                      "example": "43211508"
                    },
                    "ean": {
                      "type": "string",
                      "description": "European Article Number (EAN-13)",
                      "example": "4006381333931"
                    },
                    "upc": {
                      "type": "string",
                      "description": "Universal Product Code (UPC-A)",
                      "example": "036000291452"
                    }
                  }
                },
                "status": {
                  "type": "string",
                  "description": "Status of the quote line",
                  "example": "approved"
                },
                "quantity": {
                  "type": "number",
                  "description": "Quoted quantity",
                  "example": 10
                },
                "unitOfMeasure": {
                  "type": "string",
                  "description": "Unit of measure",
                  "example": "kg"
                },
                "unitPrice": {
                  "type": "number",
                  "description": "Unit price",
                  "example": 100
                },
                "netAmount": {
                  "type": "number",
                  "description": "Net amount of the quote line",
                  "example": 1000
                },
                "totalTaxAmount": {
                  "type": "number",
                  "description": "Tax amount of the quote line",
                  "example": 190
                },
                "grossAmount": {
                  "type": "number",
                  "description": "Gross amount of the quote line",
                  "example": 1190
                },
                "taxCode": {
                  "$ref": "#/components/schemas/taxCode"
                },
                "description": {
                  "type": "string",
                  "description": "Quote line description",
                  "example": "This is a sample quote line."
                },
                "plant": {
                  "type": "string",
                  "description": "Plant code",
                  "example": "PLANT123"
                },
                "storageLocation": {
                  "type": "string",
                  "description": "Storage location",
                  "example": "LOC123"
                },
                "externalShippingAddressId": {
                  "type": "string",
                  "description": "External shipping address ID",
                  "example": "ADDR123"
                },
                "externalBillingAddressId": {
                  "type": "string",
                  "description": "External billing address ID",
                  "example": "ADDR456"
                },
                "itemText": {
                  "type": "string",
                  "description": "Text describing the quote item",
                  "example": "Sample item text."
                },
                "type": {
                  "type": "string",
                  "description": "Type of the quote item",
                  "example": "standard"
                },
                "externalContractId": {
                  "type": "string",
                  "description": "Related external contract ID",
                  "example": "CONTRACT123"
                },
                "customFields": {
                  "$ref": "#/components/schemas/customFields"
                },
                "customMetadata": {
                  "$ref": "#/components/schemas/JsonObject"
                }
              }
            }
          }
        }
      },
      "goodsReceiptLine": {
        "type": "object",
        "description": "Represents a single line item within a goods receipt.",
        "properties": {
          "goodsReceiptLineNumber": {
            "type": "string",
            "description": "Number of the goods receipt line (unique within the purchase order)",
            "example": "GRLINE-0001"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "Company ID associated with the line item.",
            "example": "DE01"
          },
          "externalPurchaseOrderId": {
            "type": "string",
            "description": "ID of the related purchase order.",
            "example": "4500016221"
          },
          "purchaseOrderLineNumber": {
            "type": "string",
            "description": "Line number of the purchase order being received.",
            "example": "00010"
          },
          "type": {
            "type": "string",
            "description": "Type of item received (e.g., Material, Service).",
            "example": "Service"
          },
          "quantity": {
            "type": "number",
            "format": "double",
            "description": "Quantity of items received.",
            "example": 2
          },
          "unitOfMeasure": {
            "type": "string",
            "description": "Unit of measure for the quantity.",
            "example": "kg"
          },
          "itemText": {
            "type": "string",
            "description": "Descriptive text for the line item.",
            "example": "Dell Laptop Latitude D630"
          },
          "status": {
            "type": "string",
            "description": "Status of goods receipt line as defined in source system (e.g. “invoiced” or “open”)",
            "example": "invoiced"
          },
          "material": {
            "$ref": "#/components/schemas/material"
          },
          "plant": {
            "type": "string",
            "description": "Receiving plant or location.",
            "example": "PLANT-001"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "goodsReceipt": {
        "type": "object",
        "required": [
          "externalId",
          "goodsReceiptLines"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the goods receipt that is globally unique across the provided goods receipt data",
            "example": "GOODS_RECEIPT-0001",
            "pattern": "^\\S+$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "documentId": {
            "type": "string",
            "description": "Document id that was assigned during upload to Hypatos",
            "example": "63cac12c37bb02accb396cbf",
            "pattern": "^[0-9a-fA-F]{24}$"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/document"
            }
          },
          "goodsReceiptNumber": {
            "type": "string",
            "description": "Goods receipt number provided in the source system",
            "example": "GR123456789"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "External unique id of the company in the source system",
            "example": "DE01"
          },
          "externalSupplierId": {
            "type": "string",
            "description": "External unique id of the supplier in the source system",
            "example": "0000100000"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Label used in the source system for the fiscal year that the goods receipt was posted in",
            "example": "2023"
          },
          "issuedDate": {
            "type": "string",
            "description": "Date when the good receipt document was issued",
            "format": "date",
            "example": "2024-12-31"
          },
          "createdDate": {
            "type": "string",
            "description": "Date when the goods receipt was created in the source system",
            "format": "date",
            "example": "2025-06-30"
          },
          "postingDate": {
            "type": "string",
            "description": "Date when the goods receipt was posted",
            "format": "date",
            "example": "2025-06-30"
          },
          "headerText": {
            "type": "string",
            "description": "Header text describing the goods receipt",
            "example": "doc header text"
          },
          "status": {
            "type": "string",
            "description": "Status of the goods receipt as defined in the source system",
            "example": "POSTED"
          },
          "deliveryNoteNumber": {
            "type": "string",
            "description": "Delivery note number associated with the goods receipt",
            "example": "DN789456123"
          },
          "isReversal": {
            "type": "boolean",
            "description": "Indicator if the goods receipt is a reversal",
            "example": false
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "goodsReceiptLines": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/goodsReceiptLine"
            }
          }
        }
      },
      "profitCenter": {
        "type": "object",
        "required": [
          "externalId",
          "code"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the profit center that is globally unique across the provided profit center data",
            "example": "0000100CO1",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "EXTERNAL_CLIENT_ID"
          },
          "code": {
            "type": "string",
            "description": "Code of the profit center in the source system (not unique across clients)",
            "example": "CO1",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "companyAssignment": {
            "type": "array",
            "description": "List of externalCompanyIds that the profit center is assigned to",
            "example": [
              "DE01",
              "US01"
            ],
            "items": {
              "type": "string"
            }
          },
          "department": {
            "type": "string",
            "description": "Department/functional area associated with the profit center as defined in the source system",
            "example": "finance"
          },
          "label": {
            "type": "array",
            "description": "Label describing the profit center",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Sales Engineers",
                "language": "en"
              }
            ]
          },
          "shortLabel": {
            "type": "array",
            "description": "Short label describing the profit center",
            "items": {
              "$ref": "#/components/schemas/languagedText"
            },
            "example": [
              {
                "text": "Sales Eng.",
                "language": "en"
              }
            ]
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "internalOrder": {
        "type": "object",
        "required": [
          "externalId",
          "internalOrderCode"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the internal order that is globally unique across the provided order data",
            "example": "SAP:AUFK:000300123456",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "100"
          },
          "internalOrderCode": {
            "type": "string",
            "description": "Internal order code/number from the source system (not unique across clients)",
            "example": "000300123456",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "internalOrderReferenceNumber": {
            "type": "string",
            "description": "Additional internal order reference number from the source system",
            "example": "ABC1234"
          },
          "createdDate": {
            "type": "string",
            "description": "Date when the internal order record was created in the source system (YYYY-MM-DD)",
            "format": "date",
            "example": "2025-02-10"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Label used in the source system for the fiscal year relevant to the internal order",
            "example": "2023"
          },
          "language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "External unique id of the company in the source system.",
            "example": "DE01"
          },
          "status": {
            "type": "string",
            "description": "Lifecycle status of the internal order",
            "example": "OPEN"
          },
          "type": {
            "type": "string",
            "description": "Order type/category as defined in the source system",
            "example": "overhead"
          },
          "subType": {
            "type": "string",
            "description": "Sub-classification of the internal order as defined in the source system",
            "example": "category"
          },
          "description": {
            "type": "string",
            "description": "Long description of the internal order",
            "example": "Marketing campaign Q2 2025 – brand awareness and lead generation"
          },
          "shortDescription": {
            "type": "string",
            "description": "Short description used in UIs and search",
            "example": "MKT Q2/2025"
          },
          "profitCenterCode": {
            "type": "string",
            "description": "Assigned profit center code",
            "example": "PC4100"
          },
          "costCenterCodeForSettlement": {
            "type": "string",
            "description": "Default receiver cost center used when settling the internal order (if applicable)",
            "example": "CC4105"
          },
          "glAccountCodeForSettlement": {
            "type": "string",
            "description": "Default G/L account (or cost element) used for settlement postings where relevant",
            "example": "GL3094"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      },
      "project": {
        "type": "object",
        "required": [
          "externalId",
          "code"
        ],
        "properties": {
          "externalId": {
            "type": "string",
            "description": "External id of the project that is globally unique across the provided project data",
            "example": "SAP:PRPS:0000123456",
            "pattern": "^\\S([\\S ]*\\S)?$"
          },
          "externalClientId": {
            "type": "string",
            "description": "Identifier of the client entity in the source system which can be used to separate data",
            "example": "100"
          },
          "code": {
            "type": "string",
            "description": "Code of the project in the source system (not unique across clients)",
            "example": "PROJ1234"
          },
          "projectReferenceNumber": {
            "type": "string",
            "description": "Use for converted WBS Element number",
            "example": "PRJ-2025-BER-GRID"
          },
          "createdDate": {
            "type": "string",
            "description": "Date when the project was created",
            "format": "date",
            "example": "2025-01-15"
          },
          "fiscalYearLabel": {
            "type": "string",
            "description": "Label used in the source system for the fiscal year",
            "example": "2025"
          },
          "language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "externalCompanyId": {
            "type": "string",
            "description": "External unique id of the company in the source system",
            "example": "DE01"
          },
          "status": {
            "type": "string",
            "description": "Current status of the project",
            "example": "OPEN"
          },
          "startDate": {
            "type": "string",
            "description": "Project start date",
            "format": "date",
            "example": "2025-01-01"
          },
          "endDate": {
            "type": "string",
            "description": "Project end date",
            "format": "date",
            "example": "2025-01-01"
          },
          "type": {
            "type": "string",
            "description": "Type of the project",
            "example": "consulting"
          },
          "description": {
            "type": "string",
            "description": "Detailed description of the project",
            "example": "Reinforcement of Berlin transmission grid, including substation upgrades and cable replacements."
          },
          "shortDescription": {
            "type": "string",
            "description": "Short description of the project",
            "example": "Berlin Grid Upgrade"
          },
          "profitCenterCode": {
            "type": "string",
            "description": "Code of the profit center associated with the project",
            "example": "PC1001"
          },
          "responsibleCostCenterCode": {
            "type": "string",
            "description": "Code of the responsible cost center",
            "example": "CC2005"
          },
          "costCenterCodeForPosting": {
            "type": "string",
            "description": "Code of the cost center for posting transactions",
            "example": "CC3002"
          },
          "currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "subProjectCode": {
            "type": "string",
            "description": "Code of the sub-project if applicable",
            "example": "BER-GRID-01"
          },
          "parentProjectCode": {
            "type": "string",
            "description": "Code of the parent project if applicable",
            "example": "PRJ-2025-INFRA"
          },
          "customFields": {
            "$ref": "#/components/schemas/customFields"
          },
          "customMetadata": {
            "$ref": "#/components/schemas/JsonObject"
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/auth/token",
            "scopes": {
              "companies.read": "Read companies",
              "documents.read": "Read documents",
              "documents.write": "Edit your documents",
              "enrichment.read": "Read enrichment training data",
              "enrichment.write": "Create/edit enrichment training data",
              "enrichment.delete": "Delete enrichment training data",
              "files.read": "Uploading files for processing",
              "files.write": "Downloading uploaded files",
              "projects.write": "Create/edit projects data",
              "projects.read": "Read projects data",
              "emails.read": "Read emails data",
              "agents.read": "Read agents",
              "agents.write": "Create, update and delete agents",
              "agent-workflows.read": "Read agent workflows",
              "agent-workflows.write": "Create, update and delete agent workflows"
            }
          }
        }
      },
      "Basic": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "responses": {
      "DocumentErrorResponse": {
        "description": "Error occured while processing request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "detail": "The document with given identifier does not exist",
              "status": 404,
              "title": "Document does not exist"
            }
          }
        }
      },
      "CaseErrorResponse": {
        "description": "Error occurred while processing request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "notFound": {
                "value": {
                  "detail": "One or more of the provided file identifiers do not exist",
                  "status": 404,
                  "title": "File not found"
                }
              },
              "badRequest": {
                "value": {
                  "detail": "One of the given project identifiers provided as projectId is invalid",
                  "status": 400,
                  "title": "Provided project identifier is invalid"
                }
              },
              "notAPreProcessingProject": {
                "value": {
                  "detail": "The project with the given identifier is not a pre-processing project and does not support file batch processing",
                  "status": 422,
                  "title": "Project does not support file batch processing"
                }
              },
              "isAPreProcessingProject": {
                "value": {
                  "detail": "The project with the given identifier is a pre-processing project and does not support manual case creation",
                  "status": 422,
                  "title": "Project does not support manual case creation"
                }
              }
            }
          }
        }
      },
      "successfullyInserted": {
        "description": "Successfully inserted",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "example": "3a429dc8-56d4-42ef-a4cf-2ebc9ad1ef38"
                }
              }
            }
          }
        }
      },
      "validationError": {
        "description": "Validation error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/HTTPValidationError"
            }
          }
        }
      },
      "unsupportedMediaType": {
        "description": "Unsupported media type",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/HTTPValidationError"
            }
          }
        }
      },
      "notFound": {
        "description": "Not Found error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "status": 404,
              "title": "Not found"
            }
          }
        }
      },
      "UnauthorizedErrorResponse": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "detail": "Provided no credentials or invalid credentials",
              "status": 401,
              "title": "Unauthorized"
            }
          }
        }
      },
      "ForbiddenErrorResponse": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "detail": "Not enough privileges to perform an action on a resource",
              "status": 403,
              "title": "Forbidden"
            }
          }
        }
      },
      "ProjectClientBadRequestErrorResponse": {
        "description": "Response when client request is wrong",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "Invalid request parameter": {
                "value": {
                  "detail": "One of the given query parameters is invalid",
                  "status": 400,
                  "title": "Provided project identifier is invalid"
                }
              },
              "Invalid payload data": {
                "value": {
                  "detail": "Payload data couldn't be deserialised",
                  "status": 400,
                  "title": "Payload data is invalid"
                }
              }
            }
          }
        }
      },
      "ProjectRequestValidationErrorResponse": {
        "description": "Validation error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "Request validation error": {
                "value": {
                  "detail": "Error details",
                  "status": 422,
                  "title": "Request validation error"
                }
              },
              "Unsupported OCR engine": {
                "value": {
                  "detail": "Only Google and Internal OCR engines are currently supported. Received: abbyy.",
                  "status": 422,
                  "title": "Request validation error"
                }
              }
            }
          }
        }
      },
      "InternalServerErrorResponse": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": 500,
              "title": "Internal Server Error",
              "detail": "Error details"
            }
          }
        }
      },
      "SchemaClientBadRequestErrorResponse": {
        "description": "Response when client request is wrong",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "Invalid request parameter": {
                "value": {
                  "detail": "One of the given query parameters is invalid",
                  "status": 400,
                  "title": "Provided project identifier is invalid"
                }
              },
              "Invalid payload data": {
                "value": {
                  "detail": "One or more of the payload parameters are invalid",
                  "status": 400,
                  "title": "Provided payload is invalid"
                }
              }
            }
          }
        }
      },
      "NotFoundErrorResponse": {
        "description": "Response when resource was not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "Project not found": {
                "value": {
                  "detail": "The project with given identifier does not exist",
                  "status": 404,
                  "title": "Project does not exist"
                }
              }
            }
          }
        }
      },
      "BadRequest": {
        "description": "The request was malformed or contained invalid parameters",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem1"
            }
          }
        }
      },
      "NotFound": {
        "description": "Workflow definition not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem1"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized - missing or invalid bearer token"
      },
      "Forbidden": {
        "description": "Forbidden - bearer token lacks the required scope or target company access"
      },
      "BadRequest1": {
        "description": "The request was malformed or missing required parameters.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GenericError"
            }
          }
        }
      },
      "Unauthorized1": {
        "description": "Missing or invalid `Authorization` header.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GenericError"
            }
          }
        }
      },
      "Forbidden1": {
        "description": "The caller is not permitted to access the resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GenericError"
            }
          }
        }
      },
      "NotFound1": {
        "description": "The requested document, or a transformation rule for the given\n`projectId`, was not found.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GenericError"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "One or more request fields failed validation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "An unexpected error occurred. For failures propagated from Studio, the\noriginal upstream payload is returned as XML rather than this JSON\nenvelope.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GenericError"
            }
          }
        }
      },
      "RateLimitExceeded": {
        "description": "Rate limit exceeded",
        "headers": {
          "x-ratelimit-limit": {
            "$ref": "#/components/headers/x-ratelimit-limit"
          },
          "x-ratelimit-remaining": {
            "$ref": "#/components/headers/x-ratelimit-remaining"
          },
          "x-ratelimit-reset": {
            "$ref": "#/components/headers/x-ratelimit-reset"
          }
        }
      }
    },
    "parameters": {
      "ProjectIdPathParameter": {
        "in": "path",
        "name": "id",
        "schema": {
          "$ref": "#/components/schemas/ProjectId"
        },
        "required": true,
        "description": "Project id"
      },
      "pagingOffset": {
        "in": "query",
        "name": "offset",
        "schema": {
          "type": "integer",
          "minimum": 0
        },
        "required": false,
        "description": "A zero-based offset of the first item in the data collection to return."
      },
      "sortByCreatedAt": {
        "in": "query",
        "name": "sort",
        "schema": {
          "type": "string",
          "enum": [
            "-createdAt",
            "+createdAt"
          ],
          "default": "-createdAt"
        },
        "required": false,
        "description": "The field to sort reponse items by."
      },
      "isLive": {
        "in": "query",
        "name": "isLive",
        "required": false,
        "schema": {
          "type": "boolean"
        }
      },
      "PagingOffset": {
        "in": "query",
        "name": "offset",
        "required": false,
        "description": "A zero-based offset of the first item in the data collection to return.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      },
      "PagingLimit": {
        "in": "query",
        "name": "limit",
        "required": false,
        "description": "Limit the amount of items returned. Values above the maximum are capped.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 50,
          "default": 20
        }
      },
      "ProjectIdQuery": {
        "name": "projectId",
        "in": "query",
        "required": true,
        "description": "Project identifier. Also selects the XSLT transformation rule applied\nto the Studio response (`{projectId}` for single documents,\n`{projectId}-list` for lists).\n",
        "schema": {
          "type": "string"
        }
      },
      "projectId": {
        "in": "query",
        "name": "projectId",
        "schema": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "style": "form",
        "explode": true,
        "required": false,
        "description": "Project ids to to find items by. If ommitted, items from all existing projects are returned."
      },
      "parameters-pagingLimit": {
        "in": "query",
        "name": "limit",
        "schema": {
          "type": "integer",
          "default": 20,
          "minimum": 0,
          "maximum": 50
        },
        "required": false,
        "description": "Limit the amount of items returned in the response. If the value exceeds the maximum, then the maximum value will be used."
      },
      "sortByCreatedAtUpdatedAt": {
        "in": "query",
        "name": "sort",
        "schema": {
          "type": "string",
          "enum": [
            "createdAt",
            "-createdAt",
            "+createdAt",
            "updatedAt",
            "-updatedAt",
            "+updatedAt"
          ],
          "default": "-createdAt"
        },
        "required": false,
        "description": "The field to sort reponse items by."
      }
    },
    "headers": {
      "x-ratelimit-limit": {
        "description": "Indicates the request-quota associated to the client in the current time-window followed by the description of the quota policy.",
        "schema": {
          "type": "string"
        },
        "example": "10, 10;w=1"
      },
      "x-ratelimit-remaining": {
        "description": "The number of remaining requests in the current time-window",
        "schema": {
          "type": "integer"
        },
        "example": 94
      },
      "x-ratelimit-reset": {
        "description": "The number of seconds until quota reset of the current time-window",
        "schema": {
          "type": "integer"
        },
        "example": 21
      }
    }
  }
}