File Endpoints

Get all files for a specific user

POST /api/documents

Returns all files for the user with the given auth0_id.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

auth0_id

string

Id generated by auth0 for this user

Response

[
    {
        "id": 52,
        "filename": "Example.txt",
        "user": {
            "id": 8,
            "auth0_id": "auth0|663853106fa7baf42014492e",
            "username": "user@example.com",
            "email": "user@example.com",
            "lang": "en",
            "max_api_calls": 47
        },
        "fileSize": 9312,
        "lang": "en",
        "uploadedAt": "2024-03-30T13:28:13.756230Z"
    },
    {
        "id": 53,
        "filename": "Example2.txt",
        "user": {
            "id": 8,
            "auth0_id": "auth0|663853106fa7baf42014492e",
            "username": "user@example.com",
            "email": "user@example.com",
            "lang": "en",
            "max_api_calls": 47
        },
        "fileSize": 6799,
        "lang": "en",
        "uploadedAt": "2024-03-30T13:28:18.721243Z"
    }
]

Get a specific file

GET /api/documents/<document_id>

Returns a specific file.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

Create a file (upload)

POST /api/documents/upload

Uploads a file and creates the entries in the database.

Headers

Name
Value

Authorization

Bearer <token>

Response

Delete a list of files

DELETE /api/documents

Deletes all files in the given list of file ids.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

<file_ids>

array

Just a list of file ids

Response

Last updated