---
title: "POST /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/{documentId}/content"
method: POST
path: "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/{documentId}/content"
---

# POST /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/{documentId}/content

`POST /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/{documentId}/content`

Retrieves the content of an ingested document from a knowledge base. Returns a pre-signed URL for secure document access.

## Path parameters

- `dataSourceId` string, required
- `documentId` string, required
- `knowledgeBaseId` string, required

## Request body

- object
  - `outputFormat` 'RAW' | 'EXTRACTED' — The output format for the document content. <code>RAW</code> returns the original file. <code>EXTRACTED</code> returns parsed text as JSON. Defaults to <code>RAW</code>.
  - `userContext` object — Contains information about the user making the request. Use this to pass user identity information for access control filtering, so that retrieval results only include documents the user is authorized to access.
    - `userId` string — The identifier of the user making the retrieval request.

## Response `200`

Success

- GetDocumentContentResponse
  - `documentContentLength` integer — The size of the document content in bytes available at the pre-signed URL.
  - `mimeType` string, required — The MIME type of the document content. For <code>RAW</code> format, this is the original file type (for example, <code>application/pdf</code>). For <code>EXTRACTED</code> format, this is always <code>application/json</code>.
  - `presignedUrl` string, password, required — A pre-signed URL for downloading the document content. The URL expires after 5 minutes.

## Other responses

- `480` — ResourceNotFoundException
- `481` — ValidationException
- `482` — InternalServerException
- `483` — ThrottlingException
- `484` — AccessDeniedException

---

[API](https://skmtc.net/aws/apis/bedrock-agent-runtime.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agent-runtime/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agent-runtime/versions/fe358131c0ad/schema)
