Skip to content

Upload Dataset File

Upload a file to the dataset for a specific user or context scope.

Datasets can be scoped in two ways:

  • User-scoped: Files accessible only to a specific user (identified by userIdentifier)
  • Context-scoped: Files shared with all users matching a context value (e.g., all users in orgId=123)

POST /datasets/user/{userIdentifier}

Upload a file for a specific user.


userIdentifier string Required

The unique identifier for the end-user (1-256 characters).
Examples: user_123, john.doe@example.com



file binary Required

The file to upload (CSV or JSON, max 10MB). This endpoint accepts a single file per request using multipart/form-data.

notes string

Optional description or notes about the dataset.


Request
import Inconvo from "@inconvoai/node";
import fs from "fs";
const inconvo = new Inconvo({
apiKey: process.env.INCONVO_API_KEY
});
const result = await inconvo.datasets.user.upload({
userIdentifier: "user_123",
file: fs.createReadStream("./sales_report_q4.csv"),
notes: "Q4 2024 sales data"
});
console.log(result);
Response
{
"file": {
"name": "sales_report_q4.csv",
"path": "org_abc/agt_xyz/userIdentifier/user_123/sales_report_q4.csv",
"size": 2048576
}
}
curl -X POST "https://app.inconvo.ai/api/v1/datasets/user/user_123" \
-H "Authorization: Bearer $INCONVO_API_KEY" \
-F "file=@./sales_report_q4.csv" \
-F "notes=Q4 2024 sales data"
Response
{
"file": {
"name": "sales_report_q4.csv",
"path": "org_abc/agt_xyz/userIdentifier/user_123/sales_report_q4.csv",
"size": 2048576
}
}

POST /datasets/context/{contextKey}/{contextValue}

Upload a file shared with all users matching a context value.


contextKey string Required

The context key used for scoping (e.g., orgId, teamId). This should match a key defined in your userContext configuration.

contextValue string Required

The context value to match (e.g., org_456, team_789).



file binary Required

The file to upload (CSV or JSON, max 10MB). This endpoint accepts a single file per request using multipart/form-data.

notes string

Optional description or notes about the dataset.


Request
import Inconvo from "@inconvoai/node";
import fs from "fs";
const inconvo = new Inconvo({
apiKey: process.env.INCONVO_API_KEY
});
const result = await inconvo.datasets.context.upload({
contextKey: "orgId",
contextValue: "org_456",
file: fs.createReadStream("./shared_pricing.csv"),
notes: "Company-wide pricing sheet"
});
console.log(result);
Response
{
"file": {
"name": "shared_pricing.csv",
"path": "org_abc/agt_xyz/userContext/orgId:org_456/shared_pricing.csv",
"size": 1024000
}
}
curl -X POST "https://app.inconvo.ai/api/v1/datasets/context/orgId/org_456" \
-H "Authorization: Bearer $INCONVO_API_KEY" \
-F "file=@./shared_pricing.csv" \
-F "notes=Company-wide pricing sheet"
Response
{
"file": {
"name": "shared_pricing.csv",
"path": "org_abc/agt_xyz/userContext/orgId:org_456/shared_pricing.csv",
"size": 1024000
}
}