Skip to main content

POST v1/Datasets/:Id/Vectorize

POST
https://api.subworkflow.ai/v1/datasets/:id/vectorize

Trigger the vectorize task for a dataset

Summary

  • Returns a jobs response to track the progress of the task.
  • Only works if no successful vectorize task has been recorded for the target dataset.
  • Enables the search functionality. ie. v1/search

Parameters

There are no parameters for this endpoint.

Response

Once the file is uploaded successfully, you'll receive a jobs response which displays the details of the job tracking the extract request. Take note of the following properties:

  • id - you can use this with the v1/jobs/:id to get an updated version of the job
  • datasetId - this is the dataset record created for the upload file. You'll need this to fetch the dataset and dataset items when the job is finished.
  • status - this is the progress of the job. "SUCCESS" and "ERROR" are the finished states you should check for.
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"total": { "type": "number" },
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"datasetId": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["datasets/extract","datasets/vectorize"]
},
"status": {
"type": "string",
"enum": ["NOT_STARTED","IN_PROGRESS","SUCCESS","ERROR"]
},
"statusText": {
"type": "string"
},
"startedAt": {
"type": "number"
},
"finishedAt": {
"type": "number"
},
"canceledAt": {
"type": "number"
},
"createdAt": {
"type": "number"
},
"updatedAt": {
"type": "number"
}
}
}
}
}

Example

curl -X POST https://api.subworkfow.ai/v1/datasets/ds_ar7e4PtGX7fGGnSt/vectorize
--header 'x-api-key: <YOUR-API-KEY>'
// note: you can poll https://api.subworkflow.ai/v1/jobs/<jobId> for updates
{
"success": true,
"total": 1,
"data": {
"id": "dsj_5fwR7qoMXracJQaf",
"datasetId": "ds_ar7e4PtGX7fGGnSt",
"type": "datasets/vectorize",
"status": "IN_PROGRESS",
"statusText": null,
"startedAt": null,
"finishedAt": null,
"canceledAt": null,
"createdAt": 1761910647113,
"updatedAt": 1761910647113
}
}