> For the complete documentation index, see [llms.txt](https://knowledge.out-smart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.out-smart.com/openapi/documents.md).

# Documents

## Add documents

> Each document record can contain the following data:\
> \
> \| Parameter | Description | Required | \*\*Type\*\* |\
> \| --- | --- | --- | --- |\
> \| doc\_name\_ln | Pretty name of the file | Y | Varchar |\
> \| doc\_file\_ln | Raw file name with extension | Y | Varchar |\
> \| doc\_data | Base 64 encoded file | Y | Base 64 encoded data |\
> \| drn\_type | Document relation type. Can by any of: 'TYPE','CUSTOMER','PROJECT','ADDRESS','OBJECT','QUOTATION','INVOICE' | Y | Varchar |\
> \| drn\_internal\_reference | Document relation reference. Can be an array of string. The value should match to the relation type. For example obj\_code(OBJECT) or debtor\_number(CUSTOMER) | Y | Varchar or array |\
> \| doc\_active\_ind | Indication if a document is active | N | Boolean (1 or 0) |\
> \| doc\_visibility | Indication if a document should be visible in the app | N | Boolean (1 or 0) |\
> \| doc\_workorder | Indiction if a document should be added to the workorder | N | Boolean (1 or 0) |\
> \| doc\_portal | Indication if a document should be visible in the portal (depending on drn\_type) | N | Boolean (1 or 0) |\
> \| doc\_internal | Indication if a document is marked as internal | N | Boolean (1 or 0) |\
> \
> Possible errors:\
> \
> Missing fields  \
> Invalid base64 data posted  \
> File extension not allowed  \
> Invalid drn\_type posted

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/documents/":{"post":{"summary":"Add documents","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Add documents","headers":{"Date":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"X-Frame-Options":{"schema":{"type":"string"}},"X-XSS-Protection":{"schema":{"type":"string"}},"X-Content-Type-Options":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"Referrer-Policy":{"schema":{"type":"string"}},"Feature-Policy":{"schema":{"type":"string"}},"X-Powered-By":{"schema":{"type":"string"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Keep-Alive":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"messages":{"type":"array"},"response":{"type":"integer"}}}}}}},"tags":["Documents"],"description":"Each document record can contain the following data:\n\n| Parameter | Description | Required | **Type** |\n| --- | --- | --- | --- |\n| doc_name_ln | Pretty name of the file | Y | Varchar |\n| doc_file_ln | Raw file name with extension | Y | Varchar |\n| doc_data | Base 64 encoded file | Y | Base 64 encoded data |\n| drn_type | Document relation type. Can by any of: 'TYPE','CUSTOMER','PROJECT','ADDRESS','OBJECT','QUOTATION','INVOICE' | Y | Varchar |\n| drn_internal_reference | Document relation reference. Can be an array of string. The value should match to the relation type. For example obj_code(OBJECT) or debtor_number(CUSTOMER) | Y | Varchar or array |\n| doc_active_ind | Indication if a document is active | N | Boolean (1 or 0) |\n| doc_visibility | Indication if a document should be visible in the app | N | Boolean (1 or 0) |\n| doc_workorder | Indiction if a document should be added to the workorder | N | Boolean (1 or 0) |\n| doc_portal | Indication if a document should be visible in the portal (depending on drn_type) | N | Boolean (1 or 0) |\n| doc_internal | Indication if a document is marked as internal | N | Boolean (1 or 0) |\n\nPossible errors:\n\nMissing fields  \nInvalid base64 data posted  \nFile extension not allowed  \nInvalid drn_type posted"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledge.out-smart.com/openapi/documents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
