- Capture the
caseDataIdfor each screening on a case. - Request the list of documents for a screening.
- Identify the document that you want.
- Download the file.
The endpoint described in this guide is live and fully supported, but it isn’t yet published in the public API reference.
What stays the same
- Your existing authentication. You use the same bearer token and header, with no new credentials or scopes.
- The response format, which matches the case-level secure document list endpoint.
- The secure document retrieval process that you already use to download files.
Before you begin
Ensure that you have an authentication token for the KarmaCheck API.caseDataId is not the same as caseId. This is the most common point of confusion.caseIdidentifies the overall order for a candidate.caseDataIdidentifies one individual screening, or service, inside that order.
caseId and three separate caseDataId values. Documents are attached at the screening level, so you make one call per caseDataId, not one call per order.Step 1: Capture the caseDataId for each screening
ThecaseDataId is returned in the id field of the individual service object in the following places:
- The payload of the
casedata.statuschangewebhook event that you already receive. - The response of Get case data by case ID.
caseDataId for each service. This lets you run document retrieval later without re-fetching the case.
Step 2: Request the document list for a screening
Make aGET request to the following endpoint. Replace AUTHENTICATION_TOKEN with your token and CASE_DATA_ID with the value that you captured in Step 1:
AUTHENTICATION_TOKEN: Your authentication tokenCASE_DATA_ID: ThecaseDataIdof the screening whose documents you wantreturnExcludedDocumentTypes: Set tofalseto limit the response to document types that are eligible for client viewing. Change this value only if KarmaCheck has configured expanded access for your account.
Step 3: Identify the document
Each item in the returned list includes the following fields, among others:
To translate
documentTypeId values into readable labels, such as chain of custody, call Get secure document type list once and cache the result. You don’t need to call it on every request.
Step 4: Download the file
Retrieve the file using the secure document APIs. See Get secure document download URL.Recommended implementation pattern
To automate document retrieval, do the following:- Trigger on your existing order completion webhook or polling schedule.
- Iterate the services on the completed case and capture each
caseDataId. - Call the endpoint in Step 2 once per
caseDataId. - Filter the returned list down to the
documentTypeIdvalues that your users need to see. - Retrieve each file through the existing secure document process, and store it against the candidate record in your system.