Finalize an upload
curl --request POST \
--url https://api.nextlevelmca.com/v1/documents/{id}/finalize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"file_size": 2
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_size: 2})
};
fetch('https://api.nextlevelmca.com/v1/documents/{id}/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nextlevelmca.com/v1/documents/{id}/finalize"
payload = { "file_size": 2 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"deal_id": "<string>",
"name": "<string>",
"type": "application",
"mime_type": "<string>",
"file_size": 123,
"upload_pending": true,
"variant": "original",
"source": "<string>",
"ocr_status": "<string>",
"shared_with_merchant": true,
"uploaded_by_id": "<string>",
"uploaded_at": "<string>",
"created_at": "<string>",
"download_url": "<string>",
"download_url_expires_at": "<string>"
},
"meta": {}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}Documents
Finalize an upload
Confirms the file was uploaded to the presigned URL, records its size, makes the document visible in the app and, for bank-statement documents, recomputes statement coverage and, for a PDF, adds the watermarked copy that is sent to lenders (listed as its own document with variant: "watermarked"). Returns 409 upload_not_found when nothing was uploaded yet. Safe to call more than once. Statement analysis itself is started from the app (it is billed per file).
POST
/
v1
/
documents
/
{id}
/
finalize
Finalize an upload
curl --request POST \
--url https://api.nextlevelmca.com/v1/documents/{id}/finalize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"file_size": 2
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_size: 2})
};
fetch('https://api.nextlevelmca.com/v1/documents/{id}/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nextlevelmca.com/v1/documents/{id}/finalize"
payload = { "file_size": 2 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "<string>",
"deal_id": "<string>",
"name": "<string>",
"type": "application",
"mime_type": "<string>",
"file_size": 123,
"upload_pending": true,
"variant": "original",
"source": "<string>",
"ocr_status": "<string>",
"shared_with_merchant": true,
"uploaded_by_id": "<string>",
"uploaded_at": "<string>",
"created_at": "<string>",
"download_url": "<string>",
"download_url_expires_at": "<string>"
},
"meta": {}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
API key (nlmca_live_…) or OAuth access token
Path Parameters
Document id returned by the upload step
Body
application/json
Size in bytes of the uploaded file. Falls back to the stored object size.
Required range:
x >= 1Was this page helpful?