Skip to main content

Create a Retrieval Job

Creates a new bulk retrieval job. The job asynchronously prepares signed download URLs for matching artifacts based on the filters provided. Bulk retrieval is used by mortgagees (via API) and agents (via portal bulk download).
POST /v1/retrieval/jobs

Request Body

ParameterTypeRequiredDescription
dockIdstringRequiredThe dock to retrieve artifacts from
recipientIdstringRequiredThe recipient requesting retrieval
artifactIdsarrayOptionalSpecific artifact IDs to retrieve
metadataobjectOptionalFilter artifacts by metadata key-value pairs
sinceTimestampstringOptionalOnly include artifacts created after this ISO 8601 timestamp

Example: Mortgagee Daily Sync

A mortgage lender pulls all new declaration pages since yesterday via API, authenticating with shared passphrase + mutual TLS:
curl -X POST https://api.docyard.io/v1/retrieval/jobs \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{
    "dockId": "dock_01HQ3K...",
    "recipientId": "rcp_01HQ3N...",
    "metadata": {
      "document_type": "declaration-page"
    },
    "sinceTimestamp": "2025-01-14T00:00:00.000Z"
  }'

Example: Agent Client Batch

An agent pulls all documents for a specific client’s policy number:
curl -X POST https://api.docyard.io/v1/retrieval/jobs \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{
    "dockId": "dock_01HQ3K...",
    "recipientId": "rcp_01HQ3S...",
    "metadata": {
      "policy_number": "POL-2025-88401"
    }
  }'

Example: Targeted Pull by Artifact IDs

Retrieve specific artifacts by ID (useful for retry or selective download):
curl -X POST https://api.docyard.io/v1/retrieval/jobs \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{
    "dockId": "dock_01HQ3K...",
    "recipientId": "rcp_01HQ3N...",
    "artifactIds": ["art_01HQ3M...", "art_01HQ3N..."]
  }'

Response

{
  "id": "job_01HQ3Q...",
  "dockId": "dock_01HQ3K...",
  "status": "PENDING",
  "totalCount": 0,
  "readyCount": 0,
  "errorCount": 0,
  "createdAt": "2025-01-15T10:34:00.000Z"
}

Filtering Options

FilterDescriptionCommon Use
artifactIdsRetrieve specific artifacts by IDTargeted pulls, retry
sinceTimestampOnly artifacts uploaded after this dateDaily incremental sync
metadataFilter by artifact metadata key-value pairsBy doc type, state, LOB

Error Handling

StatusCondition
400dockId is missing
400sinceTimestamp is not a valid ISO 8601 date
401Missing or invalid API key
404Dock or recipient not found
Retrieval jobs are processed asynchronously. After creation, poll the Retrieve Job endpoint to check the status. Once the status is COMPLETED, use Job Results to get signed download URLs. Signed URLs expire after 1 hour and result sets expire after 24 hours.

Who Uses Bulk Retrieval?

PersonaUsageAuth
MortgageeDaily incremental sync via APIShared passphrase + mTLS
AgentClient batch download via portal or APIWebAuthn challenge
PolicyholderDoes not use bulk retrieval — single document via portalSMS OTP
AuditorDoes not use bulk retrieval — read-only portal, no downloadsBadge ID + NDA hash