> For the complete documentation index, see [llms.txt](https://docs.whitearrow.com/white-arrow-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.whitearrow.com/white-arrow-api-documentation/upload-files.md).

# Upload Files

**POST v2/{modelType}/{modelID}/files**

Uploads file: Use a multipart form. The file should be in the field 'file' and the description\_id should be in the field description.

| Description           | Value |
| --------------------- | ----- |
| Rate Confirmation     | 1     |
| Pickup Document (BOL) | 2     |
| Miscellaneous         | 3     |

#### The Endpoint

```html
POST https://api.test.archer-app.com/v2/loads/999999/files
```

### Examples

cURL

```bash
curl --request POST \
  --url https://api.test.archer-app.com/v2/loads/999999/files \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --cookie 'auth-server-token=TOKEN;' \
  --form file=confirmation.pdf \
  --form description=1
```

JavaScript&#x20;

```javascript
var data = new FormData();
data.append("file", "~/confirmation.pdf");
data.append("description", "1");

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.test.archer-app.com/v2/loads/999999/files");
xhr.setRequestHeader("cookie", "auth-server-token=TOKEN;");

xhr.send(data);
```

***

### Body Object

None

## ExampleBody

None

***

## Response

Returns the file information.

### Response Properties

| Name        | Type   | Description     |
| ----------- | ------ | --------------- |
| id          | int    | File Id.        |
| modelType   | string | Model name.     |
| modelId     | int    | Model Id.       |
| description | int    | Description Id. |
| name        | string | The file name.  |

## Example Response

```json
{
  "id": 12,
  "modelType": "Load",
  "modelId": 999999,
  "description": "Rate Confirmation",
  "name": "loads_999999_Rate Confirmation_150000000.pdf"
}
```

## Example Error Response

**When the User is trying to upload a file to an object that is not one of their own.**

```json
{
  "message": "The load number 99999999 is not a valid load for this user.",
  "title": "Internal Error"
}
```

***

***
