Dify Chunks API

Operations for managing document chunks and child chunks. 9 operation(s) from the Dify Service API.

Operations 9

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /datasets/{dataset_id}/documents/{document_id}/segments Add new chunks to a document · Create Chunks #
Ask an LLM
“Can I manually add my own chunks of text to an existing document?”
“Is it possible to insert several chunks into a document in one request?”
Tell an agent
Add these chunks {segments} to document {document_id} in knowledge base {dataset_id}.
Insert new chunks into document {document_id} of knowledge base {dataset_id}.
GET /datasets/{dataset_id}/documents/{document_id}/segments List the chunks in a document · List Chunks #
Ask an LLM
“How do I see how a knowledge base document was split into chunks?”
“Can I list only the chunks that failed indexing or are still indexing?”
Tell an agent
List the chunks of document {document_id} in knowledge base {dataset_id}.
Show chunks in document {document_id} of {dataset_id} with indexing status {status}.
GET /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id} Get the full details of one chunk · Get Chunk #
Ask an LLM
“What is the full content and metadata of a single chunk?”
“Can I look up one specific chunk by its ID?”
Tell an agent
Show chunk {segment_id} from document {document_id} in knowledge base {dataset_id}.
Get the details of chunk {segment_id} in document {document_id} of {dataset_id}.
POST /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id} Edit a chunk and re-index it · Update Chunk #
Ask an LLM
“Can I fix the text of a parent chunk that was split badly?”
“Does editing a chunk trigger re-indexing of that chunk?”
Tell an agent
Update chunk {segment_id} in document {document_id} of {dataset_id} with {segment}.
Change the content of chunk {segment_id} in document {document_id}, knowledge base {dataset_id}, and re-index it.
DELETE /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id} Permanently delete a chunk · Delete Chunk #
Ask an LLM
“How do I remove an irrelevant chunk from a document so it is never retrieved?”
“Is deleting a chunk permanent?”
Tell an agent destructive · confirm first
Delete chunk {segment_id} from document {document_id} in knowledge base {dataset_id}.
Permanently remove chunk {segment_id} of document {document_id} in {dataset_id}.
POST /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks Add a child chunk to a parent chunk · Create Child Chunk #
Ask an LLM
“How do I add a child chunk under a parent chunk in hierarchical chunking mode?”
“Can I attach extra fine-grained text to an existing parent chunk?”
Tell an agent
Add a child chunk with text {content} under parent {segment_id} of document {document_id} in {dataset_id}.
Create a new child chunk beneath parent chunk {segment_id} in document {document_id}, knowledge base {dataset_id}, reading {content}.
GET /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks List child chunks under a parent chunk · List Child Chunks #
Ask an LLM
“Which child chunks sit under a given parent chunk in a parent-child document?”
“Can I search the child chunks of a parent chunk by keyword?”
Tell an agent
List child chunks of parent chunk {segment_id} in document {document_id}, knowledge base {dataset_id}.
Find child chunks containing {keyword} under parent {segment_id} of document {document_id} in {dataset_id}.
PATCH /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id} Edit the text of a child chunk · Update Child Chunk #
Ask an LLM
“How do I correct the wording of an existing child chunk?”
“Can I rewrite a child chunk's content without touching its parent chunk?”
Tell an agent
Change child chunk {child_chunk_id} under parent {segment_id} of document {document_id} in {dataset_id} to {content}.
Rewrite the text of child chunk {child_chunk_id} in parent {segment_id}, document {document_id}, knowledge base {dataset_id}.
DELETE /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id} Permanently delete a child chunk · Delete Child Chunk #
Ask an LLM
“Can I remove a single child chunk without deleting its parent?”
“What is the way to drop one child chunk from a parent-child document?”
Tell an agent destructive · confirm first
Delete child chunk {child_chunk_id} under parent {segment_id} of document {document_id} in {dataset_id}.
Remove child chunk {child_chunk_id} from parent chunk {segment_id}, document {document_id}, knowledge base {dataset_id}.

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/dify:dify-chunks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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

dify-chunks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Dify Service Chunks API
  description: REST API for Dify applications and knowledge bases. Application endpoints authenticate with an app API key; knowledge endpoints authenticate with a dataset API key.
  version: 1.0.0
servers:
- url: https://{api_base_url}
  description: Base URL of the Dify Service API. For self-hosted deployments, replace it with your own API base URL.
  variables:
    api_base_url:
      default: api.dify.ai/v1
      description: Host and path of the API base URL, without the `https://` prefix.
security:
- ApiKeyAuth: []
tags:


# --- truncated at 32 KB (57 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/dify/refs/heads/main/openapi/dify-chunks-api-openapi.yml