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 /agents/{agentId}/datasets/user/{userIdentifier}

Upload a file for a specific user.


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



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.agents.datasets.user.upload(
"user_123",
{
agentId: "agt_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/agents/agt_123/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 /agents/{agentId}/datasets/context/{contextKey}/{contextValue}

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


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).



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.agents.datasets.context.upload(
1,
{
agentId: "agt_123",
contextKey: "organisationId",
file: fs.createReadStream("./shared_pricing.csv"),
note: "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/agents/agt_123/datasets/context/organisationId/1" \
-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
}
}