POST
/
files
/
upload
curl --request POST \
  --url https://api.duohub.ai/files/upload \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "fileName": "document.pdf"
}'
{
  "status": "success",
  "data": {
    "uploadUrl": "https://bucket-name.s3.region.amazonaws.com/user123/abc123.pdf?X-Amz-Algorithm=...",
    "key": "user123/abc123.pdf"
  }
}

Call this endpoint to get a signed URL which you can use to upload files to the system. You will receive a key along with the signed URL.

After you have uploaded the file, you need to create a record of it using the Create File endpoint.

Use the key you received in the response to create the file record.

Authorizations

X-API-Key
string
header
required

Your duohub API key. Type: str

Body

application/json
fileName
string
required

Name of the file to upload

Response

200
application/json
Pre-signed URL generated successfully
status
enum<string>
required
Available options:
success
data
object
required