Skip to main content
Two endpoints let you retrieve your document portfolio. GET /v1/documents returns the full list of documents with their associated loan data. GET /v1/documents/stats gives you a fast aggregate count — total documents, how many carry a loan, and how many of those loans are behind schedule.

List documents

GET /v1/documents
Returns all documents owned by your authenticated account. Documents are ordered by updatedAt descending, so the most recently modified document appears first. Each document includes its associated loan record if one exists.

Request headers

Authorization
string
required
Bearer token obtained from your Clerk session. Example: Bearer eyJhbGc...

Response

documents
object[]
required
Ordered list of document objects, newest first.

Example

curl --request GET \
  --url https://your-api.example.com/v1/documents \
  --header 'Authorization: Bearer <your-session-token>'

Get document stats

GET /v1/documents/stats
Returns aggregate counts for your document portfolio. Use this endpoint to populate dashboard summary cards without loading the full document list.

Request headers

Authorization
string
required
Bearer token obtained from your Clerk session.

Response

total
number
required
Total number of documents owned by your account.
withLoan
number
required
Number of documents that have an associated loan record.
behind
number
required
Number of documents whose loan has a status of "BEHIND". These are candidates for RCM outreach.

Example

curl --request GET \
  --url https://your-api.example.com/v1/documents/stats \
  --header 'Authorization: Bearer <your-session-token>'

Error cases

StatusError messageCause
401Missing Authorization Bearer token.No Authorization header was sent.
401Invalid or expired token.The Bearer token is malformed or has expired.