Back to Dify

Service API

api/openapi/markdown/service-openapi.md

1.16.0171.4 KB
Original Source

Service API

API for application services

Version: 1.0

Available authorizations

Bearer (HTTP, bearer)

Use the Service API key as a Bearer token in the Authorization header. Bearer format: API_KEY


service_api

Service operations

[GET] /

Responses

CodeDescriptionSchema
200Successapplication/json: IndexInfoResponse

[POST] /datasets/{dataset_id}/document/create_by_text

DEPRECATED

Deprecated legacy alias for creating a new document by providing text content. Use /datasets/{dataset_id}/document/create-by-text instead.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: DocumentTextCreatePayload

Responses

CodeDescriptionSchema
200Document created successfullyapplication/json: DocumentAndBatchResponse
400Bad request - invalid parameters
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

[POST] /datasets/{dataset_id}/documents/{document_id}/update_by_text

DEPRECATED

Deprecated legacy alias for updating an existing document by providing text content. Use /datasets/{dataset_id}/documents/{document_id}/update-by-text instead.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: DocumentTextUpdate

Responses

CodeDescriptionSchema
200Document updated successfullyapplication/json: DocumentAndBatchResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Document not found

default

[GET] /app/feedbacks

List App Feedbacks

Retrieve a paginated list of all feedback submitted for messages in this application, including both end-user and admin feedback.

Parameters

NameLocated inDescriptionRequiredSchema
limitqueryNumber of records per page.Nointeger,
Default: 20
pagequeryPage number for pagination.Nointeger,
Default: 1

Responses

CodeDescriptionSchema
200A list of application feedbacks.application/json: AppFeedbackListResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied

[POST] /messages/{message_id}/feedbacks

Submit Message Feedback

Submit feedback for a message. End users can rate messages as like or dislike, and optionally provide text feedback. Pass null for rating to revoke previously submitted feedback.

Parameters

NameLocated inDescriptionRequiredSchema
message_idpathMessage ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: MessageFeedbackPayloadWithUser

Responses

CodeDescriptionSchema
200Feedback submitted successfullyapplication/json: ResultResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Message does not exist.

default

[POST] /apps/annotation-reply/{action}

Configure Annotation Reply

Enables or disables the annotation reply feature. Requires embedding model configuration when enabling. Executes asynchronously — use Get Annotation Reply Job Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
actionpathAction to perform: enable or disable.Yesstring,
Available values: "disable", "enable"

Request Body

RequiredSchema
Yesapplication/json: AnnotationReplyActionPayload

Responses

CodeDescriptionSchema
200Annotation reply settings task initiated.application/json: AnnotationJobStatusResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied

[GET] /apps/annotation-reply/{action}/status/{job_id}

Get Annotation Reply Job Status

Retrieves the status of an asynchronous annotation reply configuration job started by Configure Annotation Reply.

Parameters

NameLocated inDescriptionRequiredSchema
actionpathAction to perform: enable or disable.Yesstring,
Available values: "disable", "enable"
job_idpathJob ID returned by Configure Annotation Reply.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Successfully retrieved task status.application/json: AnnotationJobStatusDetailResponse
400invalid_param : The specified job does not exist.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Job not found

[GET] /apps/annotations

List Annotations

Retrieves a paginated list of annotations for the application. Supports keyword search filtering.

Parameters

NameLocated inDescriptionRequiredSchema
keywordqueryKeyword to filter annotations by question or answer content.Nostring
limitqueryNumber of items per page.Nointeger,
Default: 20
pagequeryPage number for pagination.Nointeger,
Default: 1

Responses

CodeDescriptionSchema
200Successfully retrieved annotation list.application/json: AnnotationList
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied

[POST] /apps/annotations

Create Annotation

Creates a new annotation. Annotations provide predefined question-answer pairs that the app can match and return directly instead of generating a response.

Request Body

RequiredSchema
Yesapplication/json: AnnotationCreatePayload

Responses

CodeDescriptionSchema
201Annotation created successfully.application/json: Annotation
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied

[DELETE] /apps/annotations/{annotation_id}

Delete Annotation

Deletes an annotation and its associated hit history.

Parameters

NameLocated inDescriptionRequiredSchema
annotation_idpathThe unique identifier of the annotation to delete.Yesstring (uuid)

Responses

CodeDescription
204Annotation deleted successfully.
401Unauthorized - invalid API token
403forbidden : Insufficient permissions to edit annotations.
404not_found : Annotation does not exist.

[PUT] /apps/annotations/{annotation_id}

Update Annotation

Updates the question and answer of an existing annotation.

Parameters

NameLocated inDescriptionRequiredSchema
annotation_idpathThe unique identifier of the annotation to update.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: AnnotationCreatePayload

Responses

CodeDescriptionSchema
200Annotation updated successfully.application/json: Annotation
401Unauthorized - invalid API token
403forbidden : Insufficient permissions to edit annotations.
404not_found : Annotation does not exist.

default

[POST] /audio-to-text

Convert Audio to Text

Convert audio file to text. Supported MIME types: audio/mp3, audio/mpga, audio/m4a, audio/wav, and audio/amr. File size limit is 30 MB.

Request Body

RequiredSchema
Yesmultipart/form-data: { "file": binary, "user": string }

Responses

CodeDescriptionSchema
200Successfully converted audio to text.application/json: AudioTranscriptResponse
400- app_unavailable : App unavailable or misconfigured. - speech_to_text_disabled : Speech-to-text is disabled for this app. - provider_not_support_speech_to_text : Model provider does not support speech-to-text. - provider_not_initialize : No valid model provider credentials found. - provider_quota_exceeded : Model provider quota exhausted. - model_currently_not_support : Current model does not support this operation. - completion_request_error : Speech recognition request failed.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
413audio_too_large : Audio file size exceeded the limit.
415unsupported_audio_type : Audio type is not allowed.
500internal_server_error : Internal server error.

[POST] /text-to-audio

Convert Text to Audio

Convert text to speech.

Request Body

RequiredSchema
Yesapplication/json: TextToAudioPayloadWithUser

Responses

CodeDescription
200Returns the generated audio. Generator responses are streamed by the service as audio/mpeg; otherwise the provider output is returned directly.
400- app_unavailable : App unavailable or misconfigured. - provider_not_initialize : No valid model provider credentials found. - provider_quota_exceeded : Model provider quota exhausted. - model_currently_not_support : Current model does not support this operation. - completion_request_error : Text-to-speech request failed.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
500internal_server_error : Internal server error.

default

[POST] /chat-messages

Send Chat Message

Send a request to the chat application.

Request Body

RequiredSchema
Yesapplication/json: ChatRequestPayloadWithUser

Responses

CodeDescription
200Successful response. The content type and structure depend on the response_mode parameter in the request. - If response_mode is blocking, returns application/json with a ChatCompletionResponse object. - If response_mode is streaming, returns text/event-stream with a stream of Server-Sent Events.
400- app_unavailable : App unavailable or misconfigured. - not_chat_app : App mode does not match the API route. - conversation_completed : The conversation has ended. - provider_not_initialize : No valid model provider credentials found. - provider_quota_exceeded : Model provider quota exhausted. - model_currently_not_support : Current model unavailable. - completion_request_error : Text generation failed.
401Unauthorized - invalid API token
403workflow_version_execution_not_allowed : Workflow version execution is unavailable on the current plan. Upgrade to a paid plan.
404not_found : Conversation does not exist.
429- too_many_requests : Too many concurrent requests for this app. - rate_limit_error : The upstream model provider rate limit was exceeded.
500internal_server_error : Internal server error.

[POST] /chat-messages/{task_id}/stop

Stop Chat Message Generation

Stops a chat message generation task. Only supported in streaming mode.

Parameters

NameLocated inDescriptionRequiredSchema
task_idpathTask ID, obtained from a streaming chunk returned by the Send Chat Message API.Yesstring

Request Body

RequiredSchema
Yesapplication/json: RequiredServiceApiUserPayload

Responses

CodeDescriptionSchema
200Task stopped successfullyapplication/json: SimpleResultResponse
400not_chat_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Task not found

[GET] /messages/{message_id}/suggested

Get Next Suggested Questions

Get next questions suggestions for the current message.

Parameters

NameLocated inDescriptionRequiredSchema
message_idpathMessage IDYesstring (uuid)
userqueryUser identifier, used for end-user context.Yesstring

Responses

CodeDescriptionSchema
200Suggested questions retrieved successfullyapplication/json: SimpleResultStringListResponse
400- not_chat_app : App mode does not match the API route. - bad_request : Suggested questions feature is disabled.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Message does not exist.
500internal_server_error : Internal server error.

[GET] /workflow/{task_id}/events

Stream Workflow Events

Resume the Server-Sent Events stream for a workflow run after a pause or a dropped SSE connection. For runs that have already finished, the stream emits a single workflow_finished event and closes.

Parameters

NameLocated inDescriptionRequiredSchema
task_idpathWorkflow run ID returned by the original workflow run request.Yesstring
continue_on_pausequerySet to true to keep the stream open across multiple workflow_paused events, which is useful when the workflow has more than one Human Input node in sequence. By default, the stream closes after the first pause.Noboolean
include_state_snapshotqueryWhen true, replay from the persisted state snapshot to include a status summary of already-executed nodes before streaming new events.Noboolean
userqueryEnd-user identifier that originally triggered the run. Must match the creator of the run.Yesstring

Responses

CodeDescriptionSchema
200Server-Sent Events stream. Each event is delivered as data: {JSON}\\n\\n. Event payloads follow the same schemas as the original streaming response.text/event-stream: EventStreamResponse
400not_workflow_app : Please check if your app mode matches the right API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Workflow run not found.

[GET] /workflows/logs

List Workflow Logs

Retrieve paginated workflow execution logs with filtering options.

Parameters

NameLocated inDescriptionRequiredSchema
created_at__afterqueryFilter logs created after this ISO 8601 timestamp.NodateTime
created_at__beforequeryFilter logs created before this ISO 8601 timestamp.NodateTime
created_by_accountqueryFilter by account ID.Nostring
created_by_end_user_session_idqueryFilter by end user session ID.Nostring
keywordqueryKeyword to search in logs.Nostring
limitqueryNumber of items per page.Nointeger,
Default: 20
pagequeryPage number for pagination.Nointeger,
Default: 1
statusqueryFilter by execution status.Nostring,
Available values: "failed", "stopped", "succeeded"

Responses

CodeDescriptionSchema
200Successfully retrieved workflow logs.application/json: WorkflowAppLogPaginationResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied

[GET] /workflows/run/{workflow_run_id}

Get Workflow Run Detail

Retrieve the current execution results of a workflow task based on the workflow execution ID.

Parameters

NameLocated inDescriptionRequiredSchema
workflow_run_idpathWorkflow run ID, obtained from the workflow execution response or streaming events.Yesstring

Responses

CodeDescriptionSchema
200Successfully retrieved workflow run details.application/json: WorkflowRunResponse
400not_workflow_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Workflow run not found.

default

[POST] /chat-messages

Send Chat Message

Send a request to the chat application.

Request Body

RequiredSchema
Yesapplication/json: ChatRequestPayloadWithUser

Responses

CodeDescription
200Successful response. The content type and structure depend on the response_mode parameter in the request. - If response_mode is blocking, returns application/json with a ChatCompletionResponse object. - If response_mode is streaming, returns text/event-stream with a stream of Server-Sent Events.
400- app_unavailable : App unavailable or misconfigured. - not_chat_app : App mode does not match the API route. - conversation_completed : The conversation has ended. - provider_not_initialize : No valid model provider credentials found. - provider_quota_exceeded : Model provider quota exhausted. - model_currently_not_support : Current model unavailable. - completion_request_error : Text generation failed.
401Unauthorized - invalid API token
403workflow_version_execution_not_allowed : Workflow version execution is unavailable on the current plan. Upgrade to a paid plan.
404not_found : Conversation does not exist.
429- too_many_requests : Too many concurrent requests for this app. - rate_limit_error : The upstream model provider rate limit was exceeded.
500internal_server_error : Internal server error.

[POST] /chat-messages/{task_id}/stop

Stop Chat Message Generation

Stops a chat message generation task. Only supported in streaming mode.

Parameters

NameLocated inDescriptionRequiredSchema
task_idpathTask ID, obtained from a streaming chunk returned by the Send Chat Message API.Yesstring

Request Body

RequiredSchema
Yesapplication/json: RequiredServiceApiUserPayload

Responses

CodeDescriptionSchema
200Task stopped successfullyapplication/json: SimpleResultResponse
400not_chat_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Task not found

[GET] /messages/{message_id}/suggested

Get Next Suggested Questions

Get next questions suggestions for the current message.

Parameters

NameLocated inDescriptionRequiredSchema
message_idpathMessage IDYesstring (uuid)
userqueryUser identifier, used for end-user context.Yesstring

Responses

CodeDescriptionSchema
200Suggested questions retrieved successfullyapplication/json: SimpleResultStringListResponse
400- not_chat_app : App mode does not match the API route. - bad_request : Suggested questions feature is disabled.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Message does not exist.
500internal_server_error : Internal server error.

default

[POST] /completion-messages

Send Completion Message

Send a request to the text generation application.

Request Body

RequiredSchema
Yesapplication/json: CompletionRequestPayloadWithUser

Responses

CodeDescription
200Successful response. The content type and structure depend on the response_mode parameter in the request. - If response_mode is blocking, returns application/json with a CompletionResponse object. - If response_mode is streaming, returns text/event-stream with a stream of ChunkCompletionEvent objects.
400- app_unavailable : App unavailable or misconfigured. - provider_not_initialize : No valid model provider credentials found. - provider_quota_exceeded : Model provider quota exhausted. - model_currently_not_support : Current model unavailable. - completion_request_error : Text generation failed.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Conversation not found
429too_many_requests : Too many concurrent requests for this app.
500internal_server_error : Internal server error.

[POST] /completion-messages/{task_id}/stop

Stop Completion Message Generation

Stops a completion message generation task. Only supported in streaming mode.

Parameters

NameLocated inDescriptionRequiredSchema
task_idpathTask ID, obtained from a streaming chunk returned by the Send Completion Message API.Yesstring

Request Body

RequiredSchema
Yesapplication/json: RequiredServiceApiUserPayload

Responses

CodeDescriptionSchema
200Task stopped successfullyapplication/json: SimpleResultResponse
400app_unavailable : App unavailable or misconfigured.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Task not found

default

[GET] /conversations

List Conversations

Retrieve the conversation list for the current user, ordered by most recently active.

Parameters

NameLocated inDescriptionRequiredSchema
last_idqueryThe ID of the last record on the current page. Used to fetch the next page.Nostring
limitqueryNumber of records to return.Nointeger,
Default: 20
sort_byquerySorting field. Use the - prefix for descending order.Nostring,
Available values: "-created_at", "-updated_at", "created_at", "updated_at",
Default: -updated_at
userqueryUser identifier, used for end-user context.Nostring

Responses

CodeDescriptionSchema
200Successfully retrieved conversations list.application/json: ConversationInfiniteScrollPagination
400not_chat_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Last conversation does not exist (invalid last_id).

[DELETE] /conversations/{c_id}

Delete Conversation

Delete a conversation.

Parameters

NameLocated inDescriptionRequiredSchema
c_idpathConversation ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: OptionalServiceApiUserPayload

Responses

CodeDescription
204Conversation deleted successfully.
400not_chat_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Conversation does not exist.

[POST] /conversations/{c_id}/name

Rename Conversation

Rename a conversation or auto-generate a name. The conversation name is used for display on clients that support multiple conversations.

Parameters

NameLocated inDescriptionRequiredSchema
c_idpathConversation ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: ConversationRenamePayloadWithUser

Responses

CodeDescriptionSchema
200Conversation renamed successfully.application/json: SimpleConversation
400not_chat_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Conversation does not exist.

[GET] /conversations/{c_id}/variables

List Conversation Variables

Retrieve variables from a specific conversation.

Parameters

NameLocated inDescriptionRequiredSchema
c_idpathConversation ID.Yesstring (uuid)
last_idqueryThe ID of the last record on the current page. Used to fetch the next page.Nostring
limitqueryNumber of records to return.Nointeger,
Default: 20
userqueryUser identifier, used for end-user context.Nostring
variable_namequeryFilter variables by a specific name.Nostring

Responses

CodeDescriptionSchema
200Successfully retrieved conversation variables.application/json: ConversationVariableInfiniteScrollPaginationResponse
400not_chat_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Conversation does not exist.

[PUT] /conversations/{c_id}/variables/{variable_id}

Update Conversation Variable

Update the value of a specific conversation variable. The value must match the expected type.

Parameters

NameLocated inDescriptionRequiredSchema
c_idpathConversation ID.Yesstring (uuid)
variable_idpathVariable ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: ConversationVariableUpdatePayloadWithUser

Responses

CodeDescriptionSchema
200Variable updated successfully.application/json: ConversationVariableResponse
400- not_chat_app : App mode does not match the API route. - bad_request : Variable value type mismatch.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404- not_found : Conversation does not exist. - not_found : Conversation variable does not exist.

[GET] /messages

List Conversation Messages

Returns historical chat records in a scrolling load format, with the first page returning the latest limit messages, i.e., in reverse order.

Parameters

NameLocated inDescriptionRequiredSchema
conversation_idqueryConversation ID.Yesstring
first_idqueryThe ID of the first chat record on the current page. Omit this value to fetch the latest messages; for subsequent pages, use the first message ID from the current list to fetch older messages.Nostring
limitqueryNumber of chat history messages to return per request.Nointeger,
Default: 20
userqueryUser identifier, used for end-user context.Nostring

Responses

CodeDescriptionSchema
200Successfully retrieved conversation history.application/json: MessageInfiniteScrollPagination
400not_chat_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404- not_found : Conversation does not exist. - not_found : First message does not exist.

default

[GET] /datasets

List Knowledge Bases

Returns a paginated list of knowledge bases. Supports filtering by keyword and tags.

Parameters

NameLocated inDescriptionRequiredSchema
include_allqueryWhether to include all knowledge bases regardless of permissions.Noboolean
keywordquerySearch keyword to filter by name.Nostring
limitqueryNumber of items per page. Server caps at 100.Nointeger,
Default: 20
pagequeryPage number to retrieve.Nointeger,
Default: 1
tag_idsqueryTag IDs to filter by.No[ string ]

Responses

CodeDescriptionSchema
200List of knowledge bases.application/json: DatasetListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

[POST] /datasets

Create an Empty Knowledge Base

Create a new empty knowledge base. After creation, use Create Document by Text or Create Document by File to add documents.

Request Body

RequiredSchema
Yesapplication/json: DatasetCreatePayload

Responses

CodeDescriptionSchema
200Knowledge base created successfully.application/json: DatasetDetailResponse
400Bad request - invalid parameters
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
409dataset_name_duplicate : The dataset name already exists. Please modify your dataset name.

[DELETE] /datasets/{dataset_id}

Delete Knowledge Base

Permanently delete a knowledge base and all its documents. The knowledge base must not be in use by any application.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Responses

CodeDescription
204Success.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404not_found : Dataset not found.
409dataset_in_use : The knowledge base is being used by some apps. Please remove it from the apps before deleting.

[GET] /datasets/{dataset_id}

Get Knowledge Base

Retrieve detailed information about a specific knowledge base, including its embedding model, retrieval configuration, and document statistics.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Knowledge base details.application/json: DatasetDetailWithPartialMembersResponse
401Unauthorized - invalid API token
403forbidden : Insufficient permissions to access this knowledge base.
404not_found : Dataset not found.

[PATCH] /datasets/{dataset_id}

Update Knowledge Base

Update the name, description, permissions, or retrieval settings of an existing knowledge base. Only the fields provided in the request body are updated.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: DatasetUpdatePayload

Responses

CodeDescriptionSchema
200Knowledge base updated successfully.application/json: DatasetDetailWithPartialMembersResponse
401Unauthorized - invalid API token
403forbidden : Insufficient permissions to access this knowledge base.
404not_found : Dataset not found.

[POST] /datasets/{dataset_id}/hit-testing

Retrieve Chunks from a Knowledge Base / Test Retrieval

Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: HitTestingPayload

Responses

CodeDescriptionSchema
200Retrieval results.application/json: HitTestingResponse
400- dataset_not_initialized : The dataset is still being initialized or indexing. Please wait a moment. - provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - provider_quota_exceeded : Your quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials. - model_currently_not_support : Dify Hosted OpenAI trial currently not support the GPT-4 model. - completion_request_error : Completion request failed. - invalid_param : Invalid parameter value.
401Unauthorized - invalid API token
403forbidden : Insufficient permissions.
404not_found : Knowledge base not found.
500internal_server_error : An internal error occurred during retrieval.

[POST] /datasets/{dataset_id}/retrieve

Retrieve Chunks from a Knowledge Base / Test Retrieval

Performs a search query against a knowledge base to retrieve the most relevant chunks. This endpoint can be used for both production retrieval and test retrieval.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: HitTestingPayload

Responses

CodeDescriptionSchema
200Retrieval results.application/json: HitTestingResponse
400- dataset_not_initialized : The dataset is still being initialized or indexing. Please wait a moment. - provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - provider_quota_exceeded : Your quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials. - model_currently_not_support : Dify Hosted OpenAI trial currently not support the GPT-4 model. - completion_request_error : Completion request failed. - invalid_param : Invalid parameter value.
401Unauthorized - invalid API token
403forbidden : Insufficient permissions.
404not_found : Knowledge base not found.
500internal_server_error : An internal error occurred during retrieval.

default

[POST] /datasets/pipeline/file-upload

Upload Pipeline File

Upload a file for use in a knowledge pipeline. Accepts a single file via multipart/form-data.

Request Body

RequiredSchema
Yesmultipart/form-data: { "file": binary }

Responses

CodeDescriptionSchema
201File uploaded successfully.application/json: PipelineUploadFileResponse
400- no_file_uploaded : Please upload your file. - filename_not_exists_error : The specified filename does not exist. - too_many_files : Only one file is allowed.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
413file_too_large : File size exceeded.
415unsupported_file_type : File type not allowed.

[GET] /datasets/{dataset_id}/pipeline/datasource-plugins

List Datasource Plugins

List the datasource nodes configured in the knowledge pipeline. Each node includes the plugin it uses plus the metadata needed to run it.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
is_publishedqueryWhether to retrieve nodes from the published or draft pipeline. true returns nodes from the published version, false returns nodes from the draft.Noboolean,
Default: true

Responses

CodeDescriptionSchema
200List of datasource nodes configured in the pipeline.application/json: DatasourcePluginListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404not_found : Dataset not found.

[POST] /datasets/{dataset_id}/pipeline/datasource/nodes/{node_id}/run

Run Datasource Node

Execute a single datasource node within the knowledge pipeline. Returns a streaming response with the node execution results.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
node_idpathID of the datasource node to execute.Yesstring

Request Body

RequiredSchema
Yesapplication/json: DatasourceNodeRunPayload

Responses

CodeDescription
200Streaming response with node execution events.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404not_found : Dataset not found.

[POST] /datasets/{dataset_id}/pipeline/run

Run Pipeline

Execute the full knowledge pipeline for a knowledge base. Supports both streaming and blocking response modes.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: PipelineRunApiEntity

Responses

CodeDescriptionSchema
200Pipeline execution result. Format depends on response_mode: streaming returns a text/event-stream, blocking returns a JSON object.application/json: GeneratedAppResponse
text/event-stream: GeneratedAppResponse
401Unauthorized - invalid API token
403forbidden : Forbidden.
404not_found : Dataset not found.
500pipeline_run_error : Pipeline execution failed.

default

[DELETE] /datasets/tags

Delete Knowledge Tag

Permanently delete a knowledge base tag. Does not delete the knowledge bases that were tagged.

Request Body

RequiredSchema
Yesapplication/json: TagDeletePayload

Responses

CodeDescription
204Success.
401Unauthorized - invalid API token
403Forbidden - insufficient permissions

[GET] /datasets/tags

List Knowledge Tags

Returns the list of all knowledge base tags in the workspace.

Responses

CodeDescriptionSchema
200List of tags.application/json: KnowledgeTagListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

[PATCH] /datasets/tags

Update Knowledge Tag

Rename an existing knowledge base tag.

Request Body

RequiredSchema
Yesapplication/json: TagUpdatePayload

Responses

CodeDescriptionSchema
200Tag updated successfully.application/json: KnowledgeTagResponse
401Unauthorized - invalid API token
403Forbidden - insufficient permissions

[POST] /datasets/tags

Create Knowledge Tag

Create a new tag for organizing knowledge bases.

Request Body

RequiredSchema
Yesapplication/json: TagCreatePayload

Responses

CodeDescriptionSchema
200Tag created successfully.application/json: KnowledgeTagResponse
401Unauthorized - invalid API token
403Forbidden - insufficient permissions

[POST] /datasets/tags/binding

Create Tag Binding

Bind one or more tags to a knowledge base. A knowledge base can have multiple tags.

Request Body

RequiredSchema
Yesapplication/json: TagBindingPayload

Responses

CodeDescription
204Success.
401Unauthorized - invalid API token
403Forbidden - insufficient permissions

[POST] /datasets/tags/unbinding

Delete Tag Binding

Remove one or more tags from a knowledge base.

Request Body

RequiredSchema
Yesapplication/json: TagUnbindingPayload

Responses

CodeDescription
204Success.
401Unauthorized - invalid API token
403Forbidden - insufficient permissions

[GET] /datasets/{dataset_id}/tags

Get Knowledge Base Tags

Returns the list of tags bound to a specific knowledge base.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Tags bound to the knowledge base.application/json: DatasetBoundTagListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

default

[POST] /datasets/{dataset_id}/document/create-by-file

Create Document by File

Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned batch ID with Get Document Indexing Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesmultipart/form-data: { "data": string, "file": binary }

Responses

CodeDescriptionSchema
200Document created successfully.application/json: DocumentAndBatchResponse
400- no_file_uploaded : Please upload your file. - too_many_files : Only one file is allowed. - filename_not_exists_error : The specified filename does not exist. - provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - invalid_param : Knowledge base does not exist, external datasets not supported, file too large, unsupported file type, missing required fields, or invalid doc_form (must be text_model, hierarchical_model, or qa_model).
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

[POST] /datasets/{dataset_id}/document/create-by-text

Create Document by Text

Create a document from raw text content. The document is processed asynchronously — use the returned batch ID with Get Document Indexing Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: DocumentTextCreatePayload

Responses

CodeDescriptionSchema
200Document created successfully.application/json: DocumentAndBatchResponse
400- provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - invalid_param : Knowledge base does not exist. / indexing_technique is required. / Invalid doc_form (must be text_model, hierarchical_model, or qa_model).
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

[POST] /datasets/{dataset_id}/document/create_by_file

DEPRECATED

Create Document by File

Create a document by uploading a file. Supports common document formats (PDF, TXT, DOCX, etc.). Processing is asynchronous — use the returned batch ID with Get Document Indexing Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesmultipart/form-data: { "data": string, "file": binary }

Responses

CodeDescriptionSchema
200Document created successfully.application/json: DocumentAndBatchResponse
400- no_file_uploaded : Please upload your file. - too_many_files : Only one file is allowed. - filename_not_exists_error : The specified filename does not exist. - provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - invalid_param : Knowledge base does not exist, external datasets not supported, file too large, unsupported file type, missing required fields, or invalid doc_form (must be text_model, hierarchical_model, or qa_model).
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

[GET] /datasets/{dataset_id}/documents

List Documents

Returns a paginated list of documents in the knowledge base. Supports filtering by keyword and indexing status.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
keywordquerySearch keyword to filter by document name.Nostring
limitqueryNumber of items per page. Server caps at 100.Nointeger,
Default: 20
pagequeryPage number to retrieve.Nointeger,
Default: 1
statusqueryFilter by display status.Nostring,
Available values: "archived", "available", "disabled", "error", "indexing", "paused", "queuing"

Responses

CodeDescriptionSchema
200List of documents.application/json: DocumentListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404not_found : Knowledge base not found.

[POST] /datasets/{dataset_id}/documents/download-zip

Download Documents as ZIP

Download multiple uploaded-file documents as a single ZIP archive. Accepts up to 100 document IDs.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: DocumentBatchDownloadZipPayload

Responses

CodeDescription
200ZIP archive containing the requested documents.
401Unauthorized - invalid API token
403forbidden : Insufficient permissions.
404not_found : Document or dataset not found.

[PATCH] /datasets/{dataset_id}/documents/status/{action}

Update Document Status in Batch

Enable, disable, archive, or unarchive multiple documents at once.

Parameters

NameLocated inDescriptionRequiredSchema
actionpathAction to perform: 'enable', 'disable', 'archive', or 'un_archive'Yesstring,
Available values: "archive", "disable", "enable", "un_archive"
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: DocumentStatusPayload

Responses

CodeDescriptionSchema
200Document status updated successfullyapplication/json: SimpleResultResponse
400invalid_action : Invalid action.
401Unauthorized - invalid API token
403forbidden : Insufficient permissions.
404not_found : Knowledge base not found.

[GET] /datasets/{dataset_id}/documents/{batch}/indexing-status

Get Document Indexing Status

Check the indexing progress of documents in a batch. Returns the current processing stage and chunk completion counts for each document. Poll this endpoint until indexing_status reaches completed or error. The status progresses through: waitingparsingcleaningsplittingindexingcompleted.

Parameters

NameLocated inDescriptionRequiredSchema
batchpathBatch ID.Yesstring
dataset_idpathKnowledge base ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Indexing status for documents in the batch.application/json: DocumentStatusListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404not_found : Knowledge base not found. / Documents not found.

[DELETE] /datasets/{dataset_id}/documents/{document_id}

Delete Document

Permanently delete a document and all its chunks from the knowledge base.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Responses

CodeDescription
204Success.
400document_indexing : Cannot delete document during indexing.
401Unauthorized - invalid API token
403archived_document_immutable : The archived document is not editable.
404not_found : Document Not Exists.

[GET] /datasets/{dataset_id}/documents/{document_id}

Get Document

Retrieve detailed information about a specific document, including its indexing status, metadata, and processing statistics.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
metadataqueryall returns all fields including metadata. only returns only id, doc_type, and doc_metadata. without returns all fields except doc_metadata.Nostring,
Available values: "all", "only", "without",
Default: all

Responses

CodeDescriptionSchema
200Document details. The response shape varies based on the metadata query parameter. When metadata is only, only id, doc_type, and doc_metadata are returned. When metadata is without, doc_type and doc_metadata are omitted.application/json: DocumentDetailResponse
400invalid_metadata : Invalid metadata value for the specified key.
401Unauthorized - invalid API token
403forbidden : No permission.
404not_found : Document not found.

[PATCH] /datasets/{dataset_id}/documents/{document_id}

Update Document by File

Update an existing document by uploading a new file. Re-triggers indexing — use the returned batch ID with Get Document Indexing Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Request Body

RequiredSchema
Nomultipart/form-data: { "data": string, "file": binary }

Responses

CodeDescriptionSchema
200Document updated successfully.application/json: DocumentAndBatchResponse
400- too_many_files : Only one file is allowed. - filename_not_exists_error : The specified filename does not exist. - provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - invalid_param : Knowledge base does not exist, external datasets not supported, file too large, unsupported file type, or invalid doc_form (must be text_model, hierarchical_model, or qa_model).
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Document not found

[GET] /datasets/{dataset_id}/documents/{document_id}/download

Download Document

Get a signed download URL for a document's original uploaded file.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Download URL generated successfully.application/json: UrlResponse
401Unauthorized - invalid API token
403forbidden : No permission to access this document.
404not_found : Document not found.

[POST] /datasets/{dataset_id}/documents/{document_id}/update-by-file

DEPRECATED

Update Document by File

Update an existing document by uploading a new file. Re-triggers indexing — use the returned batch ID with Get Document Indexing Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Request Body

RequiredSchema
Nomultipart/form-data: { "data": string, "file": binary }

Responses

CodeDescriptionSchema
200Document updated successfully.application/json: DocumentAndBatchResponse
400- too_many_files : Only one file is allowed. - filename_not_exists_error : The specified filename does not exist. - provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - invalid_param : Knowledge base does not exist, external datasets not supported, file too large, unsupported file type, or invalid doc_form (must be text_model, hierarchical_model, or qa_model).
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Document not found

[POST] /datasets/{dataset_id}/documents/{document_id}/update-by-text

Update Document by Text

Update an existing document's text content, name, or processing configuration. Re-triggers indexing if content changes — use the returned batch ID with Get Document Indexing Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: DocumentTextUpdate

Responses

CodeDescriptionSchema
200Document updated successfully.application/json: DocumentAndBatchResponse
400- provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - invalid_param : Knowledge base does not exist, name is required when text is provided, or invalid doc_form (must be text_model, hierarchical_model, or qa_model).
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Document not found

[POST] /datasets/{dataset_id}/documents/{document_id}/update_by_file

DEPRECATED

Update Document by File

Update an existing document by uploading a new file. Re-triggers indexing — use the returned batch ID with Get Document Indexing Status to track progress.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Request Body

RequiredSchema
Nomultipart/form-data: { "data": string, "file": binary }

Responses

CodeDescriptionSchema
200Document updated successfully.application/json: DocumentAndBatchResponse
400- too_many_files : Only one file is allowed. - filename_not_exists_error : The specified filename does not exist. - provider_not_initialize : No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials. - invalid_param : Knowledge base does not exist, external datasets not supported, file too large, unsupported file type, or invalid doc_form (must be text_model, hierarchical_model, or qa_model).
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Document not found

default

[POST] /datasets/{dataset_id}/documents/metadata

Update Document Metadata in Batch

Update metadata values for multiple documents at once. Each document in the request receives the specified metadata key-value pairs.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: MetadataOperationData

Responses

CodeDescriptionSchema
200Document metadata updated successfully.application/json: DatasetMetadataActionResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset not found

[GET] /datasets/{dataset_id}/metadata

List Metadata Fields

Returns the list of all metadata fields (both custom and built-in) for the knowledge base, along with the count of documents using each field.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Metadata fields for the knowledge base.application/json: DatasetMetadataListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset not found

[POST] /datasets/{dataset_id}/metadata

Create Metadata Field

Create a custom metadata field for the knowledge base. Metadata fields can be used to annotate documents with structured information.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: MetadataArgs

Responses

CodeDescriptionSchema
201Metadata field created successfully.application/json: DatasetMetadataResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset not found

[GET] /datasets/{dataset_id}/metadata/built-in

Get Built-in Metadata Fields

Returns the list of built-in metadata fields provided by the system (e.g., document type, source URL).

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Built-in metadata fields.application/json: DatasetMetadataBuiltInFieldsResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied

[POST] /datasets/{dataset_id}/metadata/built-in/{action}

Update Built-in Metadata Field

Enable or disable built-in metadata fields for the knowledge base.

Parameters

NameLocated inDescriptionRequiredSchema
actionpathenable to activate built-in metadata fields, disable to deactivate them.Yesstring,
Available values: "disable", "enable"
dataset_idpathKnowledge base ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Built-in metadata field toggled successfully.application/json: DatasetMetadataActionResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset not found

[DELETE] /datasets/{dataset_id}/metadata/{metadata_id}

Delete Metadata Field

Permanently delete a custom metadata field. Documents using this field will lose their metadata values for it.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
metadata_idpathMetadata field ID.Yesstring (uuid)

Responses

CodeDescription
204Success.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset or metadata not found

[PATCH] /datasets/{dataset_id}/metadata/{metadata_id}

Update Metadata Field

Rename a custom metadata field.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
metadata_idpathMetadata field ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: MetadataUpdatePayload

Responses

CodeDescriptionSchema
200Metadata field updated successfully.application/json: DatasetMetadataResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset or metadata not found

default

[GET] /datasets/{dataset_id}/documents/{document_id}/segments

List Chunks

Returns a paginated list of chunks within a document. Supports filtering by keyword and status.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
keywordquerySearch keyword.Nostring
limitqueryNumber of items per page. Server caps at 100.Nointeger,
Default: 20
pagequeryPage number to retrieve.Nointeger,
Default: 1
statusqueryFilter chunks by indexing status, such as completed, indexing, or error.No[ string ]

Responses

CodeDescriptionSchema
200List of chunks.application/json: SegmentListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset or document not found

[POST] /datasets/{dataset_id}/documents/{document_id}/segments

Create Chunks

Create one or more chunks within a document. Each chunk can include optional keywords and an answer field (for QA-mode documents).

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: SegmentCreatePayload

Responses

CodeDescriptionSchema
200Chunks created successfully.application/json: SegmentCreateListResponse
400Bad request - segments data is missing
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404not_found : Document is not completed or is disabled.

[DELETE] /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}

Delete Chunk

Permanently delete a chunk from the document.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
segment_idpathChunk ID.Yesstring (uuid)

Responses

CodeDescription
204Success.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset, document, or segment not found

[GET] /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}

Get Chunk

Retrieve detailed information about a specific chunk, including its content, keywords, and indexing status.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
segment_idpathChunk ID.Yesstring (uuid)

Responses

CodeDescriptionSchema
200Chunk details.application/json: SegmentDetailResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset, document, or segment not found

[POST] /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}

Update Chunk

Update a chunk's content, keywords, or answer. Re-triggers indexing for the modified chunk.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
segment_idpathChunk ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: SegmentUpdatePayload

Responses

CodeDescriptionSchema
200Chunk updated successfully.application/json: SegmentDetailResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset, document, or segment not found

[GET] /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks

List Child Chunks

Returns a paginated list of child chunks under a specific parent chunk.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
segment_idpathChunk ID.Yesstring (uuid)
keywordquerySearch keyword.Nostring
limitqueryNumber of items per page. Server caps at 100.Nointeger,
Default: 20
pagequeryPage number to retrieve.Nointeger,
Default: 1

Responses

CodeDescriptionSchema
200List of child chunks.application/json: ChildChunkListResponse
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset, document, or segment not found

[POST] /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks

Create Child Chunk

Create a child chunk under the specified segment.

Parameters

NameLocated inDescriptionRequiredSchema
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
segment_idpathChunk ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: ChildChunkCreatePayload

Responses

CodeDescriptionSchema
200Child chunk created successfully.application/json: ChildChunkDetailResponse
400invalid_param : Create child chunk index failed.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset, document, or segment not found

[DELETE] /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}

Delete Child Chunk

Permanently delete a child chunk from its parent chunk.

Parameters

NameLocated inDescriptionRequiredSchema
child_chunk_idpathChild chunk ID.Yesstring (uuid)
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
segment_idpathChunk ID.Yesstring (uuid)

Responses

CodeDescription
204Success.
400invalid_param : Delete child chunk index failed.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset, document, segment, or child chunk not found

[PATCH] /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks/{child_chunk_id}

Update Child Chunk

Update the content of an existing child chunk.

Parameters

NameLocated inDescriptionRequiredSchema
child_chunk_idpathChild chunk ID.Yesstring (uuid)
dataset_idpathKnowledge base ID.Yesstring (uuid)
document_idpathDocument ID.Yesstring (uuid)
segment_idpathChunk ID.Yesstring (uuid)

Request Body

RequiredSchema
Yesapplication/json: ChildChunkUpdatePayload

Responses

CodeDescriptionSchema
200Child chunk updated successfully.application/json: ChildChunkDetailResponse
400invalid_param : Update child chunk index failed.
401Unauthorized - invalid API token
403Forbidden - dataset API access or workspace access denied
404Dataset, document, segment, or child chunk not found

default

[GET] /end-users/{end_user_id}

Get End User Info

Retrieve an end user by ID. Useful when other APIs return an end-user ID (e.g., created_by from Upload File).

Parameters

NameLocated inDescriptionRequiredSchema
end_user_idpathEnd user IDYesstring (uuid)

Responses

CodeDescriptionSchema
200End user retrieved successfully.application/json: EndUserDetail
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404end_user_not_found : End user not found.

default

[POST] /files/upload

Upload File

Upload a file for use when sending messages, enabling multimodal understanding of images, documents, audio, and video. Uploaded files are for use by the current end-user only.

Request Body

RequiredSchema
Yesmultipart/form-data: { "file": binary, "user": string }

Responses

CodeDescriptionSchema
201File uploaded successfully.application/json: FileResponse
400- no_file_uploaded : No file was provided in the request. - too_many_files : Only one file is allowed per request. - filename_not_exists_error : The uploaded file has no filename.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
413file_too_large : File size exceeded.
415unsupported_file_type : File type not allowed.

[GET] /files/{file_id}/preview

Download File

Preview or download uploaded files previously uploaded via the Upload File API. Files can only be accessed if they belong to messages within the requesting application.

Parameters

NameLocated inDescriptionRequiredSchema
file_idpathThe unique identifier of the file to preview, obtained from the Upload File API response.Yesstring (uuid)
as_attachmentqueryIf true, forces the file to download as an attachment instead of previewing in browser.Noboolean
userqueryUser identifier, used for end-user context.Nostring

Responses

CodeDescription
200Returns the raw file content. The Content-Type header is set to the file's MIME type. If as_attachment is true, the file is returned as a download with Content-Disposition: attachment.
401Unauthorized - invalid API token
403file_access_denied : Access to the requested file is denied.
404file_not_found : The requested file was not found.

default

[GET] /form/human_input/{form_token}

Get Human Input Form

Retrieve a paused Human Input form's contents using the form_token from a human_input_required event. Requires WebApp delivery.

Parameters

NameLocated inDescriptionRequiredSchema
form_tokenpathHuman input form tokenYesstring

Responses

CodeDescriptionSchema
200Form contents retrieved successfully.application/json: HumanInputFormDefinitionResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Form not found.
412- human_input_form_submitted : Form already submitted. Forms are one-shot; the first response wins regardless of which user submits it. - human_input_form_expired : The form's expiration time passed before submission arrived.

[POST] /form/human_input/{form_token}

Submit Human Input Form

Submit the recipient's response to a paused Human Input form. The workflow resumes on acceptance; use Stream Workflow Events to follow subsequent events. Requires WebApp delivery.

Parameters

NameLocated inDescriptionRequiredSchema
form_tokenpathHuman input form tokenYesstring

Request Body

RequiredSchema
Yesapplication/json: HumanInputFormSubmitPayloadWithUser

Responses

CodeDescriptionSchema
200Form submitted successfully. The response body is an empty object.application/json: HumanInputFormSubmitResponse
400- bad_request : Form recipient type is invalid. - invalid_form_data : Submission failed validation against the form definition.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Form not found.
412- human_input_form_submitted : Form already submitted. Forms are one-shot; the first response wins regardless of which user submits it. - human_input_form_expired : The form's expiration time passed before submission arrived.

default

[GET] /info

Get App Info

Retrieve basic information about this application, including name, description, tags, and mode.

Responses

CodeDescriptionSchema
200Basic information of the application.application/json: AppInfoResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Application not found

[GET] /meta

Get App Meta

Retrieve metadata about this application, including tool icons and other configuration details.

Responses

CodeDescriptionSchema
200Successfully retrieved application meta information.application/json: AppMetaResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Application not found

[GET] /parameters

Get App Parameters

Retrieve the application's input form configuration, including feature switches, input parameter names, types, and default values.

Responses

CodeDescriptionSchema
200Application parameters information.application/json: Parameters
400app_unavailable : App unavailable or misconfigured.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Application not found

[GET] /site

Get App WebApp Settings

Retrieve the WebApp settings of this application, including site configuration, theme, and customization options.

Responses

CodeDescriptionSchema
200WebApp settings of the application.application/json: Site
401Unauthorized - invalid API token
403forbidden : Site not found for this application or the workspace has been archived.

default

[GET] /workflow/{task_id}/events

Stream Workflow Events

Resume the Server-Sent Events stream for a workflow run after a pause or a dropped SSE connection. For runs that have already finished, the stream emits a single workflow_finished event and closes.

Parameters

NameLocated inDescriptionRequiredSchema
task_idpathWorkflow run ID returned by the original workflow run request.Yesstring
continue_on_pausequerySet to true to keep the stream open across multiple workflow_paused events, which is useful when the workflow has more than one Human Input node in sequence. By default, the stream closes after the first pause.Noboolean
include_state_snapshotqueryWhen true, replay from the persisted state snapshot to include a status summary of already-executed nodes before streaming new events.Noboolean
userqueryEnd-user identifier that originally triggered the run. Must match the creator of the run.Yesstring

Responses

CodeDescriptionSchema
200Server-Sent Events stream. Each event is delivered as data: {JSON}\\n\\n. Event payloads follow the same schemas as the original streaming response.text/event-stream: EventStreamResponse
400not_workflow_app : Please check if your app mode matches the right API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Workflow run not found.

[GET] /workflows/logs

List Workflow Logs

Retrieve paginated workflow execution logs with filtering options.

Parameters

NameLocated inDescriptionRequiredSchema
created_at__afterqueryFilter logs created after this ISO 8601 timestamp.NodateTime
created_at__beforequeryFilter logs created before this ISO 8601 timestamp.NodateTime
created_by_accountqueryFilter by account ID.Nostring
created_by_end_user_session_idqueryFilter by end user session ID.Nostring
keywordqueryKeyword to search in logs.Nostring
limitqueryNumber of items per page.Nointeger,
Default: 20
pagequeryPage number for pagination.Nointeger,
Default: 1
statusqueryFilter by execution status.Nostring,
Available values: "failed", "stopped", "succeeded"

Responses

CodeDescriptionSchema
200Successfully retrieved workflow logs.application/json: WorkflowAppLogPaginationResponse
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied

[POST] /workflows/run

Run Workflow

Execute a workflow. Cannot be executed without a published workflow.

Request Body

RequiredSchema
Yesapplication/json: WorkflowRunPayloadWithUser

Responses

CodeDescriptionSchema
200Successful response. The content type and structure depend on the response_mode parameter in the request. - If response_mode is blocking, returns application/json with a WorkflowBlockingResponse object. - If response_mode is streaming, returns text/event-stream with a stream of ChunkWorkflowEvent objects.application/json: GeneratedAppResponse
text/event-stream: GeneratedAppResponse
400- not_workflow_app : App mode does not match the API route. - provider_not_initialize : No valid model provider credentials found. - provider_quota_exceeded : Model provider quota exhausted. - model_currently_not_support : Current model unavailable. - completion_request_error : Workflow execution request failed. - invalid_param : Invalid parameter value.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Workflow not found
429- too_many_requests : Too many concurrent requests for this app. - rate_limit_error : The upstream model provider rate limit was exceeded.
500internal_server_error : Internal server error.

[GET] /workflows/run/{workflow_run_id}

Get Workflow Run Detail

Retrieve the current execution results of a workflow task based on the workflow execution ID.

Parameters

NameLocated inDescriptionRequiredSchema
workflow_run_idpathWorkflow run ID, obtained from the workflow execution response or streaming events.Yesstring

Responses

CodeDescriptionSchema
200Successfully retrieved workflow run details.application/json: WorkflowRunResponse
400not_workflow_app : App mode does not match the API route.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404not_found : Workflow run not found.

[POST] /workflows/tasks/{task_id}/stop

Stop Workflow Task

Stop a running workflow task. Only supported in streaming mode.

Parameters

NameLocated inDescriptionRequiredSchema
task_idpathTask ID, obtained from the streaming chunk returned by the Run Workflow API.Yesstring

Request Body

RequiredSchema
Yesapplication/json: RequiredServiceApiUserPayload

Responses

CodeDescriptionSchema
200Task stopped successfullyapplication/json: SimpleResultResponse
400- not_workflow_app : App mode does not match the API route. - invalid_param : Required parameter missing or invalid.
401Unauthorized - invalid API token
403Forbidden - token scope, app, dataset, or workspace access denied
404Task not found

[POST] /workflows/{workflow_id}/run

Run Workflow by ID

Execute a specific workflow version identified by its ID. Useful for running a particular published version of the workflow.

Parameters

NameLocated inDescriptionRequiredSchema
workflow_idpathWorkflow ID of the specific version to execute. This value is returned in the workflow_id field of workflow run responses.Yesstring

Request Body

RequiredSchema
Yesapplication/json: WorkflowRunPayloadWithUser

Responses

CodeDescriptionSchema
200Successful response. The content type and structure depend on the response_mode parameter in the request. - If response_mode is blocking, returns application/json with a WorkflowBlockingResponse object. - If response_mode is streaming, returns text/event-stream with a stream of ChunkWorkflowEvent objects.application/json: GeneratedAppResponse
text/event-stream: GeneratedAppResponse
400- not_workflow_app : App mode does not match the API route. - bad_request : Workflow is a draft or has an invalid ID format. - provider_not_initialize : No valid model provider credentials found. - provider_quota_exceeded : Model provider quota exhausted. - model_currently_not_support : Current model unavailable. - completion_request_error : Workflow execution request failed. - invalid_param : Required parameter missing or invalid.
401Unauthorized - invalid API token
403workflow_version_execution_not_allowed : Workflow version execution is unavailable on the current plan. Upgrade to a paid plan.
404not_found : Workflow not found.
429- too_many_requests : Too many concurrent requests for this app. - rate_limit_error : The upstream model provider rate limit was exceeded.
500internal_server_error : Internal server error.

default

[GET] /workspaces/current/models/model-types/{model_type}

Get Available Models

Retrieve the list of available models by type. Primarily used to query text-embedding and rerank models for knowledge base configuration.

Parameters

NameLocated inDescriptionRequiredSchema
model_typepathType of model to retrieve.Yesstring,
Available values: "llm", "moderation", "rerank", "speech2text", "text-embedding", "tts"

Responses

CodeDescriptionSchema
200Available models for the specified type.application/json: ProviderWithModelsListResponse
401Unauthorized - invalid API token

Schemas

AgentThought

NameTypeDescriptionRequired
answerstringNo
chain_idstringNo
created_atintegerNo
files[ string ]Yes
idstringYes
message_idstringYes
observationstringNo
positionintegerYes
thoughtstringNo
toolstringNo
tool_inputstringNo
tool_labelsJSONValueYes

Annotation

NameTypeDescriptionRequired
answerstringNo
created_atintegerNo
hit_countintegerNo
idstringYes
questionstringNo

AnnotationCreatePayload

NameTypeDescriptionRequired
answerstringAnnotation answer.Yes
questionstringAnnotation question.Yes

AnnotationJobStatusDetailResponse

NameTypeDescriptionRequired
error_msgstringNo
job_idstringYes
job_statusstring
stringYes

AnnotationJobStatusResponse

NameTypeDescriptionRequired
job_idstringYes
job_statusstring
stringYes

AnnotationList

NameTypeDescriptionRequired
data[ Annotation ]Yes
has_morebooleanYes
limitintegerYes
pageintegerYes
totalintegerYes

AnnotationListQuery

NameTypeDescriptionRequired
keywordstringKeyword to filter annotations by question or answer content.No
limitinteger,
Default: 20Number of items per page.No
pageinteger,
Default: 1Page number for pagination.No

AnnotationReplyActionPayload

NameTypeDescriptionRequired
embedding_model_namestringName of the embedding model to use for annotation matching.Yes
embedding_provider_namestringName of the embedding model provider.Yes
score_thresholdfloatMinimum similarity score for an annotation to be considered a match. Higher values require closer matches.Yes

AppFeedbackListResponse

NameTypeDescriptionRequired
data[ AppFeedbackResponse ]Yes

AppFeedbackResponse

NameTypeDescriptionRequired
app_idstringYes
contentstringNo
conversation_idstringYes
created_atstringYes
from_account_idstringNo
from_end_user_idstringNo
from_sourcestringYes
idstringYes
message_idstringYes
ratingstringYes
updated_atstringYes

AppInfoResponse

NameTypeDescriptionRequired
author_namestringYes
descriptionstringYes
modestringYes
namestringYes
tags[ string ]Yes

AppMetaResponse

NameTypeDescriptionRequired
tool_iconsobjectNo

AudioBinaryResponse

NameTypeDescriptionRequired
AudioBinaryResponsestring

AudioTranscriptResponse

NameTypeDescriptionRequired
textstringYes

BinaryFileResponse

NameTypeDescriptionRequired
BinaryFileResponsestring

ButtonStyle

Button styles for user actions.

NameTypeDescriptionRequired
ButtonStylestringButton styles for user actions.

ChatRequestPayload

NameTypeDescriptionRequired
auto_generate_nameboolean,
Default: trueAuto-generate the conversation title. If false, use the Rename Conversation API with auto_generate: true to generate the title asynchronously.No
conversation_idstringConversation ID to continue a conversation. Omit this field or pass an empty string to start a new conversation, then pass the returned conversation_id in subsequent requests.No
files[ object ]File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.No
inputsobjectValues for app-defined variables. Refer to the user_input_form field in the Get App Parameters response to discover expected variable names and types.Yes
querystringUser input or question content.Yes
response_modestringResponse mode. streaming uses Server-Sent Events; blocking returns after completion. New Agent app mode supports streaming only. When omitted, non-Agent apps run in blocking mode and new Agent apps stream.No
workflow_idstringPublished workflow version ID to execute for advanced chat. If omitted, the app's current published workflow is used.No

ChatRequestPayloadWithUser

NameTypeDescriptionRequired
auto_generate_nameboolean,
Default: trueAuto-generate the conversation title. If false, use the Rename Conversation API with auto_generate: true to generate the title asynchronously.No
conversation_idstringConversation ID to continue a conversation. Omit this field or pass an empty string to start a new conversation, then pass the returned conversation_id in subsequent requests.No
files[ object ]File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.No
inputsobjectValues for app-defined variables. Refer to the user_input_form field in the Get App Parameters response to discover expected variable names and types.Yes
querystringUser input or question content.Yes
response_modestringResponse mode. streaming uses Server-Sent Events; blocking returns after completion. New Agent app mode supports streaming only. When omitted, non-Agent apps run in blocking mode and new Agent apps stream.No
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.Yes
workflow_idstringPublished workflow version ID to execute for advanced chat. If omitted, the app's current published workflow is used.No

ChildChunkCreatePayload

NameTypeDescriptionRequired
contentstringChild chunk text content.Yes

ChildChunkDetailResponse

NameTypeDescriptionRequired
dataChildChunkResponseYes

ChildChunkListQuery

NameTypeDescriptionRequired
keywordstringSearch keyword.No
limitinteger,
Default: 20Number of items per page. Server caps at 100.No
pageinteger,
Default: 1Page number to retrieve.No

ChildChunkListResponse

NameTypeDescriptionRequired
data[ ChildChunkResponse ]Yes
limitintegerYes
pageintegerYes
totalintegerYes
total_pagesintegerYes

ChildChunkResponse

NameTypeDescriptionRequired
contentstringYes
created_atintegerYes
idstringYes
positionintegerYes
segment_idstringYes
typestringYes
updated_atintegerYes
word_countintegerYes

ChildChunkUpdatePayload

NameTypeDescriptionRequired
contentstringChild chunk text content.Yes

CompletionRequestPayload

NameTypeDescriptionRequired
files[ object ]File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.No
inputsobjectValues for app-defined variables. Refer to the user_input_form field in the Get App Parameters response to discover expected variable names and types.Yes
querystringUser input or prompt content.No
response_modestringResponse mode. streaming uses Server-Sent Events; blocking returns after completion. When omitted, the request runs in blocking mode.No

CompletionRequestPayloadWithUser

NameTypeDescriptionRequired
files[ object ]File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.No
inputsobjectValues for app-defined variables. Refer to the user_input_form field in the Get App Parameters response to discover expected variable names and types.Yes
querystringUser input or prompt content.No
response_modestringResponse mode. streaming uses Server-Sent Events; blocking returns after completion. When omitted, the request runs in blocking mode.No
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.Yes

Condition

Condition detail

NameTypeDescriptionRequired
comparison_operatorstring,
Available values: "<", "=", ">", "after", "before", "contains", "empty", "end with", "in", "is", "is not", "not contains", "not empty", "not in", "start with", "≠", "≤", "≥"Comparison to apply. String operators (contains, not contains, start with, end with, is, is not, empty, not empty, in, not in) act on string or array metadata; numeric operators (=, , >, <, , ) act on numeric metadata; time operators (before, after) act on time metadata.
Enum: "<", "=", ">", "after", "before", "contains", "empty", "end with", "in", "is", "is not", "not contains", "not empty", "not in", "start with", "≠", "≤", "≥"Yes
namestringMetadata field name to compare against.Yes
valuestring
[ string ]
numberValue to compare against. Type depends on comparison_operator: string for most string operators, array of strings for in and not in, number for numeric operators, and omit or use null for empty and not empty.No

ConversationInfiniteScrollPagination

NameTypeDescriptionRequired
data[ SimpleConversation ]Yes
has_morebooleanYes
limitintegerYes

ConversationListQuery

NameTypeDescriptionRequired
last_idstringThe ID of the last record on the current page. Used to fetch the next page.No
limitinteger,
Default: 20Number of records to return.No
sort_bystring,
Available values: "-created_at", "-updated_at", "created_at", "updated_at",
Default: -updated_atSorting field. Use the - prefix for descending order.
Enum: "-created_at", "-updated_at", "created_at", "updated_at"No

ConversationRenamePayload

NameTypeDescriptionRequired
auto_generatebooleanAutomatically generate the conversation name. When true, the name field is ignored.No
namestringConversation name. Required when auto_generate is false.No

ConversationRenamePayloadWithUser

NameTypeDescriptionRequired
auto_generatebooleanAutomatically generate the conversation name. When true, the name field is ignored.No
namestringConversation name. Required when auto_generate is false.No
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.No

ConversationVariableInfiniteScrollPaginationResponse

NameTypeDescriptionRequired
data[ ConversationVariableResponse ]Yes
has_morebooleanYes
limitintegerYes

ConversationVariableResponse

NameTypeDescriptionRequired
created_atintegerNo
descriptionstringNo
idstringYes
namestringYes
updated_atintegerNo
valuestringNo
value_typestringYes

ConversationVariableUpdatePayload

NameTypeDescriptionRequired
valueThe new value for the variable. Must match the variable's expected type.Yes

ConversationVariableUpdatePayloadWithUser

NameTypeDescriptionRequired
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.No
valueThe new value for the variable. Must match the variable's expected type.Yes

ConversationVariablesQuery

NameTypeDescriptionRequired
last_idstringThe ID of the last record on the current page. Used to fetch the next page.No
limitinteger,
Default: 20Number of records to return.No
variable_namestringFilter variables by a specific name.No

CustomConfigurationStatus

Enum class for custom configuration status.

NameTypeDescriptionRequired
CustomConfigurationStatusstringEnum class for custom configuration status.

DatasetBoundTagListResponse

NameTypeDescriptionRequired
data[ DatasetBoundTagResponse ]Yes
totalintegerYes

DatasetBoundTagResponse

NameTypeDescriptionRequired
idstringYes
namestringYes

DatasetCreatePayload

NameTypeDescriptionRequired
descriptionstringDescription of the knowledge base.No
embedding_modelstringEmbedding model name. Use the model field from Get Available Models with model_type=text-embedding.No
embedding_model_providerstringEmbedding model provider. Use the provider field from Get Available Models with model_type=text-embedding.No
external_knowledge_api_idstringID of the external knowledge API.No
external_knowledge_idstringID of the external knowledge base.No
indexing_techniquestringhigh_quality uses embedding models for precise search; economy uses keyword-based indexing.No
namestringName of the knowledge base.Yes
permissionPermissionEnumControls who can access this knowledge base. only_me restricts access to the creator, all_team_members grants workspace-wide access, and partial_members grants access to specified members.No
providerstring,
Available values: "external", "vendor",
Default: vendorKnowledge base provider: vendor for internal knowledge bases, external for external ones.
Enum: "external", "vendor"No
retrieval_modelRetrievalModelRetrieval model configuration. Controls how chunks are searched and ranked.No
summary_index_settingobjectSummary index configuration.No

DatasetDetailResponse

NameTypeDescriptionRequired
app_countintegerYes
author_namestringYes
built_in_field_enabledbooleanYes
chunk_structurestringYes
created_atintegerYes
created_bystringYes
data_source_typestringYes
descriptionstringYes
doc_formstringYes
doc_metadata[ DatasetDocMetadataResponse ]Yes
document_countintegerYes
embedding_availablebooleanNo
embedding_modelstringYes
embedding_model_providerstringYes
enable_apibooleanYes
external_knowledge_infoDatasetExternalKnowledgeInfoResponseNo
external_retrieval_modelDatasetExternalRetrievalModelResponseYes
icon_infoDatasetIconInfoResponseNo
idstringYes
indexing_techniquestringYes
is_multimodalbooleanYes
is_publishedbooleanYes
maintainerstringNo
namestringYes
permissionstringYes
permission_keys[ string ]No
pipeline_idstringYes
providerstringYes
retrieval_model_dictDatasetRetrievalModelResponseYes
runtime_modestringYes
summary_index_settingDatasetSummaryIndexSettingResponseNo
tags[ DatasetTagResponse ]Yes
total_available_documentsintegerYes
total_documentsintegerYes
updated_atintegerYes
updated_bystringYes
word_countintegerYes

DatasetDetailWithPartialMembersResponse

NameTypeDescriptionRequired
app_countintegerYes
author_namestringYes
built_in_field_enabledbooleanYes
chunk_structurestringYes
created_atintegerYes
created_bystringYes
data_source_typestringYes
descriptionstringYes
doc_formstringYes
doc_metadata[ DatasetDocMetadataResponse ]Yes
document_countintegerYes
embedding_availablebooleanNo
embedding_modelstringYes
embedding_model_providerstringYes
enable_apibooleanYes
external_knowledge_infoDatasetExternalKnowledgeInfoResponseNo
external_retrieval_modelDatasetExternalRetrievalModelResponseYes
icon_infoDatasetIconInfoResponseNo
idstringYes
indexing_techniquestringYes
is_multimodalbooleanYes
is_publishedbooleanYes
maintainerstringNo
namestringYes
partial_member_list[ string ]No
permissionstringYes
permission_keys[ string ]No
pipeline_idstringYes
providerstringYes
retrieval_model_dictDatasetRetrievalModelResponseYes
runtime_modestringYes
summary_index_settingDatasetSummaryIndexSettingResponseNo
tags[ DatasetTagResponse ]Yes
total_available_documentsintegerYes
total_documentsintegerYes
updated_atintegerYes
updated_bystringYes
word_countintegerYes

DatasetDocMetadataResponse

NameTypeDescriptionRequired
idstringYes
namestringYes
typestringYes

DatasetExternalKnowledgeInfoResponse

NameTypeDescriptionRequired
external_knowledge_api_endpointstringNo
external_knowledge_api_idstringNo
external_knowledge_api_namestringNo
external_knowledge_idstringNo

DatasetExternalRetrievalModelResponse

NameTypeDescriptionRequired
score_thresholdnumberNo
score_threshold_enabledbooleanNo
top_kintegerYes

DatasetIconInfoResponse

NameTypeDescriptionRequired
iconstringNo
icon_backgroundstringNo
icon_typestringNo
icon_urlstringNo

DatasetKeywordSettingResponse

NameTypeDescriptionRequired
keyword_weightnumberNo

DatasetListQuery

NameTypeDescriptionRequired
include_allbooleanWhether to include all knowledge bases regardless of permissions.No
keywordstringSearch keyword to filter by name.No
limitinteger,
Default: 20Number of items per page. Server caps at 100.No
pageinteger,
Default: 1Page number to retrieve.No
tag_ids[ string ]Tag IDs to filter by.No

DatasetListResponse

NameTypeDescriptionRequired
data[ DatasetDetailResponse ]Yes
has_morebooleanYes
limitintegerYes
pageintegerYes
totalintegerYes

DatasetMetadataActionResponse

NameTypeDescriptionRequired
resultstringYes

DatasetMetadataBuiltInFieldResponse

NameTypeDescriptionRequired
namestringYes
typestringYes

DatasetMetadataBuiltInFieldsResponse

NameTypeDescriptionRequired
fields[ DatasetMetadataBuiltInFieldResponse ]Yes

DatasetMetadataListItemResponse

NameTypeDescriptionRequired
countintegerNo
idstringYes
namestringYes
typestringYes

DatasetMetadataListResponse

NameTypeDescriptionRequired
built_in_field_enabledbooleanYes
doc_metadata[ DatasetMetadataListItemResponse ]Yes

DatasetMetadataResponse

NameTypeDescriptionRequired
idstringYes
namestringYes
typestringYes

DatasetRerankingModelResponse

NameTypeDescriptionRequired
reranking_model_namestringNo
reranking_provider_namestringNo

DatasetRetrievalModelResponse

NameTypeDescriptionRequired
reranking_enablebooleanYes
reranking_modestringNo
reranking_modelDatasetRerankingModelResponseNo
score_thresholdnumberNo
score_threshold_enabledbooleanYes
search_methodstringYes
top_kintegerYes
weightsDatasetWeightedScoreResponseNo

DatasetSummaryIndexSettingResponse

NameTypeDescriptionRequired
enablebooleanNo
model_namestringNo
model_provider_namestringNo
summary_promptstringNo

DatasetTagResponse

NameTypeDescriptionRequired
idstringYes
namestringYes
typestringYes

DatasetUpdatePayload

NameTypeDescriptionRequired
descriptionstringDescription of the knowledge base.No
embedding_modelstringEmbedding model name. Use the model field from Get Available Models with model_type=text-embedding.No
embedding_model_providerstringEmbedding model provider. Use the provider field from Get Available Models with model_type=text-embedding.No
external_knowledge_api_idstringID of the external knowledge API.No
external_knowledge_idstringID of the external knowledge base.No
external_retrieval_modelobjectRetrieval settings for external knowledge bases.No
indexing_techniquestringhigh_quality uses embedding models for precise search; economy uses keyword-based indexing.No
namestringName of the knowledge base.No
partial_member_list[ object ]List of team members with access when permission is partial_members.No
permissionPermissionEnumControls who can access this knowledge base. only_me restricts access to the creator, all_team_members grants workspace-wide access, and partial_members grants access to specified members.No
retrieval_modelRetrievalModelRetrieval model configuration. Controls how chunks are searched and ranked.No

DatasetVectorSettingResponse

NameTypeDescriptionRequired
embedding_model_namestringNo
embedding_provider_namestringNo
vector_weightnumberNo

DatasetWeightedScoreResponse

NameTypeDescriptionRequired
keyword_settingDatasetKeywordSettingResponseNo
vector_settingDatasetVectorSettingResponseNo
weight_typestringNo

DatasourceCredentialInfoResponse

NameTypeDescriptionRequired
idstringNo
is_defaultbooleanNo
namestringNo
typestringNo

DatasourceNodeRunPayload

NameTypeDescriptionRequired
credential_idstringDatasource credential ID. Uses the default if omitted.No
datasource_typestring,
Available values: "local_file", "online_document", "online_drive", "website_crawl"Type of the datasource.
Enum: "local_file", "online_document", "online_drive", "website_crawl"Yes
inputsobjectInput variables for the datasource node.Yes
is_publishedbooleanWhether to run the published or draft version of the node. true runs the published version, false runs the draft.Yes

DatasourcePluginListResponse

NameTypeDescriptionRequired
DatasourcePluginListResponsearray

DatasourcePluginResponse

NameTypeDescriptionRequired
credentials[ DatasourceCredentialInfoResponse ]No
datasource_typestringNo
node_idstringNo
plugin_idstringNo
provider_namestringNo
titlestringNo
user_input_variables[ object ]No

DatasourcePluginsQuery

NameTypeDescriptionRequired
is_publishedboolean,
Default: trueWhether to retrieve nodes from the published or draft pipeline. true returns nodes from the published version, false returns nodes from the draft.No

DocumentAndBatchResponse

NameTypeDescriptionRequired
batchstringYes
documentDocumentResponseYes

DocumentBatchDownloadZipPayload

Request payload for bulk downloading documents as a zip archive.

NameTypeDescriptionRequired
document_ids[ string (uuid) ]List of document IDs to include in the ZIP download.Yes

DocumentDetailResponse

NameTypeDescriptionRequired
archivedbooleanNo
average_segment_lengthinteger
numberNo
completed_atintegerNo
created_atintegerNo
created_bystringNo
created_fromstringNo
data_source_infoobjectNo
data_source_typestringNo
dataset_process_ruleobjectNo
dataset_process_rule_idstringNo
disabled_atintegerNo
disabled_bystringNo
display_statusstringNo
doc_formstringNo
doc_languagestringNo
doc_metadata[ DocumentMetadataResponse ]
objectNo
doc_typestringNo
document_process_ruleobjectNo
enabledbooleanNo
errorstringNo
hit_countintegerNo
idstringYes
indexing_latencynumberNo
indexing_statusstringNo
namestringNo
need_summarybooleanNo
positionintegerNo
segment_countintegerNo
summary_index_statusstringNo
tokensintegerNo
updated_atintegerNo

DocumentGetQuery

NameTypeDescriptionRequired
metadatastring,
Available values: "all", "only", "without",
Default: allall returns all fields including metadata. only returns only id, doc_type, and doc_metadata. without returns all fields except doc_metadata.
Enum: "all", "only", "without"No

DocumentListQuery

NameTypeDescriptionRequired
keywordstringSearch keyword to filter by document name.No
limitinteger,
Default: 20Number of items per page. Server caps at 100.No
pageinteger,
Default: 1Page number to retrieve.No
statusstringFilter by display status.No

DocumentListResponse

NameTypeDescriptionRequired
data[ DocumentResponse ]Yes
has_morebooleanYes
limitintegerYes
pageintegerYes
totalintegerYes

DocumentMetadataOperation

NameTypeDescriptionRequired
document_idstringDocument ID whose metadata should be updated.Yes
metadata_list[ MetadataDetail ]Metadata fields to update.Yes
partial_updatebooleanWhether to partially update metadata, keeping existing values for unspecified fields.No

DocumentMetadataResponse

NameTypeDescriptionRequired
idstringYes
namestringYes
typestringYes
valuestring
integer
number
booleanNo

DocumentResponse

NameTypeDescriptionRequired
archivedbooleanNo
created_atintegerNo
created_bystringNo
created_fromstringNo
data_source_detail_dictNo
data_source_infoNo
data_source_typestringNo
dataset_process_rule_idstringNo
disabled_atintegerNo
disabled_bystringNo
display_statusstringNo
doc_formstringNo
doc_metadata[ DocumentMetadataResponse ]No
enabledbooleanNo
errorstringNo
hit_countintegerNo
idstringYes
indexing_statusstringNo
namestringYes
need_summarybooleanNo
positionintegerNo
summary_index_statusstringNo
tokensintegerNo
word_countintegerNo

DocumentStatusListResponse

NameTypeDescriptionRequired
data[ DocumentStatusResponse ]Yes

DocumentStatusPayload

NameTypeDescriptionRequired
document_ids[ string ]List of document IDs to update.No

DocumentStatusResponse

NameTypeDescriptionRequired
cleaning_completed_atintegerYes
completed_atintegerYes
completed_segmentsintegerNo
errorstringYes
idstringYes
indexing_statusstringYes
parsing_completed_atintegerYes
paused_atintegerYes
processing_started_atintegerYes
splitting_completed_atintegerYes
stopped_atintegerYes
total_segmentsintegerNo

DocumentTextCreatePayload

NameTypeDescriptionRequired
doc_formstring,
Available values: "hierarchical_model", "qa_model", "text_model",
Default: text_modeltext_model for standard text chunking, hierarchical_model for parent-child chunk structure, qa_model for question-answer pair extraction.
Enum: "hierarchical_model", "qa_model", "text_model"No
doc_languagestring,
Default: EnglishLanguage of the document for processing optimization.No
embedding_modelstringEmbedding model name. Use the model field from Get Available Models with model_type=text-embedding.No
embedding_model_providerstringEmbedding model provider. Use the provider field from Get Available Models with model_type=text-embedding.No
indexing_techniquestringhigh_quality uses embedding models for precise search; economy uses keyword-based indexing. Required when adding the first document to a knowledge base; subsequent documents inherit the knowledge base's indexing technique if omitted.No
namestringDocument name.Yes
original_document_idstringOriginal document ID for replacement.No
process_ruleProcessRuleProcessing rules for chunking.No
retrieval_modelRetrievalModelRetrieval model configuration. Controls how chunks are searched and ranked.No
textstringDocument text content.Yes

DocumentTextUpdate

NameTypeDescriptionRequired
doc_formstring,
Available values: "hierarchical_model", "qa_model", "text_model",
Default: text_modeltext_model for standard text chunking, hierarchical_model for parent-child chunk structure, qa_model for question-answer pair extraction.
Enum: "hierarchical_model", "qa_model", "text_model"No
doc_languagestring,
Default: EnglishLanguage of the document for processing optimization.No
namestringDocument name. Required when text is provided.No
process_ruleProcessRuleProcessing rules for chunking.No
retrieval_modelRetrievalModelRetrieval model configuration. Controls how chunks are searched and ranked.No
textstringDocument text content.No

EndUserDetail

Full EndUser record for API responses.

Note: The SQLAlchemy model defines an is_anonymous property for Flask-Login semantics (always False). The database column is exposed as _is_anonymous, so this DTO maps is_anonymous from _is_anonymous to return the stored value.

NameTypeDescriptionRequired
app_idstringNo
created_atdateTimeYes
external_user_idstringNo
idstringYes
is_anonymousbooleanYes
namestringNo
session_idstringYes
tenant_idstringYes
typestringYes
updated_atdateTimeYes

EventStreamResponse

NameTypeDescriptionRequired
EventStreamResponsestring

ExecutionContentType

NameTypeDescriptionRequired
ExecutionContentTypestring

FeedbackListQuery

NameTypeDescriptionRequired
limitinteger,
Default: 20Number of records per page.No
pageinteger,
Default: 1Page number for pagination.No

FetchFrom

Enum class for fetch from.

NameTypeDescriptionRequired
FetchFromstringEnum class for fetch from.

FileInputConfig

NameTypeDescriptionRequired
allowed_file_extensions[ string ]No
allowed_file_types[ FileType ]No
allowed_file_upload_methods[ FileTransferMethod ]No
output_variable_namestringYes
typestringNo

FileListInputConfig

NameTypeDescriptionRequired
allowed_file_extensions[ string ]No
allowed_file_types[ FileType ]No
allowed_file_upload_methods[ FileTransferMethod ]No
number_limitsintegerNo
output_variable_namestringYes
typestringNo

FilePreviewQuery

NameTypeDescriptionRequired
as_attachmentbooleanIf true, forces the file to download as an attachment instead of previewing in browser.No

FileResponse

NameTypeDescriptionRequired
conversation_idstringNo
created_atintegerNo
created_bystringNo
extensionstringNo
file_keystringNo
idstringYes
mime_typestringNo
namestringYes
original_urlstringNo
preview_urlstringNo
referencestringNo
sizeintegerYes
source_urlstringNo
tenant_idstringNo
user_idstringNo

FileTransferMethod

NameTypeDescriptionRequired
FileTransferMethodstring

FileType

NameTypeDescriptionRequired
FileTypestring

FormInputConfig

NameTypeDescriptionRequired
FormInputConfigParagraphInputConfig
SelectInputConfig
FileInputConfig
FileListInputConfig

GeneratedAppResponse

NameTypeDescriptionRequired
GeneratedAppResponse

HitTestingChildChunk

NameTypeDescriptionRequired
contentstringYes
idstringYes
positionintegerYes
scorenumberYes

HitTestingDocument

NameTypeDescriptionRequired
data_source_typestringYes
doc_metadataYes
doc_typestringYes
idstringYes
namestringYes

HitTestingFile

NameTypeDescriptionRequired
extensionstringYes
idstringYes
mime_typestringYes
namestringYes
sizeintegerYes
source_urlstringYes

HitTestingPayload

NameTypeDescriptionRequired
attachment_ids[ string ]List of attachment IDs to include in the retrieval context.No
external_retrieval_modelobjectRetrieval settings for external knowledge bases.No
querystringSearch query text.Yes
retrieval_modelRetrievalModelRetrieval model configuration. Controls how chunks are searched and ranked.No

HitTestingQuery

NameTypeDescriptionRequired
contentstringYes

HitTestingRecord

NameTypeDescriptionRequired
child_chunks[ HitTestingChildChunk ]Yes
files[ HitTestingFile ]Yes
scorenumberYes
segmentHitTestingSegmentYes
summarystringYes
tsne_positionYes

HitTestingResponse

NameTypeDescriptionRequired
queryHitTestingQueryYes
records[ HitTestingRecord ]Yes

HitTestingSegment

NameTypeDescriptionRequired
answerstringYes
completed_atintegerYes
contentstringYes
created_atintegerYes
created_bystringYes
disabled_atintegerYes
disabled_bystringYes
documentHitTestingDocumentYes
document_idstringYes
enabledbooleanYes
errorstringYes
hit_countintegerYes
idstringYes
index_node_hashstringYes
index_node_idstringYes
indexing_atintegerYes
keywords[ string ]Yes
positionintegerYes
sign_contentstringYes
statusstringYes
stopped_atintegerYes
tokensintegerYes
word_countintegerYes

HumanInputContent

NameTypeDescriptionRequired
form_definitionHumanInputFormDefinitionNo
form_submission_dataHumanInputFormSubmissionDataNo
submittedbooleanYes
typeExecutionContentTypeNo
workflow_run_idstringYes

HumanInputFormDefinition

NameTypeDescriptionRequired
actions[ UserActionConfig ]No
display_in_uibooleanNo
expiration_timeintegerYes
form_contentstringYes
form_idstringYes
form_tokenstringNo
inputs[ FormInputConfig ]No
node_idstringYes
node_titlestringYes
resolved_default_valuesobjectNo

HumanInputFormDefinitionResponse

NameTypeDescriptionRequired
expiration_timeintegerNo
form_contentstringYes
inputs[ object ]No
resolved_default_valuesobjectYes
user_actions[ object ]No

HumanInputFormSubmissionData

NameTypeDescriptionRequired
action_idstringYes
action_textstringYes
node_idstringYes
node_titlestringYes
rendered_contentstringYes
submitted_dataobjectNo

HumanInputFormSubmitPayload

NameTypeDescriptionRequired
actionstringID of the action button the recipient selected. Must match one of the id values from the form's user_actions list.Yes
inputsobjectSubmitted human input values keyed by output variable name. Use a string for paragraph or select input values, a file mapping for file inputs, and a list of file mappings for file-list inputs. Local file mappings use transfer_method=local_file with upload_file_id; remote file mappings use transfer_method=remote_url with url or remote_url.Yes

HumanInputFormSubmitPayloadWithUser

NameTypeDescriptionRequired
actionstringID of the action button the recipient selected. Must match one of the id values from the form's user_actions list.Yes
inputsobjectSubmitted human input values keyed by output variable name. Use a string for paragraph or select input values, a file mapping for file inputs, and a list of file mappings for file-list inputs. Local file mappings use transfer_method=local_file with upload_file_id; remote file mappings use transfer_method=remote_url with url or remote_url.Yes
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.Yes

HumanInputFormSubmitResponse

NameTypeDescriptionRequired

I18nObject

Model class for i18n object.

NameTypeDescriptionRequired
en_USstringYes
zh_HansstringNo

IndexInfoResponse

NameTypeDescriptionRequired
api_versionstringYes
server_versionstringYes
welcomestringYes

JSONObject

NameTypeDescriptionRequired
JSONObjectobject

JSONValue

NameTypeDescriptionRequired
JSONValuestring
integer
number
boolean
object
[ object ]

JSONValueType

NameTypeDescriptionRequired
JSONValueType

JsonValue

NameTypeDescriptionRequired
JsonValue

KnowledgeTagListResponse

NameTypeDescriptionRequired
KnowledgeTagListResponsearray

KnowledgeTagResponse

NameTypeDescriptionRequired
binding_countstringNo
idstringYes
namestringYes
typestringYes

MessageFeedbackPayload

NameTypeDescriptionRequired
contentstringOptional text feedback providing additional detail.No
ratingstringFeedback rating. Set to null to revoke previously submitted feedback.No

MessageFeedbackPayloadWithUser

NameTypeDescriptionRequired
contentstringOptional text feedback providing additional detail.No
ratingstringFeedback rating. Set to null to revoke previously submitted feedback.No
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.Yes

MessageFile

NameTypeDescriptionRequired
belongs_tostringNo
filenamestringYes
idstringYes
mime_typestringNo
sizeintegerNo
transfer_methodstringYes
typestringYes
upload_file_idstringNo
urlstringNo

MessageInfiniteScrollPagination

NameTypeDescriptionRequired
data[ MessageListItem ]Yes
has_morebooleanYes
limitintegerYes

MessageListItem

NameTypeDescriptionRequired
agent_thoughts[ AgentThought ]Yes
answerstringYes
answer_tokensintegerNo
conversation_idstringYes
created_atintegerNo
currencystringNo
errorstringNo
extra_contents[ HumanInputContent ]Yes
feedbackSimpleFeedbackNo
idstringYes
inputsobjectYes
message_files[ MessageFile ]Yes
message_tokensintegerNo
parent_message_idstringNo
provider_response_latencynumberNo
querystringYes
retriever_resources[ RetrieverResource ]Yes
statusstringYes
total_pricestringNo
total_tokensintegerYes

MessageListQuery

NameTypeDescriptionRequired
conversation_idstringConversation ID.Yes
first_idstringThe ID of the first chat record on the current page. Omit this value to fetch the latest messages; for subsequent pages, use the first message ID from the current list to fetch older messages.No
limitinteger,
Default: 20Number of chat history messages to return per request.No

MetadataArgs

NameTypeDescriptionRequired
namestringMetadata field name.Yes
typestring,
Available values: "number", "string", "time"string for text values, number for numeric values, time for date/time values.
Enum: "number", "string", "time"Yes

MetadataDetail

NameTypeDescriptionRequired
idstringMetadata field ID.Yes
namestringMetadata field name.Yes
valuestring
integer
numberMetadata value. Can be a string, number, or null.No

MetadataFilteringCondition

Metadata Filtering Condition.

NameTypeDescriptionRequired
conditions[ Condition ]List of metadata conditions to evaluate.No
logical_operatorstringHow to combine multiple conditions.No

MetadataOperationData

Metadata operation data

NameTypeDescriptionRequired
operation_data[ DocumentMetadataOperation ]Array of document metadata update operations. Each entry maps a document ID to its metadata values.Yes

MetadataUpdatePayload

NameTypeDescriptionRequired
namestringNew metadata field name.Yes

ModelFeature

Enum class for llm feature.

NameTypeDescriptionRequired
ModelFeaturestringEnum class for llm feature.

ModelPropertyKey

Enum class for model property key.

NameTypeDescriptionRequired
ModelPropertyKeystringEnum class for model property key.

ModelStatus

Enum class for model status.

NameTypeDescriptionRequired
ModelStatusstringEnum class for model status.

ModelType

Enum class for model type.

NameTypeDescriptionRequired
ModelTypestringEnum class for model type.

OptionalServiceApiUserPayload

NameTypeDescriptionRequired
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.No

ParagraphInputConfig

Form input definition.

NameTypeDescriptionRequired
defaultStringSourceNo
output_variable_namestringYes
typestringNo

Parameters

NameTypeDescriptionRequired
annotation_replyJSONObjectYes
file_uploadJSONObjectYes
more_like_thisJSONObjectYes
opening_statementNo
retriever_resourceJSONObjectYes
sensitive_word_avoidanceJSONObjectYes
speech_to_textJSONObjectYes
suggested_questions[ string ]Yes
suggested_questions_after_answerJSONObjectYes
system_parametersSystemParametersYes
text_to_speechJSONObjectYes
user_input_form[ JSONObject ]Yes

PermissionEnum

Shared permission levels for resources (datasets, credentials, etc.)

NameTypeDescriptionRequired
PermissionEnumstringShared permission levels for resources (datasets, credentials, etc.)

PipelineRunApiEntity

NameTypeDescriptionRequired
datasource_info_list[ object
object
object
object ]List of datasource objects to process. The expected item structure depends on datasource_type.Yes
datasource_typestring,
Available values: "local_file", "online_document", "online_drive", "website_crawl"Type of the datasource. Determines which fields are expected in datasource_info_list items.
Enum: "local_file", "online_document", "online_drive", "website_crawl"Yes
inputsobjectKey-value pairs for pipeline input variables defined in the workflow. Pass {} if the pipeline has no input variables.Yes
is_publishedbooleanWhether to run the published or draft version of the pipeline. true runs the latest published version; false runs the current draft (useful for testing unpublished changes).Yes
response_modestring,
Available values: "blocking", "streaming"Response mode. Use streaming for SSE or blocking for JSON.
Enum: "blocking", "streaming"Yes
start_node_idstringID of the datasource node where the run starts.Yes

PipelineUploadFileResponse

NameTypeDescriptionRequired
created_atstringNo
created_bystringYes
extensionstringYes
idstringYes
mime_typestringNo
namestringYes
sizeintegerYes

PreProcessingRule

NameTypeDescriptionRequired
enabledbooleanWhether this preprocessing rule is enabled.Yes
idstring,
Available values: "remove_extra_spaces", "remove_stopwords", "remove_urls_emails"Rule identifier.
Enum: "remove_extra_spaces", "remove_stopwords", "remove_urls_emails"Yes

ProcessRule

NameTypeDescriptionRequired
modeProcessRuleModeProcessing mode. automatic uses built-in rules, custom allows manual configuration, and hierarchical enables parent-child chunk structure for doc_form: hierarchical_model.Yes
rulesRuleCustom processing rules.No

ProcessRuleMode

Dataset Process Rule Mode

NameTypeDescriptionRequired
ProcessRuleModestringDataset Process Rule Mode

ProviderModelWithStatusEntity

Model class for model response.

NameTypeDescriptionRequired
deprecatedbooleanNo
features[ ModelFeature ]No
fetch_fromFetchFromYes
has_invalid_load_balancing_configsbooleanNo
labelI18nObjectYes
load_balancing_enabledbooleanNo
modelstringYes
model_propertiesobjectYes
model_typeModelTypeYes
statusModelStatusYes

ProviderWithModelsListResponse

NameTypeDescriptionRequired
data[ ProviderWithModelsResponse ]Yes

ProviderWithModelsResponse

Model class for provider with models response.

NameTypeDescriptionRequired
icon_smallI18nObjectNo
icon_small_darkI18nObjectNo
labelI18nObjectYes
models[ ProviderModelWithStatusEntity ]Yes
providerstringYes
statusCustomConfigurationStatusYes
tenant_idstringYes

RequiredServiceApiUserPayload

NameTypeDescriptionRequired
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.Yes

RerankingModel

NameTypeDescriptionRequired
reranking_model_namestringName of the reranking model.No
reranking_provider_namestringProvider name of the reranking model.No

ResultResponse

NameTypeDescriptionRequired
resultstringYes

RetrievalMethod

NameTypeDescriptionRequired
RetrievalMethodstring

RetrievalModel

NameTypeDescriptionRequired
metadata_filtering_conditionsMetadataFilteringConditionRestrict retrieval to chunks whose document metadata matches the given conditions. Conditions are evaluated server-side against document metadata fields.No
reranking_enablebooleanWhether reranking is enabled.Yes
reranking_modestringReranking mode. Required when reranking_enable is true.No
reranking_modelRerankingModelReranking model configuration.No
score_thresholdnumberMinimum similarity score for results. Only effective when score threshold filtering is enabled.No
score_threshold_enabledbooleanWhether score threshold filtering is enabled.Yes
search_methodRetrievalMethodSearch method used for retrieval.Yes
top_kintegerMaximum number of results to return.Yes
weightsWeightModelWeight configuration for hybrid search.No

RetrieverResource

NameTypeDescriptionRequired
contentstringNo
created_atintegerNo
data_source_typestringNo
dataset_idstringNo
dataset_namestringNo
document_idstringNo
document_namestringNo
hit_countintegerNo
idstringNo
index_node_hashstringNo
message_idstringNo
positionintegerYes
scorenumberNo
segment_idstringNo
segment_positionintegerNo
summarystringNo
word_countintegerNo

Rule

NameTypeDescriptionRequired
parent_modestringParent-child segmentation mode.No
pre_processing_rules[ PreProcessingRule ]Pre-processing rules to apply before segmentation.No
segmentationSegmentationParent chunk segmentation settings.No
subchunk_segmentationSegmentationChild chunk segmentation settings.No

SegmentAttachmentResponse

NameTypeDescriptionRequired
extensionstringYes
idstringYes
mime_typestringYes
namestringYes
sizeintegerYes
source_urlstringYes

SegmentCreateItemPayload

NameTypeDescriptionRequired
answerstringAnswer content for QA mode.No
attachment_ids[ string ]Attachment file IDs.No
contentstringChunk text content.Yes
keywords[ string ]Keywords for the chunk.No

SegmentCreateListResponse

NameTypeDescriptionRequired
data[ SegmentResponse ]Yes
doc_formstringYes

SegmentCreatePayload

NameTypeDescriptionRequired
segments[ SegmentCreateItemPayload ]Array of chunk objects to create.Yes

SegmentDetailResponse

NameTypeDescriptionRequired
dataSegmentResponseYes
doc_formstringYes

SegmentListQuery

NameTypeDescriptionRequired
keywordstringSearch keyword.No
limitinteger,
Default: 20Number of items per page. Server caps at 100.No
pageinteger,
Default: 1Page number to retrieve.No
status[ string ]Filter chunks by indexing status, such as completed, indexing, or error.No

SegmentListResponse

NameTypeDescriptionRequired
data[ SegmentResponse ]Yes
doc_formstringYes
has_morebooleanYes
limitintegerYes
pageintegerYes
totalintegerYes

SegmentResponse

NameTypeDescriptionRequired
answerstringYes
attachments[ SegmentAttachmentResponse ]Yes
child_chunks[ ChildChunkResponse ]Yes
completed_atintegerYes
contentstringYes
created_atintegerYes
created_bystringYes
disabled_atintegerYes
disabled_bystringYes
document_idstringYes
enabledbooleanYes
errorstringYes
hit_countintegerYes
idstringYes
index_node_hashstringYes
index_node_idstringYes
indexing_atintegerYes
keywords[ string ]Yes
positionintegerYes
sign_contentstringYes
statusstringYes
stopped_atintegerYes
summarystringYes
tokensintegerYes
updated_atintegerYes
updated_bystringYes
word_countintegerYes

SegmentUpdateArgs

NameTypeDescriptionRequired
answerstringUpdated answer content for QA mode.No
attachment_ids[ string ]Attachment file IDs.No
contentstringUpdated chunk text content.No
enabledbooleanWhether the chunk is enabled.No
keywords[ string ]Updated keywords for the chunk.No
regenerate_child_chunksbooleanWhether to regenerate child chunks after updating a parent chunk.No
summarystringSummary content for summary index.No

SegmentUpdatePayload

NameTypeDescriptionRequired
segmentSegmentUpdateArgsChunk update payload.Yes

Segmentation

NameTypeDescriptionRequired
chunk_overlapintegerToken overlap between chunks.No
max_tokensintegerMaximum token count per chunk.Yes
separatorstring,
Default:
Custom separator for splitting text.No

SelectInputConfig

NameTypeDescriptionRequired
option_sourceStringListSourceYes
output_variable_namestringYes
typestringNo

SimpleAccountResponse

NameTypeDescriptionRequired
emailstringYes
idstringYes
namestringYes

SimpleConversation

NameTypeDescriptionRequired
created_atintegerNo
idstringYes
inputsobjectYes
introductionstringNo
namestringYes
statusstringYes
updated_atintegerNo

SimpleEndUser

NameTypeDescriptionRequired
idstringYes
is_anonymousbooleanYes
session_idstringNo
typestringYes

SimpleFeedback

NameTypeDescriptionRequired
ratingstringNo

SimpleResultResponse

NameTypeDescriptionRequired
resultstringYes

SimpleResultStringListResponse

NameTypeDescriptionRequired
data[ string ]Yes
resultstringYes

Site

NameTypeDescriptionRequired
chat_color_themestringNo
chat_color_theme_invertedbooleanYes
copyrightstringNo
custom_disclaimerstringNo
default_languagestringYes
descriptionstringNo
iconstringNo
icon_backgroundstringNo
icon_typestringNo
icon_urlstringYes
input_placeholderstringNo
privacy_policystringNo
show_workflow_stepsbooleanYes
titlestringYes
use_icon_as_answer_iconbooleanYes

StringListSource

NameTypeDescriptionRequired
selector[ string ]No
typeValueSourceTypeYes
value[ string ]No

StringSource

Default configuration for form inputs.

NameTypeDescriptionRequired
selector[ string ]No
typeValueSourceTypeYes
valuestringNo

SystemParameters

NameTypeDescriptionRequired
audio_file_size_limitintegerYes
file_size_limitintegerYes
image_file_size_limitintegerYes
video_file_size_limitintegerYes
workflow_file_upload_limitintegerYes

TagBindingPayload

NameTypeDescriptionRequired
tag_ids[ string ]Tag IDs to bind.Yes
target_idstringKnowledge base ID to bind the tags to.Yes

TagCreatePayload

NameTypeDescriptionRequired
namestringTag name.Yes

TagDeletePayload

NameTypeDescriptionRequired
tag_idstringTag ID to delete.Yes

TagUnbindingPayload

Accepts either the legacy tag_id payload or the normalized tag_ids payload.

NameTypeDescriptionRequired
TagUnbindingPayloadobject
objectAccepts either the legacy tag_id payload or the normalized tag_ids payload.

TagUpdatePayload

NameTypeDescriptionRequired
namestringTag name.Yes
tag_idstringTag ID to update.Yes

TextToAudioPayload

NameTypeDescriptionRequired
message_idstringMessage ID. Takes priority over text when both are provided.No
streamingbooleanReserved for compatibility; TTS response streaming is determined by the provider output.No
textstringSpeech content to convert.No
voicestringVoice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Omit to use the app's configured voice when available; that value is exposed by Get App Parameters as text_to_speech.voice.No

TextToAudioPayloadWithUser

NameTypeDescriptionRequired
message_idstringMessage ID. Takes priority over text when both are provided.No
streamingbooleanReserved for compatibility; TTS response streaming is determined by the provider output.No
textstringSpeech content to convert.No
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.No
voicestringVoice to use for text-to-speech. Available voices depend on the TTS provider configured for this app. Omit to use the app's configured voice when available; that value is exposed by Get App Parameters as text_to_speech.voice.No

UrlResponse

NameTypeDescriptionRequired
urlstringYes

UserActionConfig

User action configuration.

NameTypeDescriptionRequired
button_styleButtonStyleNo
idstringYes
titlestringYes

ValueSourceType

ValueSourceType records whether the value comes from a static setting in form definiton, or a variable while the workflow is running.

NameTypeDescriptionRequired
ValueSourceTypestringValueSourceType records whether the value comes from a static setting in form definiton, or a variable while the workflow is running.

WeightKeywordSetting

NameTypeDescriptionRequired
keyword_weightnumberWeight assigned to keyword search results.Yes

WeightModel

NameTypeDescriptionRequired
keyword_settingWeightKeywordSettingKeyword search weight settings.No
vector_settingWeightVectorSettingSemantic search weight settings.No
weight_typestringStrategy for balancing semantic and keyword search weights.No

WeightVectorSetting

NameTypeDescriptionRequired
embedding_model_namestringName of the embedding model used for vector search.Yes
embedding_provider_namestringProvider of the embedding model used for vector search.Yes
vector_weightnumberWeight assigned to semantic vector search results.Yes

WorkflowAppLogPaginationResponse

NameTypeDescriptionRequired
data[ WorkflowAppLogPartialResponse ]Yes
has_morebooleanYes
limitintegerYes
pageintegerYes
totalintegerYes

WorkflowAppLogPartialResponse

NameTypeDescriptionRequired
created_atintegerNo
created_by_accountSimpleAccountResponseNo
created_by_end_userSimpleEndUserNo
created_by_rolestringNo
created_fromstringNo
detailsobject
[ object ]
string
integer
number
booleanNo
idstringYes
workflow_runWorkflowRunForLogResponseNo

WorkflowEventsQuery

NameTypeDescriptionRequired
continue_on_pausebooleanSet to true to keep the stream open across multiple workflow_paused events, which is useful when the workflow has more than one Human Input node in sequence. By default, the stream closes after the first pause.No
include_state_snapshotbooleanWhen true, replay from the persisted state snapshot to include a status summary of already-executed nodes before streaming new events.No
userstringEnd-user identifier that originally triggered the run. Must match the creator of the run.Yes

WorkflowLogQuery

NameTypeDescriptionRequired
created_at__afterstringFilter logs created after this ISO 8601 timestamp.No
created_at__beforestringFilter logs created before this ISO 8601 timestamp.No
created_by_accountstringFilter by account ID.No
created_by_end_user_session_idstringFilter by end user session ID.No
keywordstringKeyword to search in logs.No
limitinteger,
Default: 20Number of items per page.No
pageinteger,
Default: 1Page number for pagination.No
statusstringFilter by execution status.No

WorkflowRunForLogResponse

NameTypeDescriptionRequired
created_atintegerNo
elapsed_timenumber
integerNo
errorstringNo
exceptions_countintegerNo
finished_atintegerNo
idstringYes
statusstringNo
total_stepsintegerNo
total_tokensintegerNo
triggered_fromstringNo
versionstringNo

WorkflowRunPayload

NameTypeDescriptionRequired
files[ object ]File list for workflow system file inputs. Available when file upload is enabled for the workflow. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.No
inputsobjectKey-value pairs for workflow input variables. Values for file-type variables should be arrays of file objects with type, transfer_method, and either url or upload_file_id. Refer to the user_input_form field in the Get App Parameters response to discover the variable names and types expected by your app.Yes
response_modestringResponse mode. Use blocking for synchronous responses or streaming for Server-Sent Events. When omitted, the request runs in blocking mode.No

WorkflowRunPayloadWithUser

NameTypeDescriptionRequired
files[ object ]File list for workflow system file inputs. Available when file upload is enabled for the workflow. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.No
inputsobjectKey-value pairs for workflow input variables. Values for file-type variables should be arrays of file objects with type, transfer_method, and either url or upload_file_id. Refer to the user_input_form field in the Get App Parameters response to discover the variable names and types expected by your app.Yes
response_modestringResponse mode. Use blocking for synchronous responses or streaming for Server-Sent Events. When omitted, the request runs in blocking mode.No
userstringUser identifier, unique within the application. This identifier scopes data access; resources created with one user value are only visible when queried with the same user value.Yes

WorkflowRunResponse

NameTypeDescriptionRequired
created_atintegerNo
elapsed_timenumber
integerNo
errorstringNo
finished_atintegerNo
idstringYes
inputsobject
[ object ]
string
integer
number
booleanNo
outputsobjectNo
statusstringYes
total_stepsintegerNo
total_tokensintegerNo
workflow_idstringYes