Upload file | Moov Documentation
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 you'll need to specify the /accounts/{accountID}/files.write scope.
POST
/accounts/{accountID}/files
Ask
curl -X POST "https://api.moov.io/accounts/{accountID}/files" \
-H "Authorization: Bearer {token}" \
-H "X-Moov-Version: v2026.04.00" \
-F "file=@/path/to/file" \
-F "filePurpose=representative_verification" \
-F 'metadata={}''
Ask
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,
})
Ask
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();
Ask
declare(strict_types=1);
require 'vendor/autoload.php';
use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;
$sdk = MoovPhp\Moov::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$fileUploadRequestMultiPart = new Components\FileUploadRequestMultiPart(
file: new Components\FileUploadRequestMultiPartFile(
fileName: 'example.file',
content: file_get_contents('example.file');,
),
filePurpose: Components\FilePurpose::RepresentativeVerification,
);
$response = $sdk->files->upload(
accountID: '51ae4a14-07bf-4659-b9b7-285439b7a22e',
fileUploadRequestMultiPart: $fileUploadRequestMultiPart
);
if ($response->fileDetails !== null) {
// handle response
}
Ask
package hello.world;
import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.FileValidationError;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.UploadFileResponse;
import io.moov.sdk.utils.Utils;
import java.io.FileInputStream;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws GenericError, FileValidationError, Exception {
Moov sdk = Moov.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
UploadFileResponse res = sdk.files().upload()
.accountID("51ae4a14-07bf-4659-b9b7-285439b7a22e")
.fileUploadRequestMultiPart(FileUploadRequestMultiPart.builder()
.file(FileUploadRequestMultiPartFile.builder()
.fileName("example.file")
.content(Utils.readBytesAndClose(new FileInputStream("example.file")))
.build())
.filePurpose(FilePurpose.REPRESENTATIVE_VERIFICATION)
.build())
.call();
}
}
Ask
from moovio_sdk import Moov
from moovio_sdk.models import components
with Moov(
security=components.Security(
username="",
password="",
),
) as moov:
res = moov.files.upload(account_id="221c30bd-2551-4ae4-9a14-07bf6599b728", file={
"file_name": "example.file",
"content": open("example.file", "rb"),
}, file_purpose=components.FilePurpose.REPRESENTATIVE_VERIFICATION)
# Handle response
print(res)
Ask
require 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
security: Models::Components::Security.new(
username: '',
password: ''
)
)
res = s.files.upload(account_id: '221c30bd-2551-4ae4-9a14-07bf6599b728', file_upload_request_multi_part: Models::Components::FileUploadRequestMultiPart.new(
file: Models::Components::FileUploadRequestMultiPartFile.new(
file_name: 'example.file',
content: File.binread('example.file')
),
file_purpose: Models::Components::FilePurpose::REPRESENTATIVE_VERIFICATION
))
unless res.file_details.nil?
# handle response
end
Ask
using Moov.Sdk;
using Moov.Sdk.Models.Components;
var sdk = new MoovClient(security: new Security() {
Username = "",
Password = "",
});
var res = await sdk.Files.UploadAsync(
accountID: "221c30bd-2551-4ae4-9a14-07bf6599b728",
body: new FileUploadRequestMultiPart() {
File = new FileUploadRequestMultiPartFile() {
FileName = "example.file",
Content = System.IO.File.ReadAllBytes("example.file"),
},
FilePurpose = FilePurpose.RepresentativeVerification,
}
);
// handle response
The request completed successfully.
Example
Describes a file linked to a Moov account.
{
"fileID": "string",
"fileName": "logo.png",
"accountID": "string",
"filePurpose": "representative_verification",
"fileStatus": "pending",
"metadata": "{\"error_code\": \"document-name-mismatch\", \"requirement_id\": \"document.individual.verification\", \"representative_id\": \"c63ab175-251d-497e-a267-7346d087e180\", \"comment\": \"testing comment\"",
"decisionReason": "not correct file",
"fileSizeBytes": 0,
"createdOn": "2019-08-24T14:15:22Z",
"updatedOn": "2019-08-24T14:15:22Z"
}
Response headers
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
Example
{
"error": "string"
}
Response headers
A unique identifier used to trace requests.
The request contained missing or expired authentication.
Response headers
A unique identifier used to trace requests.
The user is not authorized to make the request.
Response headers
A unique identifier used to trace requests.
The requested resource was not found.
Response headers
A unique identifier used to trace requests.
The request conflicted with the current state of the target resource.
Example
{
"error": "string"
}
Response headers
A unique identifier used to trace requests.
The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields.
Example
{
"error": "string",
"file": "string",
"FileName": "string",
"filePurpose": "string",
"metadata": "string"
}
Response headers
A unique identifier used to trace requests.
Request was refused due to rate limiting.
Response headers
A unique identifier used to trace requests.
The request failed due to an unexpected error.
Response headers
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.
Response headers
A unique identifier used to trace requests.
Set this header to v2026.04.00 to use the API described in this specification. When omitted, the server defaults to v2024.01.00, which may not match the behavior documented here.
Possible values:
v2026.04.00
The file to upload. Valid types are csv, png, jpeg, pdf.
The purpose of the file being uploaded.
Possible values:
business_verification,representative_verification,individual_verification,merchant_underwriting,account_requirement,identity_verification
Additional metadata to be stored with the file.
Additional metadata to be stored with the file.
Show child attributes
Comments or notes about the file.
The representative ID that the file is for. Required when filePurpose is representativeVerification.
Describes a file linked to a Moov account.
The purpose of the file being uploaded.
Possible values:
business_verification,representative_verification,individual_verification,merchant_underwriting,account_requirement,identity_verification
The file's status.
Possible values:
pending,approved,rejected