Store documents and send notifications
These operations use the bank-client bearer token. You can only access documents for accounts and customers at your bank. Browse the Operations module in the API explorer for complete fields and response variants.
Upload a document
POST /api/operations/v1/uploaddocument accepts JSON, not multipart form data. Supply exactly one owner: accountNumber for an account document, or customerID for an individual/corporate customer KYC document. These are business identifiers, not numeric record IDs.
{
"accountNumber": "0123456789",
"name": "Integration document reference",
"type": 3,
"isFile": false,
"value": "DOC-10021"
}
Replace the example account number and document reference with your own values. Document type values are 0 (PNG), 1 (JPEG), 2 (PDF) and 3 (Text). With isFile: true (the default), value contains base64url-encoded file bytes, with a maximum decoded size of 10 MiB. Send the encoded bytes only, without a file URL or data-URL prefix. The bank’s server and proxy must allow enough space for the encoded request.
For a small file example, the following body stores a text file whose content is Integration test:
{
"accountNumber": "0123456789",
"name": "Integration test file",
"type": 3,
"isFile": true,
"value": "SW50ZWdyYXRpb24gdGVzdA"
}
Replace the account number before using this staging example. For your own file, encode its bytes as base64url. For example, this command uses Node.js to encode a local file without line breaks:
node -e 'process.stdout.write(require("node:fs").readFileSync(process.argv[1]).toString("base64url"))' ./document.txt
Paste that output into value in a JSON body and select the matching document type. Keep isFile: true; a URL or a file path is not file content.
Save data.id and the owner document type (account or customer). Account-document IDs and customer-document IDs come from separate stores and can overlap.
List and retrieve
GET /api/operations/v1/listdocuments?AccountNumber=... lists account document metadata. Use ?CustomerID=... for a customer's KYC documents. Supply exactly one owner, with optional PageNumber (default 1) and PageSize (default 20, maximum 200).
The result contains data.data and data.recordCount. Each item includes id, documentScope, name, type, file flag and creation time. Values are excluded from listing so large files are not repeatedly transferred.
GET /api/operations/v1/getdocument/{documentScope}/{id} retrieves one document, including data.value. Use the scope from listing and its positive numeric ID. Decode base64url only when isFile is true; text values remain strings. A missing or another bank’s document returns 404.
Delete the intended document
PUT /api/operations/v1/deletedocument takes a JSON body:
{
"id": "123",
"documentScope": "account"
}
Replace 123 with the document ID returned by listing. Use customer to delete a customer KYC document. Legacy requests without scope still work when only one accessible record has that ID. If both stores contain the ID, the API returns 409 and deletes neither record. This avoids silently deleting the wrong document.
Deleting a document does not delete the owner account/customer. Obtain the bank's retention authorization before removing stored KYC records.
Send SMS
POST /api/operations/v1/sendsms accepts phoneNumbers and message. The bank must configure and enable its SMS integration. Blank recipients are removed and duplicates are collapsed.
For example:
{
"phoneNumbers": ["08012345678"],
"message": "Your requested account statement is ready."
}
Replace the recipient and message before sending. Check status, data.sent, data.failed and each recipient’s data.results. An HTTP 200 response can still contain failed deliveries. Retry only confirmed failures. If the connection fails, the message may already have been sent.
Send email
POST /api/operations/v1/sendemail accepts required tos, subject, body, and optional ccs / bccs. All recipients must be valid addresses. Duplicates across the lists are removed, keeping the first role in To, CC, BCC order. CC/BCC recipients retain their roles instead of being exposed as To recipients.
For example:
{
"tos": ["ada@example.com"],
"subject": "Account notification",
"body": "<p>Your requested account statement is ready.</p>"
}
Replace the recipient and content before sending. The body is HTML. API-supplied local file paths are not read and embedded into the email. Supply approved remote image URLs or inline data images as appropriate; there is no email-attachment field on this API.
A successful response means SMTP submission succeeded, not that the message reached an inbox. The bank configures SMTP, sender identity and delivery monitoring. Sending may incur provider charges. Preserve request references for failed or uncertain submissions and avoid resending an entire batch blindly.
Download a loan certificate
Loan and fixed-deposit certificates return JSON rather than raw PDF bytes. data.document is a data URL such as data:application/pdf;base64,.... Decode only the text after the first comma, not the data: prefix or MIME type.
With the base URL and token from your first request, replace 123 with the numeric loan ID returned by loan search:
export LOAN_ID='123'
curl --fail-with-body \
"$COREWAVE_BASE_URL/api/loanaccount/v1/view-certificate/$LOAN_ID" \
--header "Authorization: Bearer $COREWAVE_TOKEN" \
--header "request-reference: certificate-$(uuidgen)" \
--output loan-certificate.json
Continue only if cURL succeeds. The following Node.js example checks the JSON result and saves its PDF:
const fs = require('node:fs');
const response = JSON.parse(fs.readFileSync('loan-certificate.json', 'utf8'));
if (response.status !== true) throw new Error('The bank did not return a successful certificate response.');
const match = /^data:application\/pdf;base64,([A-Za-z0-9+/\r\n]*={0,2})$/.exec(response.data?.document ?? '');
if (!match || !match[1]) throw new Error('The response does not contain a PDF certificate.');
fs.writeFileSync('loan-certificate.pdf', Buffer.from(match[1], 'base64'));
Save the JavaScript as save-certificate.cjs and run node save-certificate.cjs in the directory containing loan-certificate.json. It writes loan-certificate.pdf in that directory.
For a fixed deposit, use GET /api/fixeddepositaccount/v1/view-certificate/{ID}/0, replacing {ID} with its numeric deposit ID; 0 selects PDF. A successful response uses the same data.document data-URL format. Excel uses type 1; save the decoded bytes with the extension matching data.mimeType and data.fileName. Ordinary report exports can return binary data directly, so check the selected endpoint's response content type before decoding.