POST
/
api
/
v1
/
data-sources
/
batch
curl --request POST \
  --url https://api.getdecisional.ai/api/v1/data-sources/batch \
  --header 'Content-Type: multipart/form-data' \
  --form 'files[]=[
  "<file1 binary>",
  "<file2 binary>"
]' \
  --form 'data=[{"name":"Doc 1","type":"file","knowledge_engine_id":"kng_abc123xyz789"},{"name":"Doc 2","type":"file","knowledge_engine_id":"kng_abc123xyz789"}]'
[
  {
    "id": "ds_abc123xyz789",
    "name": "Annual Report 2023",
    "type": "file",
    "status": "processed",
    "notes": {
      "category": "financial"
    },
    "knowledge_engine_id": "kng_abc123xyz789",
    "created_at": 1679644800
  }
]

Body

multipart/form-data
files[]
file[]
required

Array of files to upload

data
string
required

JSON string containing an array of data sources metadata.

Example:

[{"name":"Doc 1","type":"file","knowledge_engine_id":"kng_abc123xyz789"},{"name":"Doc 2","type":"file","knowledge_engine_id":"kng_abc123xyz789"}]
Example:

"[{\"name\":\"Doc 1\",\"type\":\"file\",\"knowledge_engine_id\":\"kng_abc123xyz789\"},{\"name\":\"Doc 2\",\"type\":\"file\",\"knowledge_engine_id\":\"kng_abc123xyz789\"}]"

Response

202
application/json
Data sources accepted for processing
id
string

Unique identifier for the data source

Example:

"ds_abc123xyz789"

name
string

Name of the data source

Example:

"Annual Report 2023"

type
enum<string>

Type of the data source

Available options:
file,
ticket
Example:

"file"

status
enum<string>

Current status of the data source

Available options:
processing,
processed
Example:

"processed"

notes
object

Custom attributes and fields

Example:
{ "category": "financial" }
knowledge_engine_id
string

ID of the knowledge engine this data source belongs to

Example:

"kng_abc123xyz789"

created_at
integer

Unix timestamp when this entity was created

Example:

1679644800