Skip to content

Delete an import

DELETE
/orgs/{org}/imports/{id}
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.

org
required

The org id the session was issued for. A token for one org can never read another.

string
Example
org_9f3c

The org id the session was issued for. A token for one org can never read another.

id
required

The import id.

string
Example
imp_4d1a

The import id.

version
required

The version the person deciding to delete it was looking at.

integer
>= 1

The version the person deciding to delete it was looking at.

Deleted, or being.

Media typeapplication/json
object
ok
required
boolean
erased
required
boolean
Example
{
"ok": true
}

The request — its body or its query — did not match the schema. issues carries the Zod issue list.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No such import, or it is not visible to this session.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

Report a problem with this page