> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amlok.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Document uploads and downloads

> Upload permitted evidence and retrieve short-lived authorized download links.

## Upload evidence

[POST /v1/documents](https://docs.amlok.io/api-reference/endpoints/identity/upload-document.md) accepts multipart form data with `file`, `subject_id`, and `document_type`. The response is `202` with a document resource.

```bash theme={null}
curl --request POST --fail-with-body --max-time 30 \
  "${AMLOK_API_BASE_URL}/v1/documents" \
  --header "Authorization: Bearer ${AMLOK_API_KEY}" \
  --header "Idempotency-Key: statement-upload-1001" \
  --form "file=@statement-2026-09.pdf;type=application/pdf" \
  --form "subject_id=biz_example" \
  --form "document_type=bank_statement" \
  --form "period_start=2026-09-01" \
  --form "period_end=2026-09-30"
```

Let the HTTP client construct the multipart `Content-Type` boundary. Do not set `Content-Type: application/json` for this route.

The upload period records the document's stated evidence period. It is not the exclusive `to` filter used by transaction queries. Poll the document's `extraction_status` or consume `document.processed`; acceptance does not establish a completed or verified extraction.

## File controls

Document processing validates actual file content, allowed types, malware status, tenant ownership, and permitted purpose. Maximum size, page limits, accepted MIME types, scan timeouts, and residency are environment settings. The PDF above is illustrative and is not a universal file-acceptance promise.

Use only authorized evidence. The normalized default response excludes raw biometric media, card PAN/CVV, and provider credentials. Do not place credentials inside uploaded filenames or metadata.

## Authorized download

Send `{"purpose":"credit_assessment"}` to [POST /v1/documents/{id}/download](https://docs.amlok.io/api-reference/endpoints/identity/create-document-download-link.md) with `documents:read` and an idempotency key. The response contains `data.document_id`, `data.url`, and `data.expires_at`.

The URL is a temporary capability. Do not make it public, log it, put it in analytics, or persist it as a permanent asset address. Download it only within its authorized context and expiry. Do not attach an AMLOK API key to the signed storage URL.

Use the expiry and storage domain returned by your environment. Upload documents through the documented multipart endpoint.

## Retention and deletion

Retention is managed by authorized users through workspace configuration in the AMLOK platform and in accordance with applicable compliance frameworks. Consent revocation or connection disconnection stops future collection; it does not itself delete stored evidence. After the cancellation request month closes and final information is generated, workspace deletion removes all associated workspace data. Necessary final billing, refund, and bank-return records are retained separately without borrower source data, documents, analysis outputs, or active workspace access. This API does not expose deletion-request endpoints. See [privacy and data handling](https://docs.amlok.io/security/privacy.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.