Send the bytes of a reserved file
/file/upload-request/{id}/file/{file_id}
The body is the file: send `Content-Type` and a `Content-Length` (`411` `upload_length_required` without one; it may not exceed the size reserved). One body per slot. Streamed into storage with the size counted on the bytes actually read (`413` `upload_too_large`, nothing kept) and the type read from the bytes: a file whose bytes are a specific type outside `accept` is refused `415` even when its name and header said otherwise. The file is STAGED, not yet a file: it appears in no list and no tool can use it until the request is confirmed. Any failure, or a `DELETE` of the slot while the body is still arriving, removes the slot and its bytes. An upload that began before the cutoff may finish; each finished file keeps the request confirmable for five more minutes, never past a hard ceiling of 35 minutes after it was made.
Path Parameters
Request id (fupr_…).
The slot id from the reservation.
Response Body
uploadingstagedreadystalled
curl -X PUT 'https://api.elaichi.ai/file/upload-request/<id>/file/<file_id>' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json'const response = await fetch('https://api.elaichi.ai/file/upload-request/<id>/file/<file_id>', {
method: 'PUT',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/file/upload-request/<id>/file/<file_id>"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
response = requests.put(url, headers=headers)
print(response.json())