Body
This is the source body object
-
The name of the source
-
The collections to which this source belongs to
-
The file to be uploaded
POST /sources/upload
curl \
-X POST https://api.hansei.app/public/v1/sources/upload \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: multipart/form-data" \
-F 'value={"name":"Employee Handbook","collections":["col_X1p7UscyehUFc6O4","col_HIjpFiRemkbpHgUn"],"file":"\u003cFileBuffer\u003e"}'
Request example
{
"value": {
"name": "Employee Handbook",
"collections": [
"col_X1p7UscyehUFc6O4",
"col_HIjpFiRemkbpHgUn"
],
"file": "<FileBuffer>"
}
}
Request examples
{
"name": "string",
"collections": [
"string"
],
"file": "@file"
}
Response examples (200)
{
"value": {
"id": "src_4uPeOYWyQ01C8Epg",
"name": "Employee Onboarding",
"collections": [
{
"id": "col_X1p7UscyehUFc6O4",
"name": "Employee Onboarding"
},
{
"id": "col_HIjpFiRemkbpHgUn",
"name": "Customer Support"
},
"{...}",
"{...}"
],
"status": "pending",
"created_at": 1697386660315
}
}
Response examples (200)
{
"id": "src_4uPeOYWyQ01C8Epg",
"name": "Employee Onboarding",
"collections": [
{
"id": "col_X1p7UscyehUFc6O4",
"name": "Employee Onboarding"
}
],
"status": "pending",
"created_at": 1697386660315
}
Response examples (400)
{
"code": "string",
"message": "string"
}
Response examples (400)
{
"code": "string",
"message": "string"
}
Response examples (402)
{
"code": "string",
"message": "string"
}
Response examples (402)
{
"code": "string",
"message": "string"
}