Loans Documents
The Loans Documents endpoint returns all documents associated with a specific loan. This includes agreements, disclosures, statements, and any other documentation relevant to the customer's loan lifecycle. Documents are returned in reverse chronological order by default.
Endpoint
GET /api/loans/documents
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when you need to display or download all loan-related documents for a specific customer. It is also useful for syncing loan documentation into partner platforms for audit or compliance purposes, or for automating document archiving workflows. Make sure the customer has granted necessary permissions for accessing their loan documents before calling this endpoint.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| loanId | string | No | The unique identifier of the loan whose documents should be retrieved. |
Response
200 OK
Returns an array of document detail objects.
| Field | Type | Description |
|---|---|---|
| document | string | The document content or a reference/URL to the document. Nullable. |
| documentId | string | The unique identifier for the document. Nullable. |
| documentType | string | The type or category of the document (e.g., agreement, disclosure, statement). Nullable. |
[
{
"document": "https://documents.netevia.com/loans/doc-abc123.pdf",
"documentId": "doc-abc123",
"documentType": "LoanAgreement"
},
{
"document": "https://documents.netevia.com/loans/doc-def456.pdf",
"documentId": "doc-def456",
"documentType": "Disclosure"
},
{
"document": "https://documents.netevia.com/loans/doc-ghi789.pdf",
"documentId": "doc-ghi789",
"documentType": "MonthlyStatement"
}
]Error Codes
| Code | When it happens |
|---|---|
| 400 | The provided loanId is malformed or invalid |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions or customer has not granted access to loan documents |
| 404 | No loan found matching the provided loanId |
| 500 | Internal server error |
Common Mistakes
- Omitting the
loanIdquery parameter may return documents across all loans for the authenticated context instead of a targeted result — always pass a specificloanIdwhen retrieving documents for a single loan. - Attempting to access loan documents without verifying the customer has granted the necessary permissions will result in a 403 error.
- Bearer tokens expire after 10 minutes; ensure the token is refreshed before making the request to avoid 401 errors.
Related Endpoints
GET /api/loans— Retrieve the list of loans for a customerGET /api/loans/{loanId}— Retrieve details for a specific loanPOST /api/loans/apply— Submit a loan application for a business customer
Example
curl -X GET "https://api.banking.netevia.dev/api/loans/documents?loanId=loan-12345" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"