Add a document type

Read this before you call it. Creating a document type changes what
your borrowers are asked for, across your whole account, straight
away — and this API cannot undo it.

  • It appears on every existing loan whose details match its
    conditions, including loans already in progress with borrowers
    part-way through.
  • There is no draft, no preview, and no "apply later". The change is
    live the moment this call succeeds.
  • There is no delete in this API. If you create the wrong thing,
    someone has to go into the LendingWise portal to deal with it.

Empty conditions mean "every loan", not "no loans". This is the
mistake worth guarding against, and it is why a request with no
conditionalFilters at all is refused unless you also send
appliesToAllLoans: true. Sending that flag is you saying, on the
record, that you meant every matching loan in the account.

conditionalFilters are combined with AND. A loan has to match all of them
for the document to be asked for. Any filter list you leave empty
places no restriction on that dimension.

One call can create more than one entry. fileTypes is a list, and
you get one entry back per loan type — the same way the portal shows one
row per loan type. The reply is the created type read back from the
catalog, in exactly the shape GET /api/v4/document-types returns, so
you can confirm the scoping is what you meant.

Names must be unique on your account, compared without regard to
case or accents (so Cafe and Café collide), and across every
loan type. A clash with an existing type is
refused. A clash with a deactivated type is also refused, with a
different message: reactivate the original in the portal instead, or
you will orphan its conditions and history.

This endpoint only creates. There is no update and no delete.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

A new document type for your account.

string
required
length ≤ 2048

What the document is called. Must be unique on your account, ignoring case, across every loan type.

integer | null
1 to 2147483647

Optional. The group to file it under. Must be a category on your own account, or one of the ones LendingWise ships.

Leave it out, or send null, to create an uncategorised document type — which is what the portal does when you do not pick a category, and what most document types are. The type reads back with category: null.

⚠️ 0 is not how you say "no category" and is refused. Omit the field or send null.

string | null

A longer note explaining what is wanted. ⚠️ The real limit is 65,535 bytes, not characters: accented and non-Latin text takes more than one byte per character, so a long note in such a script is refused before maxLength is reached.

fileTypes
array of strings
required
length ≥ 1

The loan types this document belongs to — id values from /api/v4/loan-types. You get one entry back per loan type.

fileTypes*
loanPrograms
array of strings

The loan programs it is asked for on — ids from /api/v4/loan-programs and /api/v4/loan-programs-internal.

⚠️ Give at least one, unless you set adHocEnabled to true. A document type with neither is stored but appears on no screen and in no response, while still blocking its own name — so the next attempt to create it answers 422 for a duplicate you cannot find. That combination is refused rather than stored.

With adHocEnabled true and no programs, the type is not tied to any program and is attached by hand when it is needed.

loanPrograms
requiredBy
array of strings

Who is expected to supply it. Leave it out and everyone is.

requiredBy
Allowed:
boolean
Defaults to false

Whether someone can add this document to a loan on demand.

integer
0 to 2147483647
Defaults to 0

Where it sits in your list. Lower shows first.

boolean
Defaults to false

Required to be true when you send no conditionalFilters at all. It is your confirmation that you mean this document to be required on every matching loan in the account. Without it, a conditionless request is refused — because leaving conditions out by accident and meaning to leave them out look identical to us, and only one of those is recoverable.

referenceDocument
object

A sample or blank form to attach to the type.

conditionalFilters
object

What has to be true of a loan for this document to be asked for.
Combined with AND.

A name we do not recognise is refused, not ignored. A misspelt
condition would otherwise be dropped silently and leave the document
unrestricted on that dimension — which this API cannot undo.

⚠️ Every list you leave empty places NO restriction on that
dimension
— an empty branches means every branch, not none. Leave
them all empty and the document is asked for on every matching loan
in the account, which is what appliesToAllLoans exists to confirm.

Headers
string
length ≤ 64

A key you generate — a UUID is the usual choice — that makes it safe to
retry this request after a timeout.

The problem it solves. If a call times out you cannot tell whether
it landed. Retrying without a key creates a SECOND record. Retrying with
the same key returns the original result instead, and creates nothing.

  • Same key, same body → the original result, plus Idempotency-Replayed: true.
  • Same key, different body → 409. That means a bug in your code, not
    a safe retry, so the request is refused rather than guessed at.
  • No key → exactly the behaviour this endpoint has always had. The header
    is optional and nothing changes for callers that omit it.

A replay reflects the record's CURRENT state, not a byte-for-byte
copy of the original reply. If something else changed the record between
your first call and your retry, you see the change. We do this rather
than caching response bodies, because these replies carry borrower
personal data and we will not keep a copy of it at rest to serve a retry.

For the same reason a replay does not repeat meta.automation — the
automation ran once, on the original call, and saying otherwise would be
a lie about what just happened.

Keys are scoped to your own account and kept for 24 hours. After
that the key is forgotten and reusing it creates a new record, so retry
within a day. A key is at most 64 characters.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json