Upload Document
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents \
--header 'Content-Type: multipart/form-data' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--form file='@example-file' \
--form file_tag=BUSINESS_REG_DOCSconst form = new FormData();
form.append('file', '<string>');
form.append('file_tag', 'BUSINESS_REG_DOCS');
const options = {
method: 'POST',
headers: {'x-carbon-key': '<x-carbon-key>', apikey: '<api-key>'}
};
options.body = form;
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_tag\"\r\n\r\nBUSINESS_REG_DOCS\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"apikey: <api-key>",
"x-carbon-key: <x-carbon-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "file_tag": "BUSINESS_REG_DOCS" }
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_tag\"\r\n\r\nBUSINESS_REG_DOCS\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_tag\"\r\n\r\nBUSINESS_REG_DOCS\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"data": {
"file_url": "https://storage.example.com/documents/abc123.pdf"
}
}Loans
Upload Loan Document
Upload a supporting document for a loan application. One file per request.
POST
/
v1
/
loans
/
{applicationId}
/
documents
Upload Document
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents \
--header 'Content-Type: multipart/form-data' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--form file='@example-file' \
--form file_tag=BUSINESS_REG_DOCSconst form = new FormData();
form.append('file', '<string>');
form.append('file_tag', 'BUSINESS_REG_DOCS');
const options = {
method: 'POST',
headers: {'x-carbon-key': '<x-carbon-key>', apikey: '<api-key>'}
};
options.body = form;
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_tag\"\r\n\r\nBUSINESS_REG_DOCS\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"apikey: <api-key>",
"x-carbon-key: <x-carbon-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "file_tag": "BUSINESS_REG_DOCS" }
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_tag\"\r\n\r\nBUSINESS_REG_DOCS\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/documents"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_tag\"\r\n\r\nBUSINESS_REG_DOCS\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"data": {
"file_url": "https://storage.example.com/documents/abc123.pdf"
}
}Overview
Uploads a single document to the loan application. Send one request per file. Accepted formats are PDF, JPEG, and PNG (max 10 MB). Thefile_url returned in the response is required when calling POST /v1/loans/:applicationId/board-resolution.
Content-Type: multipart/form-data
Request
Method:POSTURL:
/v1/loans/:applicationId/documents
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
applicationId | Path | string | Yes | Application ID. |
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | PDF, JPEG, or PNG. Max 10 MB. |
file_tag | string | Yes | Document category. See enum below. |
file_tag values:
| Value | Description |
|---|---|
ADDITIONAL_DOCS | Miscellaneous supporting documents |
BANK_STATEMENTS | Bank statement documents |
BUSINESS_REG_DOCS | CAC certificate — unlocks the CAC underwriting stage |
CAC_FORM7_DOCS | CAC Form 7 — also unlocks the CAC underwriting stage |
FIN_ACCT_DOCS | Financial account documents |
ID_CARD_DOCS | Identity card documents |
PAYEE_PAYMENTS_DOCS | Payee/PAYE payment receipts |
PENSION_PAYMENTS_DOCS | Pension payment records |
TAX_RETURNS_DOCS | Tax return documents |
ADDRESS_VERIFICATION_DOC | Utility bills or rent receipt for address verification |
BOARD_RESOLUTION_DOC | Board resolution document — use file_url from this response in POST /board-resolution |
Response
200 OK
{
"status": "success",
"message": "Loan document uploaded",
"data": {
"filename": "cac_certificate.pdf",
"file_url": "https://storage.carbon.ng/files/abc123def456",
"file_tag": "BUSINESS_REG_DOCS",
"uploaded": true
}
}
| Field | Description |
|---|---|
file_url | URL of the uploaded file. Save this — required for POST /board-resolution. |
file_tag | The tag that was submitted |
uploaded | true on success |
Error Responses
| Status | Message | Cause |
|---|---|---|
| 400 | file is required | No file attached |
| 400 | Only PDF and image files (JPEG, PNG) are accepted | Unsupported file type |
| 400 | File size must not exceed 10 MB | File too large |
| 400 | file_tag is required | Missing tag |
| 400 | file_tag must be one of: ... | Invalid tag value |
| 400 | Application not found | Invalid applicationId |
| 422 | Application has no loan ID | Application not yet registered |
Authorizations
Provide your API key in the 'apikey' header.
Headers
Path Parameters
Body
multipart/form-data
Upload a document file.
Response
200 - application/json
Successful response
The response is of type object.
⌘I