Room Endpoints

Get all rooms of a user

GET /api/rooms?user_auth0_id=<auth0_id>

Returns all rooms of a specific user.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

[
    {
        "id": 10,
        "user": {
            "id": 8,
            "auth0_id": "auth0|663853106fa7baf42014492e",
            "username": "user@example.com",
            "email": "user@example.com",
            "lang": "en",
            "max_api_calls": 47
        },
        "name": "New Room",
        "anonymizeCompleteContext": true,
        "messages": [],
        "files": [
            {
                "id": 53,
                "filename": "Example.txt",
                "text": "exampleText...",
                "user": 8,
                "fileSize": 6799,
                "lang": "en",
                "uploadedAt": "2024-03-30T13:28:18.721243Z"
            }
        ],
        "created_at": "2024-03-30T13:34:21.930509Z",
        "settings": {
            "templates": {
                "de": "Beantworten Sie die Frage anhand des unten stehenden Kontextes. Wenn die\nFrage nicht mit den angegebenen Informationen beantwortet werden kann, antworten Sie\nmit \"Ich weiß es nicht\".\n\"\"",
                "en": "Answer the question using the context below. If the\nquestion cannot be answered with the information provided, answer with \"I don't know\".\n\"\""
            },
            "prompt_template": "Answer the question using the context below. If the\nquestion cannot be answered with the information provided, answer with \"I don't know\".\n\"\"",
            "pre_phrase_count": 2,
            "post_phrase_count": 2
        },
        "anonymizationMappings": []
    }
]

Get a single room

GET /api/rooms/<room_id>

Returns a specific room.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

Create a room

POST /api/rooms

Creates a room for the specific user. Returns the created room.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

user_auth0_id

string

Id generated by auth0 for this user

room_name

string

Name of the room

Response

Update a room

PUT /api/rooms/<room_id>

Updates the name of a room. Returns the room with the updated name.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

user_auth0_id

string

Id generated by auth0 for this user

room_name

string

Name of the room

Response

Update the file list of a room

POST /api/rooms/<room_id>/documents

Updates the files associated with a room. Returns the room with the updated list of files.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

<file_ids>

array

Just a list of file ids to be added

Response

Delete a room

DELETE /api/rooms/<room_id>

Deletes a specific room. Returns the deleted room.

Headers

Name
Value

Authorization

Bearer <token>

Response

Last updated