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
curl -X POST "https://api.moov.io/accounts/{accountID}/files" \
-H "Authorization: Bearer {token}" \
-H "x-moov-version: v2024.01.00" \
--form \
-F "file=@/path/to/your/file.txt" \
-F "filePurpose=business_verification" \
-F "metadata={\"representative_id\":\"string\"}"
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,
})
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()
.xMoovVersion("v2024.01.00")
.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();
}
}using Moov.Sdk;
using Moov.Sdk.Models.Components;
var sdk = new MoovClient(xMoovVersion: "<value>");
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 responserequire 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
x_moov_version: 'v2024.01.00',
)
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
endimport { Moov } from "@moovio/sdk";
import { openAsBlob } from "node:fs";
const moov = new Moov({
xMoovVersion: "v2024.01.00",
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();declare(strict_types=1);
require 'vendor/autoload.php';
use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;
$sdk = MoovPhp\Moov::builder()
->setXMoovVersion('v2024.01.00')
->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
}from moovio_sdk import Moov
from moovio_sdk.models import components
with Moov(
x_moov_version="v2024.01.00",
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)The request completed successfully.
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
x-request-id
string
required
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
{
"error": "string"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request contained missing or expired authentication.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The user is not authorized to make the request.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The requested resource was not found.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request conflicted with the current state of the target resource.
{
"error": "string"
}Response headers
x-request-id
string
required
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.
{
"error": "string",
"file": "string",
"FileName": "string",
"filePurpose": "string",
"metadata": "string"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Request was refused due to rate limiting.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request failed due to an unexpected error.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Headers
X-Moov-Version
string
Specify an API version.
API versioning follows the format vYYYY.QQ.BB, where
YYYYis the yearQQis the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)BBis the build number, starting at.01, for subsequent builds in the same quarter.- For example,
v2024.01.00is the initial release of the first quarter of 2024.
- For example,
The dev version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
When no version is specified, the API defaults to v2024.01.00.
Path parameters
accountID
string
required
Body
multipart/form-data
file
string<binary>
required
The file to be added. Valid types are
csv, png, jpeg, pdf.
filePurpose
string
required
The purpose of the file being uploaded.
The file's purpose.
Possible values:
business_verification,
representative_verification,
individual_verification,
merchant_underwriting,
account_requirement,
identity_verification
metadata
string
Additional metadata to be stored with the file, formatted as a JSON string.
Valid keys are representative_id, comment, requirement_id, error_code.
Response
accountID
string
required
createdOn
string<date-time>
required
fileID
string
required
fileName
string
<=64 characters
required
filePurpose
string<enum>
required
The file's purpose.
Possible values:
business_verification,
representative_verification,
individual_verification,
merchant_underwriting,
account_requirement,
identity_verification
fileSizeBytes
integer
required
fileStatus
string<enum>
required
The file's status.
Possible values:
pending,
approved,
rejected
metadata
string<json>
required
updatedOn
string<date-time>
required
decisionReason
string