This API endpoint allows users to upload a file with its metadata. Note that this example assumes the file metadata is being sent in JSON format rather than the actual file content. You will need to modify the endpoint to handle the actual file content as well.

Request

POST http://localhost:3000/files/upload

Headers

Body


{
    "file": {
        "name": "test.png",
        "size": 100000,
        "type": "image/png"
    }
}

Example

cURL


curl --location '<http://localhost:3000/files/upload>' \\
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE2Nzk5NjYyODZ9.WQ3VQvq0YehJk2f-vDqOYe-5BqWz35nPWyNx5A0O-q0' \\
--header 'Content-Type: application/json' \\
--data '{
    "file": {
        "name": "test.png",
        "size": 100000,
        "type": "image/png"
    }
}'

Response

Success


{
    "presigned_url": "https://...."
}

Error