Skip to main content
POST
Add (low level): ingest files, text or URLs into a dataset without building the graph

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
data
file[]
raw_data
string[] | null

Data given as strings instead of uploads, one entry each: raw text to ingest, a local file or directory path on the server's filesystem (requires ACCEPT_LOCAL_FILE_PATH), a web URL to fetch (requires ALLOW_HTTP_REQUESTS), or a GitHub/GitLab repository URL, which is shallow-cloned and indexed as a code graph by cognify. Combined with 'data': uploads come first, then these entries; labels and external_metadata pair with that combined order. Empty entries are ignored.

Example:
labels
string | null

Per-item labels, e.g. ["finance", "people", ""] — the Nth label applies to the Nth data item (uploads first, then raw_data entries), one entry per item, an empty entry skips that item. The comma-separated form "finance,people," is accepted equivalently (it is what Swagger UI sends when you type a JSON array here), so labels cannot contain commas unless the client sends real JSON. Stored on each item's data record and returned when listing dataset data.

Example:

""

external_metadata
string | null

JSON array of per-file metadata objects, e.g. [{"source": "crm", "ticket": 42}, null]. Paired positionally like labels: the Nth entry applies to the Nth uploaded file (null or {} skips that file), and one entry per file is required when any is given. Merged into the file's stored external_metadata (your keys win over loader-derived ones; 'node_set' is reserved) and returned when listing dataset data.

Example:

""

datasetName
string | null

Name of the target dataset (created if it does not exist). Required unless datasetId is provided.

Example:

"default_dataset"

datasetId

Providing dataset ID is mandatory for sharing a dataset between users. Datasets provided by name will only be resolvable by dataset owner.

Example:

""

node_set
string[] | null
run_in_background
boolean | null
default:false

Response

Successful Response

status
string
required
pipeline_run_id
string<uuid>
required
dataset_id
string<uuid>
required
dataset_name
string
required
data_ids
string<uuid>[] | null
required

Ids of the Data rows this run processed, in result order.

For add() this is the id of every item that was stored (or already existed with the same content — dedup returns the existing row), so a caller can key later update() / delete_data() / find_data calls on cognee's own ids instead of re-deriving them. Items that errored are left out. None for run infos that carry no per-item results (PipelineRunStarted, progress ticks, the run infos nested in data_ingestion_info), which serialize without the key. Serialized with the model, so POST /api/v1/add responses carry it too.

payload
unknown
data_ingestion_info
any[] | null