Skip to main content

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

nametypelocationrequireddescription
typestringqueryoptionalfilters results by dataset type. Comma-delimited for multiple types. One of "doc", "audio", "video", "image". Only doc is supported for beta.
offsetnumberqueryoptionaloffset to return results from.
limitnumberqueryoptionallimit the number of returned results. Max 100.
sortstringqueryoptionaldetermines which properties to sort the results. comma-delimited for multiple properties. prefix with - for descending. eg. -createdAt for descending by created date.
expiresInSecondsnumberqueryoptionalSets the expiry duration for dataset asset share links in seconds. eg. 60 is a duration of 1 minute. Default duration is 10 minutes.

Response

{
"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 }
}
}
}
}
}
}
}

Example

curl https://api.subworkfow.ai/v1/datasets?offset=0&limit=10
--header '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
]
}