diff --git a/modules/restapi/src/main/resources/docspell-openapi.yml b/modules/restapi/src/main/resources/docspell-openapi.yml index 74b0f883..0b7c70f5 100644 --- a/modules/restapi/src/main/resources/docspell-openapi.yml +++ b/modules/restapi/src/main/resources/docspell-openapi.yml @@ -151,6 +151,51 @@ paths: application/json: schema: $ref: "#/components/schemas/BasicResult" + /open/integration/item/{id}: + post: + tags: [ Upload ] + summary: Upload files to docspell. + description: | + Upload a file to docspell for processing. The id is a + *collective name*. This route only exists, if enabled by an + admin in the configuration. The route might be protected by + different methods, all configurable via the configuration: + + - A specific header must be prestent + - username/password via HTTP Basic mechanism + - a specific source ip + + Files are submitted for processing to the specified + collective, which eventually resuts in an item in their inbox. + + The request must be a `multipart/form-data` request, where the + first part has name `meta`, is optional and may contain upload + metadata as JSON. Checkout the structure `ItemUploadMeta` at + the end if it is not shown here. Other parts specify the + files. Multiple files can be specified, but at least on is + required. + parameters: + - $ref: "#/components/parameters/id" + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + meta: + $ref: "#/components/schemas/ItemUploadMeta" + file: + type: array + items: + type: string + format: binary + responses: + 200: + description: Ok + content: + application/json: + schema: + $ref: "#/components/schemas/BasicResult" /sec/checkfile/{checksum}: get: tags: [ Upload ]