GET v1/Datasets
GET
https://api.subworkflow.ai/v1/datasets
Get a list of datasets in your workspace
Summary
Call this endpoint to get a list of all datasets in your workspace.
Parameters
| name | type | location | required | description |
|---|---|---|---|---|
| type | string | query | optional | filters results by dataset type. Comma-delimited for multiple types. One of "doc", "audio", "video", "image". Only doc is supported for beta. |
| offset | number | query | optional | offset to return results from. |
| limit | number | query | optional | limit the number of returned results. Max 100. |
| sort | string | query | optional | determines which properties to sort the results. comma-delimited for multiple properties. prefix with - for descending. eg. -createdAt for descending by created date. |
| expiresInSeconds | number | query | optional | Sets the expiry duration for dataset asset share links in seconds. eg. 60 is a duration of 1 minute. Default duration is 10 minutes. |
Response
- Success
- 400 Error
- 404 Error
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"total": { "type": "number" },
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"workspaceId": {
"type": "string"
},
"type":{
"type": "string",
"enum": ["doc", "audio", "video", "image"]
},
"fileName": {
"type": "string"
},
"fileExt": {
"type": "string"
},
"fileSize": {
"type": "number",
},
"itemCount": {
"type": "number"
},
"mimeType":{
"type": "string"
},
"createdAt": {
"type": "number"
},
"updatedAt": {
"type": "number",
"nullable": true
},
"expiresAt": {
"type": "number",
"nullable": true
},
"share": {
"type": "object",
"propeties": {
"url": { "type": "string" },
"token": { "type": "string" },
"expiresAt": { "type": "number", "nullable": true }
}
}
}
}
}
}
}
{
"success": { "type": "boolean" },
"error": { "type": "string" }
}
{
"success": { "type": "boolean" },
"error": { "type": "string" }
}
Example
- Curl
- JS/TS
curl https://api.subworkfow.ai/v1/datasets?offset=0&limit=10
--header 'x-api-key: <YOUR-API-KEY>'
const req = await fetch("https://api.subworkflow.ai/v1/datasets?offset=0&limit=10", {
method: "GET",
headers: { "x-api-key": "<YOUR-API-KEY>" }
});
{
"success": true,
"total": 2,
"data": [
{
"id": "ds_ar7e4PtGX7fGGnSt",
"workspaceId": "wks_Gg9Bzi7sx8fbCfWI",
"type": "doc",
"fileName": "my_document",
"fileExt": "pdf",
"fileSize": 777678,
"itemCount": 44,
"mimeType": "application/pdf",
"createdAt": 1761933149632,
"updatedAt": 1761933149632,
"expiresAt": 1762019549632,
"share": {
"url": "https://api.subworkflow.ai/v1/share/dsx_iCAA1uoowAFi9rcu?token=OFWb98",
"token": "OFWb98",
"expiresAt": 1762009529330
}
},
// ...shortened for brevity
]
}