# Upload file

Upload a file and link it to the specified Moov account.

The maximum file size is 20MB. Each account is allowed a maximum of 50 files. Acceptable file types include csv, jpg, pdf, and png.

To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need to specify the `/accounts/{accountID}/files.write` scope.

### Request

**Endpoint:**

```
POST /accounts/{accountID}/files
```

### cURL Example

```shell
curl -X POST "https://api.moov.io/accounts/{accountID}/files" \
  -H "Authorization: Bearer {token}" \
  -H "X-Moov-Version: v2026.07.00" \
  -F "file=@/path/to/file" \
  -F "filePurpose=representative_verification" \
  -F 'metadata={}''
```

### Go Example

```go
mc, _ := moov.NewClient()

var accountID string
file, _ := os.Open("/path/to/file.csv")

mc.UploadFile(ctx, accountID, moov.UploadFile{
    FilePurpose: moov.FilePurpose_MerchantUnderwriting,
    Metadata: map[string]string{
        "requirement_id": "business.underwriting-documents-tier-one",
        "other_keys":     "for customer use",
    },
    Filename: "file.csv",
    File:     file,
})
```

### TypeScript Example

```typescript
import { Moov } from "@moovio/sdk";
import { openAsBlob } from "node:fs";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.files.upload({
    accountID: "221c30bd-2551-4ae4-9a14-07bf6599b728",
    fileUploadRequestMultiPart: {
      file: await openAsBlob("example.file"),
      filePurpose: "representative_verification",
    },
  });
  
  console.log(result);
}

run();
```

### PHP Example

```php
declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\
