Skip to main content
POST
/
api
/
v1
/
data-sources
/
batch
Create multiple data sources
curl --request POST \
  --url https://api.getdecisional.ai/api/v1/data-sources/batch \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'files[][0]=<file1 binary>' \
  --form 'files[][1]=<file2 binary>' \
  --form 'data=[{"name":"Doc 1","type":"file","knowledge_engine_id":"kng_abc123xyz789"},{"name":"Doc 2","type":"file","knowledge_engine_id":"kng_abc123xyz789"}]' \
  --form files[].items='@example-file'
[
  {
    "name": "<string>",
    "success": true,
    "error": "<string>",
    "data_source": {
      "id": "ds_abc123xyz789",
      "name": "Annual Report 2023",
      "type": "file",
      "status": "processed",
      "notes": {
        "category": "financial"
      },
      "knowledge_engine_id": "kng_abc123xyz789",
      "created_at": 1679644800
    }
  }
]

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

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

Data sources accepted for processing

name
string

Name of the data source

success
boolean

Data source creation status

error
string

Error message if the data source was not created successfully

data_source
object