APIOfficial documentation7 min readAPI

Create FastGPT Datasets via OpenAPI

Core Endpoint & Authentication This OpenAPI endpoint allows programmatic creation of FastGPT datasets and folder directories.

Core Endpoint & Authentication

This OpenAPI endpoint allows programmatic creation of FastGPT datasets and folder directories. The base request URL is http://localhost:3000/api/core/dataset/create. All requests must include two required headers: an Authorization: Bearer {{authorization}} header with a valid FastGPT API token, and a Content-Type: application/json header to specify JSON request bodies.

Request Parameters

The following table lists all supported request fields, with requirements and default behaviors pulled directly from the official FastGPT documentation:

ParameterTypeRequiredDescriptionDefault Behavior
parentIdstring / nullNoUnique ID of the parent folder for building a nested directory structureOmitted or set to null for a top-level item
typestringNoSpecifies item type: either dataset for a standard knowledge dataset or folder for a directory containerCreates a standard dataset if not provided
namestringYesHuman-readable name for the new dataset or folderNo default; this field must be supplied
introstringNoShort descriptive text for the itemEmpty string if not included
avatarstringNoPublicly accessible URL for the item's avatar imageEmpty string if not included
vectorModelstringNoVector embedding model used for text chunk indexingUses the FastGPT system default if omitted
agentModelstringNoLLM used for text processing and dataset operationsUses the FastGPT system default if omitted
vlmModelstringNoVision-language model used for image content understandingUses the FastGPT system default if omitted

Example Requests & Responses

A sample curl request for creating a top-level test dataset is shown below:

curl --location --request POST 'http://localhost:3000/api/core/dataset/create' \
--header 'Authorization: Bearer {{authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "parentId": null,
  "type": "dataset",
  "name":"test",
  "intro":"Sample dataset description",
  "avatar": "",
  "vectorModel": "text-embedding-ada-002",
  "agentModel": "gpt-3.5-turbo-16k",
  "vlmModel": "gpt-4.1"
}'

A successful API response returns a 200 status code, with the following JSON structure:

{
  "code": 200,
  "statusText": "",
  "message": "",
  "data": "65abc9bd9d1448617cba5e6c"
}

The data field contains the unique alphanumeric ID of the newly created dataset or folder, which can be used for subsequent API operations.

Source: FastGPT official source

Applicability and version scope

Use this page for the documented API scenario. Confirm the FastGPT, dependency, API, and deployment versions in the official source before applying a change.

Safety guardrails

Use [REDACTED_CREDENTIAL] for credentials and private data. Confirm the documented environment and version before review.

Rollback guidance

Restore the prior technical-content authority snapshot. Restore saved configuration and data snapshots, then repeat the smallest verification scenario.