Skip to content

Private documents per end user

Most documents are shared: every question in the project can use them. A private document belongs to one end user, your own id for one of your customers. Only questions asked with that same end_user_id can use it.

Add end_user_id to the upload.

Terminal window
curl https://api.beru.airesearchlabs.si/v1/documents \
-H "Authorization: Bearer $BERU_API_KEY" \
-F file=@treatment-plan.pdf \
-F end_user_id=customer_4821

Send the same end_user_id with the question. Beru searches the shared documents plus that person’s private ones, and recalls their memories.

Terminal window
curl https://api.beru.airesearchlabs.si/v1/answer \
-H "Authorization: Bearer $BERU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "When is my next appointment?", "end_user_id": "customer_4821"}'

Without end_user_id, or with anyone else’s, the private document is never searched, cited or mentioned. This is enforced in the database and tested on every release.

Terminal window
# Only this person's private documents
curl "https://api.beru.airesearchlabs.si/v1/documents?end_user_id=customer_4821" \
-H "Authorization: Bearer $BERU_API_KEY"
# Delete one: the file and everything learned from it go at once
curl -X DELETE https://api.beru.airesearchlabs.si/v1/documents/DOCUMENT_ID \
-H "Authorization: Bearer $BERU_API_KEY"