Zum Inhalt

Reference

Documents

GET/api/v1/documentsSearch documents

Searches filed documents (invoices, contracts, minutes, …) by meaning and by exact terms such as invoice numbers. Returns the best documents with matching passages and SharePoint links. Use get_document for the full text of one.scope documents:read

Query

queryrequiredstringA question or words to find.
document_typestringE.g. Eingangsrechnung, Vertrag, Protokoll.
company_idstring
order_idstring
fromstringDocument date from, YYYY-MM-DD.
tostringDocument date to, YYYY-MM-DD.
limitinteger

Response 200

idstring
file_namestring
urlstring | null
document_typestring | null
document_datestring | null
companystring | null
orderstring | null
passagesstring[]
Schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "file_name": {
        "type": "string"
      },
      "url": {
        "type": [
          "string",
          "null"
        ]
      },
      "document_type": {
        "type": [
          "string",
          "null"
        ]
      },
      "document_date": {
        "type": [
          "string",
          "null"
        ]
      },
      "company": {
        "type": [
          "string",
          "null"
        ]
      },
      "order": {
        "type": [
          "string",
          "null"
        ]
      },
      "passages": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "id",
      "file_name",
      "url",
      "document_type",
      "document_date",
      "company",
      "order",
      "passages"
    ],
    "additionalProperties": false
  }
}

Refusals are problems with a code — see Errors.

GET/api/v1/documents/{id}Get document

The full text, metadata and SharePoint link of one filed document, by the id search_documents returned.scope documents:read

Path

idrequiredstring

Response 200

idstring
file_namestring | null
pathstring | null
urlstring | null
document_typestring | null
document_datestring | null
companyobject | null
company.idstring
company.namestring
orderobject | null
order.idstring
order.numberstring
metadataany
tasksstring[]
textstring | null
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "file_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "path": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": [
        "string",
        "null"
      ]
    },
    "document_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "document_date": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "order": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "number": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "number"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "metadata": {},
    "tasks": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "text": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "file_name",
    "path",
    "url",
    "document_type",
    "document_date",
    "company",
    "order",
    "metadata",
    "tasks",
    "text"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.