# Send the bytes of a reserved file

> Source: https://elaichi.ai/docs/api-reference/files/file/stagefileupload/

`PUT /file/upload-request/{id}/file/{file_id}`

Resource: **File** · API: **Files**

## Path parameters

- **`id`** _(string, required)_
  Request id (`fupr_…`).
- **`file_id`** _(string, required)_
  The slot id from the reservation.

## Response body

- **`file`** _(object)_
  - **`file_id`** _(string)_
  - **`filename`** _(string)_
  - **`size_bytes`** _(integer,null)_
  - **`mime`** _(string,null)_
  - **`state`** _(string)_
    Allowed: `uploading`, `staged`, `ready`, `stalled`

## Code examples

### curl

```bash
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'
```

### JavaScript

```javascript
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);
```

### Python

```python
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())
```
