---
title: "POST /assistants/{assistantId}/retrieve"
method: POST
path: "/assistants/{assistantId}/retrieve"
---

# POST /assistants/{assistantId}/retrieve

`POST /assistants/{assistantId}/retrieve`

Retrieves content from knowledge sources based on a query.

## Path parameters

- `assistantId` string, required

## Request body

- object
  - `retrievalConfiguration` object, required — Configuration for content retrieval operations.
    - `knowledgeSource` object — The knowledge source configuration for content retrieval.
      - `assistantAssociationIds` UuidOrArn[] — The list of assistant association identifiers for the knowledge source.
    - `filter` object — The filter configuration for content retrieval.
      - `andAll` RetrievalFilterConfiguration[] — Filter configuration that requires all conditions to be met.
        - `andAll` RetrievalFilterConfiguration[] — Filter configuration that requires all conditions to be met.
        - `equals` object — Filter configuration for exact equality matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `greaterThan` object — Filter configuration for greater than comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `greaterThanOrEquals` object — Filter configuration for greater than or equal comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `in` object — Filter configuration for membership in a set of values.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `lessThan` object — Filter configuration for less than comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `lessThanOrEquals` object — Filter configuration for less than or equal comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `listContains` object — Filter configuration for checking if a list contains a value.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `notEquals` object — Filter configuration for inequality matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `notIn` object — Filter configuration for exclusion from a set of values.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `orAll` RetrievalFilterConfiguration[] — Filter configuration where any condition can be met.
        - `startsWith` object — Filter configuration for prefix matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `stringContains` object — Filter configuration for substring matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
      - `equals` object — Filter configuration for exact equality matching.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `greaterThan` object — Filter configuration for greater than comparison.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `greaterThanOrEquals` object — Filter configuration for greater than or equal comparison.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `in` object — Filter configuration for membership in a set of values.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `lessThan` object — Filter configuration for less than comparison.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `lessThanOrEquals` object — Filter configuration for less than or equal comparison.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `listContains` object — Filter configuration for checking if a list contains a value.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `notEquals` object — Filter configuration for inequality matching.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `notIn` object — Filter configuration for exclusion from a set of values.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `orAll` RetrievalFilterConfiguration[] — Filter configuration where any condition can be met.
        - `andAll` RetrievalFilterConfiguration[] — Filter configuration that requires all conditions to be met.
        - `equals` object — Filter configuration for exact equality matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `greaterThan` object — Filter configuration for greater than comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `greaterThanOrEquals` object — Filter configuration for greater than or equal comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `in` object — Filter configuration for membership in a set of values.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `lessThan` object — Filter configuration for less than comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `lessThanOrEquals` object — Filter configuration for less than or equal comparison.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `listContains` object — Filter configuration for checking if a list contains a value.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `notEquals` object — Filter configuration for inequality matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `notIn` object — Filter configuration for exclusion from a set of values.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `orAll` RetrievalFilterConfiguration[] — Filter configuration where any condition can be met.
        - `startsWith` object — Filter configuration for prefix matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
        - `stringContains` object — Filter configuration for substring matching.
          - `key` string, required — The key of the filter attribute.
          - `value` object, required — The value of the filter attribute.
      - `startsWith` object — Filter configuration for prefix matching.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
      - `stringContains` object — Filter configuration for substring matching.
        - `key` string, required — The key of the filter attribute.
        - `value` object, required — The value of the filter attribute.
    - `numberOfResults` integer — The number of results to retrieve.
    - `overrideKnowledgeBaseSearchType` 'HYBRID' | 'SEMANTIC' — Override setting for the knowledge base search type during retrieval.
  - `retrievalQuery` string, password, required — The query for content retrieval.

## Response `200`

Success

- RetrieveResponse
  - `results` RetrieveResult[], required — The results of the content retrieval operation.
    - `associationId` string, required — The identifier of the assistant association for the retrieved result.
    - `sourceId` string, password, required — The URL, URI, or ID of the retrieved content when available, or a UUID when unavailable.
    - `referenceType` 'WEB_CRAWLER' | 'KNOWLEDGE_BASE' | 'BEDROCK_KB_S3' | 'BEDROCK_KB_WEB' | 'BEDROCK_KB_CONFLUENCE' | 'BEDROCK_KB_SALESFORCE' | 'BEDROCK_KB_SHAREPOINT' | 'BEDROCK_KB_KENDRA' | 'BEDROCK_KB_CUSTOM_DOCUMENT' | 'BEDROCK_KB_SQL', required — A type to define the KB origin of a retrieved content.
    - `contentText` string, password, required — The text content of the retrieved result.

## Other responses

- `480` — RequestTimeoutException
- `481` — ValidationException
- `482` — ConflictException
- `483` — ServiceQuotaExceededException
- `484` — DependencyFailedException
- `485` — AccessDeniedException
- `486` — ResourceNotFoundException
- `487` — ThrottlingException

---

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