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)
User-Scoped Upload
Section titled “User-Scoped Upload”POST /agents/{agentId}/datasets/user/{userIdentifier}
Upload a file for a specific user.
Path Parameters
Section titled “Path Parameters”agentId string Required
The agent id
userIdentifier string Required
The unique identifier for the end-user (1-256 characters).
Examples: user_123, john.doe@example.com
Form Data Parameters
Section titled “Form Data Parameters”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.
import Inconvo from "@inconvoai/node";import fs from "fs";
const inconvo = new Inconvo({ apiKey: process.env.INCONVO_API_KEY});
const result = await inconvo.agents.datasets.user.upload( "user_123", { agentId: "agt_123", file: fs.createReadStream("./sales_report_q4.csv"), notes: "Q4 2024 sales data" });
console.log(result);{ "file": { "name": "sales_report_q4.csv", "path": "org_abc/agt_xyz/userIdentifier/user_123/sales_report_q4.csv", "size": 2048576 }}Context-Scoped Upload
Section titled “Context-Scoped Upload”POST /agents/{agentId}/datasets/context/{contextKey}/{contextValue}
Upload a file shared with all users matching a context value.
Path Parameters
Section titled “Path Parameters”agentId string Required
The agent id
contextKey string Required
The context key used for scoping (e.g., organisationId, teamId). This should match a key defined in your userContext configuration.
contextValue string | number Required
The context value to match (e.g., 1, org_456, team_789).
Form Data Parameters
Section titled “Form Data Parameters”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.
import Inconvo from "@inconvoai/node";import fs from "fs";
const inconvo = new Inconvo({ apiKey: process.env.INCONVO_API_KEY});
const result = await inconvo.agents.datasets.context.upload( 1, { agentId: "agt_123", contextKey: "organisationId", file: fs.createReadStream("./shared_pricing.csv"), note: "Company-wide pricing sheet" });
console.log(result);{ "file": { "name": "shared_pricing.csv", "path": "org_abc/agt_xyz/userContext/orgId:org_456/shared_pricing.csv", "size": 1024000 }}