Skip to content
Get started

Upsert Batch Pipeline Documents

PUT/api/v1/pipelines/{pipeline_id}/documents

Batch create or update a document for a pipeline.

Path ParametersExpand Collapse
pipeline_id: string
Cookie ParametersExpand Collapse
session: optional string
Body ParametersExpand Collapse
body: array of CloudDocumentCreate { metadata, text, id, 3 more }
metadata: map[unknown]
text: string
id: optional string
excluded_embed_metadata_keys: optional array of string
excluded_llm_metadata_keys: optional array of string
page_positions: optional array of number

indices in the CloudDocument.text where a new page begins. e.g. Second page starts at index specified by page_positions[1].

ReturnsExpand Collapse
id: string
metadata: map[unknown]
text: string
excluded_embed_metadata_keys: optional array of string
excluded_llm_metadata_keys: optional array of string
page_positions: optional array of number

indices in the CloudDocument.text where a new page begins. e.g. Second page starts at index specified by page_positions[1].

status_metadata: optional map[unknown]

Upsert Batch Pipeline Documents

curl https://api.cloud.llamaindex.ai/api/v1/pipelines/$PIPELINE_ID/documents \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
    -d '[
          {
            "metadata": {
              "foo": "bar"
            },
            "text": "text",
            "id": "id",
            "excluded_embed_metadata_keys": [
              "string"
            ],
            "excluded_llm_metadata_keys": [
              "string"
            ],
            "page_positions": [
              0
            ]
          }
        ]'
[
  {
    "id": "id",
    "metadata": {
      "foo": "bar"
    },
    "text": "text",
    "excluded_embed_metadata_keys": [
      "string"
    ],
    "excluded_llm_metadata_keys": [
      "string"
    ],
    "page_positions": [
      0
    ],
    "status_metadata": {
      "foo": "bar"
    }
  }
]
Returns Examples
[
  {
    "id": "id",
    "metadata": {
      "foo": "bar"
    },
    "text": "text",
    "excluded_embed_metadata_keys": [
      "string"
    ],
    "excluded_llm_metadata_keys": [
      "string"
    ],
    "page_positions": [
      0
    ],
    "status_metadata": {
      "foo": "bar"
    }
  }
]