Amazon Bedrock Bedrock Documents API

The Bedrock Documents API from Amazon Bedrock — 3 operation(s) for bedrock documents.

GitHub OpenAPI

Operations 4

POST /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/deleteDocuments Delete Knowledge Base Documents #
POST /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/getDocuments Get Knowledge Base Documents #
PUT /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents Ingest Knowledge Base Documents #
POST /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents List Knowledge Base Documents #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-bedrock:amazon-bedrock-documents-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-bedrock-documents-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Bedrock Documents API
  version: '2023-04-20'
  description: Generated from AWS's published Smithy model for Amazon Bedrock. 4 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://bedrock-agent.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/deleteDocuments:
    post:
      operationId: DeleteKnowledgeBaseDocuments
      summary: Delete Knowledge Base Documents
      description: Deletes documents from a data source and syncs the changes to the knowledge base that is connected to it.
        For more information, see Ingest changes directly into a knowledge base in the Amazon Bedrock User Guide.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteKnowledgeBaseDocumentsResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BedrockAgentValidationException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteKnowledgeBaseDocumentsRequest'
      tags:
      - Documents
  /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/getDocuments:
    post:
      operationId: GetKnowledgeBaseDocuments
      summary: Get Knowledge Base Documents
      description: Retrieves specific documents from a data source that is connected to a knowledge base. For more information,
        see Ingest changes directly into a knowledge base in the Amazon Bedrock User Guide.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetKnowledgeBaseDocumentsResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BedrockAgentValidationException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetKnowledgeBaseDocumentsRequest'
      tags:
      - Documents
  /knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents:
    put:
      operationId: IngestKnowledgeBaseDocuments
      summary: Ingest Knowledge Base Documents
      description: Ingests documents directly into the knowledge base that is connected to the data source. The dataSourceType
        specified in the content for each document must match the type of the data source that you specify in the header.
        For more information, see Ingest changes directly into a knowledge base in the Amazon Bedrock User Guide.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestKnowledgeBaseDocumentsResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BedrockAgentValidationException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestKnowledgeBaseDocumentsRequest'
      tags:
      - Documents
    post:
      operationId: ListKnowledgeBaseDocuments
      summary: List Knowledge Base Documents
      description: Retrieves all the documents contained in a data source that is connected to a knowledge base. For more
        information, see Ingest changes directly into a knowledge base in the Amazon Bedrock User Guide.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListKnowledgeBaseDocumentsResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BedrockAgentValidationException'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListKnowledgeBaseDocumentsRequest'
      tags:
      - Documents
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: bedrock
  schemas:
    AccessDeniedException:
      type: object
      properties:
        message:
          type: string
    BedrockAgentByteContentDoc:
      type: object
      properties:
        mimeType:
          type: string
          description: 'The MIME type of the content. For a list of MIME types, see Media Types. The following MIME types
            are supported: text/plain text/html text/csv text/vtt message/rfc822 application/xhtml+xml application/pdf application/msword
            application/vnd.ms-word.document.macroenabled.12 application/vnd.ms-word.template.macroenabled.12 application/vnd.ms-excel
            application/vnd.ms-excel.addin.macroenabled.12 application/vnd.ms-excel.sheet.macroenabled.12 application/vnd.ms-excel.template.macroenabled.12
            application/vnd.ms-excel.sheet.binary.macroenabled.12 application/vnd.ms-spreadsheetml application/vnd.openxm'
        data:
          type: string
          format: byte
          description: The base64-encoded string of the content.
      required:
      - mimeType
      - data
    BedrockAgentS3Location:
      type: object
      properties:
        uri:
          type: string
          description: The location's URI. For example, s3://my-bucket/chunk-processor/.
      required:
      - uri
    BedrockAgentValidationException:
      type: object
      properties:
        message:
          type: string
        fieldList:
          type: array
          items:
            $ref: '#/components/schemas/ValidationExceptionField'
          description: A list of objects containing fields that caused validation errors and their corresponding validation
            error messages.
    CustomContent:
      type: object
      properties:
        customDocumentIdentifier:
          $ref: '#/components/schemas/CustomDocumentIdentifier'
        sourceType:
          type: string
          enum:
          - IN_LINE
          - S3_LOCATION
          description: The source of the data to ingest.
        s3Location:
          $ref: '#/components/schemas/CustomS3Location'
        inlineContent:
          $ref: '#/components/schemas/InlineContent'
      required:
      - customDocumentIdentifier
      - sourceType
    CustomDocumentIdentifier:
      type: object
      properties:
        id:
          type: string
          description: The identifier of the document to ingest into a custom data source.
      required:
      - id
    CustomS3Location:
      type: object
      properties:
        uri:
          type: string
          description: The S3 URI of the file containing the content to ingest.
        bucketOwnerAccountId:
          type: string
          description: The identifier of the Amazon Web Services account that owns the S3 bucket containing the content to
            ingest.
      required:
      - uri
    DeleteKnowledgeBaseDocumentsRequest:
      type: object
      properties:
        knowledgeBaseId:
          type: string
          description: The unique identifier of the knowledge base that is connected to the data source.
        dataSourceId:
          type: string
          description: The unique identifier of the data source that contains the documents.
        clientToken:
          type: string
          description: A unique, case-sensitive identifier to ensure that the API request completes no more than one time.
            If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For
            more information, see Ensuring idempotency.
        documentIdentifiers:
          type: array
          items:
            $ref: '#/components/schemas/DocumentIdentifier'
          description: A list of objects, each of which contains information to identify a document to delete.
      required:
      - knowledgeBaseId
      - dataSourceId
      - documentIdentifiers
    DeleteKnowledgeBaseDocumentsResponse:
      type: object
      properties:
        documentDetails:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseDocumentDetail'
          description: A list of objects, each of which contains information about the documents that were deleted.
    DocumentAccessControlEntry:
      type: object
      properties:
        name:
          type: string
          description: The user identifier.
        type:
          type: string
          enum:
          - USER
          description: The type of principal.
        access:
          type: string
          enum:
          - ALLOW
          - DENY
          description: Whether to allow or deny access.
      required:
      - name
      - type
      - access
    DocumentContent:
      type: object
      properties:
        dataSourceType:
          type: string
          enum:
          - CUSTOM
          - S3
          description: The type of data source that is connected to the knowledge base to which to ingest this document.
        custom:
          $ref: '#/components/schemas/CustomContent'
        s3:
          $ref: '#/components/schemas/S3Content'
      required:
      - dataSourceType
    DocumentIdentifier:
      type: object
      properties:
        dataSourceType:
          type: string
          enum:
          - CUSTOM
          - S3
          description: The type of data source connected to the knowledge base that contains the document.
        s3:
          $ref: '#/components/schemas/BedrockAgentS3Location'
        custom:
          $ref: '#/components/schemas/CustomDocumentIdentifier'
      required:
      - dataSourceType
    DocumentMetadata:
      type: object
      properties:
        type:
          type: string
          enum:
          - IN_LINE_ATTRIBUTE
          - S3_LOCATION
          description: The type of the source source from which to add metadata.
        inlineAttributes:
          type: array
          items:
            $ref: '#/components/schemas/MetadataAttribute'
          description: An array of objects, each of which defines a metadata attribute to associate with the content to ingest.
            You define the attributes inline.
        s3Location:
          $ref: '#/components/schemas/CustomS3Location'
        accessControlList:
          type: array
          items:
            $ref: '#/components/schemas/DocumentAccessControlEntry'
          description: Access control list for the document. Used when metadata type is IN_LINE_ATTRIBUTE.
      required:
      - type
    GetKnowledgeBaseDocumentsRequest:
      type: object
      properties:
        knowledgeBaseId:
          type: string
          description: The unique identifier of the knowledge base that is connected to the data source.
        dataSourceId:
          type: string
          description: The unique identifier of the data source that contains the documents.
        documentIdentifiers:
          type: array
          items:
            $ref: '#/components/schemas/DocumentIdentifier'
          description: A list of objects, each of which contains information to identify a document for which to retrieve
            information.
      required:
      - knowledgeBaseId
      - dataSourceId
      - documentIdentifiers
    GetKnowledgeBaseDocumentsResponse:
      type: object
      properties:
        documentDetails:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseDocumentDetail'
          description: A list of objects, each of which contains information about the documents that were retrieved.
    IngestKnowledgeBaseDocumentsRequest:
      type: object
      properties:
        knowledgeBaseId:
          type: string
          description: The unique identifier of the knowledge base to ingest the documents into.
        dataSourceId:
          type: string
          description: The unique identifier of the data source connected to the knowledge base that you're adding documents
            to.
        clientToken:
          type: string
          description: A unique, case-sensitive identifier to ensure that the API request completes no more than one time.
            If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For
            more information, see Ensuring idempotency.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseDocument'
          description: A list of objects, each of which contains information about the documents to add.
      required:
      - knowledgeBaseId
      - dataSourceId
      - documents
    IngestKnowledgeBaseDocumentsResponse:
      type: object
      properties:
        documentDetails:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseDocumentDetail'
          description: A list of objects, each of which contains information about the documents that were ingested.
    InlineContent:
      type: object
      properties:
        type:
          type: string
          enum:
          - BYTE
          - TEXT
          description: The type of inline content to define.
        byteContent:
          $ref: '#/components/schemas/BedrockAgentByteContentDoc'
        textContent:
          $ref: '#/components/schemas/TextContentDoc'
      required:
      - type
    InternalServerException:
      type: object
      properties:
        message:
          type: string
    KnowledgeBaseDocument:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/DocumentMetadata'
        content:
          $ref: '#/components/schemas/DocumentContent'
      required:
      - content
    KnowledgeBaseDocumentDetail:
      type: object
      properties:
        knowledgeBaseId:
          type: string
          description: The identifier of the knowledge base that the document was ingested into or deleted from.
        dataSourceId:
          type: string
          description: The identifier of the data source connected to the knowledge base that the document was ingested into
            or deleted from.
        status:
          type: string
          enum:
          - INDEXED
          - PARTIALLY_INDEXED
          - PENDING
          - FAILED
          - METADATA_PARTIALLY_INDEXED
          - METADATA_UPDATE_FAILED
          - IGNORED
          - NOT_FOUND
          - STARTING
          - IN_PROGRESS
          - DELETING
          - DELETE_IN_PROGRESS
          description: 'The ingestion status of the document. The following statuses are possible: STARTING – You submitted
            the ingestion job containing the document. PENDING – The document is waiting to be ingested. IN_PROGRESS – The
            document is being ingested. INDEXED – The document was successfully indexed. PARTIALLY_INDEXED – The document
            was partially indexed. METADATA_PARTIALLY_INDEXED – You submitted metadata for an existing document and it was
            partially indexed. METADATA_UPDATE_FAILED – You submitted a metadata update for an existing document but it failed.
            FAILED – The document failed to be ingested. NOT_FOU'
        identifier:
          $ref: '#/components/schemas/DocumentIdentifier'
        statusReason:
          type: string
          description: The reason for the status. Appears alongside the status IGNORED.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the document was last updated.
      required:
      - knowledgeBaseId
      - dataSourceId
      - status
      - identifier
    ListKnowledgeBaseDocumentsRequest:
      type: object
      properties:
        knowledgeBaseId:
          type: string
          description: The unique identifier of the knowledge base that is connected to the data source.
        dataSourceId:
          type: string
          description: The unique identifier of the data source that contains the documents.
        maxResults:
          type: integer
          description: The maximum number of results to return in the response. If the total number of results is greater
            than this value, use the token returned in the response in the nextToken field when making another request to
            return the next batch of results.
        nextToken:
          type: string
          description: If the total number of results is greater than the maxResults value provided in the request, enter
            the token returned in the nextToken field in the response in this field to return the next batch of results.
      required:
      - knowledgeBaseId
      - dataSourceId
    ListKnowledgeBaseDocumentsResponse:
      type: object
      properties:
        documentDetails:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBaseDocumentDetail'
          description: A list of objects, each of which contains information about the documents that were retrieved.
        nextToken:
          type: string
          description: If the total number of results is greater than the maxResults value provided in the request, use this
            token when making another request in the nextToken field to return the next batch of results.
      required:
      - documentDetails
    MetadataAttribute:
      type: object
      properties:
        key:
          type: string
          description: The key of the metadata attribute.
        value:
          $ref: '#/components/schemas/MetadataAttributeValue'
      required:
      - key
      - value
    MetadataAttributeValue:
      type: object
      properties:
        type:
          type: string
          enum:
          - BOOLEAN
          - NUMBER
          - STRING
          - STRING_LIST
          description: The type of the metadata attribute.
        numberValue:
          type: number
          description: The value of the numeric metadata attribute.
        booleanValue:
          type: boolean
          description: The value of the Boolean metadata attribute.
        stringValue:
          type: string
          description: The value of the string metadata attribute.
        stringListValue:
          type: array
          items:
            type: string
          description: An array of strings that define the value of the metadata attribute.
      required:
      - type
    ResourceNotFoundException:
      type: object
      properties:
        message:
          type: string
    S3Content:
      type: object
      properties:
        s3Location:
          $ref: '#/components/schemas/BedrockAgentS3Location'
      required:
      - s3Location
    ServiceQuotaExceededException:
      type: object
      properties:
        message:
          type: string
    TextContentDoc:
      type: object
      properties:
        data:
          type: string
          description: The text of the content.
      required:
      - data
    ThrottlingException:
      type: object
      properties:
        message:
          type: string
    ValidationExceptionField:
      type: object
      properties:
        name:
          type: string
          description: The name of the field.
        message:
          type: string
          description: A message describing why this field failed validation.
      required:
      - name
      - message
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/bedrock-agent/service/2023-06-05/bedrock-agent-2023-06-05.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)