Delete an import
const url = 'https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a?version=1';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a?version=1' \ --header 'Authorization: Bearer <token>'The three ordered steps of the purge (design §8): the import is marked as being deleted under version — every write refuses it from then on, so an upload racing the delete cannot land after its files are gone — then its files and results are deleted, and only then its rows, its AI conversations among them. The answer is 202 and the import reads as gone at once; a file delete that failed is finished by the nightly cron. Refused while a run holds the import.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
The import id.
Example
imp_4d1aThe import id.
Query Parameters
Section titled “Query Parameters”The version the person deciding to delete it was looking at.
The version the person deciding to delete it was looking at.
Responses
Section titled “Responses”Deleted, or being.
object
Example
{ "ok": true}The request — its body or its query — did not match the schema. issues carries the Zod issue list.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}Your role cannot do this to somebody else’s import (code: NOT_YOURS): an operator changes, runs and deletes only their own; a builder deletes only their own.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such import, or it is not visible to this session.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}Somebody changed the import since this version was read (code: IMPORT_CHANGED, with the version it is at now and updatedBy), or a run holds it (code: IMPORT_RUNNING, with the runId).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}