Skip to content

An import’s AI conversations

GET
/orgs/{org}/imports/{id}/conversations
curl --request GET \
--url 'https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a/conversations?source=source-1&place=%5B%22source%22%2C%22source-1%22%5D&keptAfter=0199a3c4-5e6f-7a8b-9c0d-1e2f3a4b5c6d&limit=50' \
--header 'Authorization: Bearer <token>'

Every question asked about this import’s work with the AI, newest asked first, a page at a time. That means questions at a file’s Source; at a module’s Which rows & existing, its rule or its Map columns; at a field’s row; at Translate values or one value; in the formula editor; and Explain’s — on one kind of failure on a run, kept by its file, module, kind, code and field and never its run, so the same failure on the next run carries it on; on one of Validate’s problems; and Validate’s own. Each turn says where it was asked (place), what was asked and answered, what the answer proposed and where (targets — of an Explain’s fixes, those a person can take as a guess: a fixed value or a field to leave out is said in the answer and kept as no target, since those are set by hand), what of the file it was made from (samples), who asked (askedBy, null once the person is deleted) and how (askedVia: a person in the app, an org API token or an agent over MCP), and whether the next question at its place may send it to the model again (replayed). source keeps one file’s turns — Translate values’ are the whole import’s, per module, and so are Validate’s and Run’s own, never a file’s — and place keeps one place’s.

Any member reads them, as any member reads the import: the questions asked about an import are its history, not the asker’s. What became of what an answer proposed is not stored with it.

A turn is kept for the plan’s history window from when its question was asked. A turn about a file goes with the file when it is removed; every turn goes with the import when it is deleted or expires — Translate values’, Validate’s own and Run’s own with the import alone, since they are about no file. The order is when each question was asked, and a turn is written when its answer arrives, so one answered while somebody pages can land above their cursor. The next page does not show it; the list read again does, and so does keptAfter, which asks for the turns kept since a turn whatever their order. A turn this build cannot read whole — a place, a route, a target or a sample setting a newer build of Sloose added — is left out, so a page can hold fewer than limit while nextCursor says there are more.

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.

source

Only the turns about this file of the import: its source id.

string
Example
source-1

Only the turns about this file of the import: its source id.

place

Only the turns at this place, named by its key: the JSON array of its parts, its kind first and then its file where it has one (placeKey in @sloose/schemas). A place about a field of a module is ["field","source-1","contacts","Last_Name"]; Translate values’ name the module and no file, as ["vals","accounts"]; a failure on a run is ["failed","source-1","contacts","refused","INVALID_DATA","Email"] (an empty part for no module, code or field), one of Validate’s problems ["issue","source-1","blank_required","contacts","Last_Name"], and Validate’s and Run’s own ["checks"] and ["run"]. A key that names no place is refused.

string
Example
["source","source-1"]

Only the turns at this place, named by its key: the JSON array of its parts, its kind first and then its file where it has one (placeKey in @sloose/schemas). A place about a field of a module is ["field","source-1","contacts","Last_Name"]; Translate values’ name the module and no file, as ["vals","accounts"]; a failure on a run is ["failed","source-1","contacts","refused","INVALID_DATA","Email"] (an empty part for no module, code or field), one of Validate’s problems ["issue","source-1","blank_required","contacts","Last_Name"], and Validate’s and Run’s own ["checks"] and ["run"]. A key that names no place is refused.

keptAfter

Only the turns kept after the turn with this id. A turn’s id is made as the turn is written, and ids sort in the order they were made, so give the newest id you have read to be given every turn kept since — one asked before your last read and answered after it included, which sorts below what you read by when it was asked. The turns come in the list’s own order, a page at a time. Ids made in the same instant on two servers can sort either way, and a turn is written a moment after its id is made, so ask from somewhat before your newest and drop what you hold.

string
Example
0199a3c4-5e6f-7a8b-9c0d-1e2f3a4b5c6d

Only the turns kept after the turn with this id. A turn’s id is made as the turn is written, and ids sort in the order they were made, so give the newest id you have read to be given every turn kept since — one asked before your last read and answered after it included, which sorts below what you read by when it was asked. The turns come in the list’s own order, a page at a time. Ids made in the same instant on two servers can sort either way, and a turn is written a moment after its id is made, so ask from somewhat before your newest and drop what you hold.

limit

How many to return, at most 200; 50 when absent. Anything but a whole number above zero — 0, negative, a fraction, not a number — is the default, never an error.

string
Example
50

How many to return, at most 200; 50 when absent. Anything but a whole number above zero — 0, negative, a fraction, not a number — is the default, never an error.

cursor

The nextCursor of the page before this one; absent for the first page. Opaque: it names a place in the list’s (askedAt, id) order, and a malformed one is 400 INVALID_CURSOR.

string

The nextCursor of the page before this one; absent for the first page. Opaque: it names a place in the list’s (askedAt, id) order, and a malformed one is 400 INVALID_CURSOR.

A page of the turns, newest asked first.

Media typeapplication/json
object
turns
required
Array<object>
object
id
required
string
place
required
One of:
object
kind
required
string
Allowed values: source
source
required
string
/^[A-Za-z0-9_-]{1,64}$/
seq
required

Its position in the conversation at its place, from 0.

integer
route
required

The AI route that answered it.

string
Allowed values: source chat auto-map match value-map formula explain
question
required
string
answer
required
string
targets
required

What the answer proposed, and where.

Array
<= 500 items
One of:
object
kind
required
string
Allowed values: filter
where
required
object
source
required
string
/^[A-Za-z0-9_-]{1,64}$/
what
required
string
was
required
string | null
notes
required

What the answer said that is not the answer: a caveat, what the server refused.

Array<string>
samples
required

What of the file the answer was made from: its values (allow); the distinct values of list fields, a picklist’s or a multi-select’s, as Translate values sends them under Masked (values); their shapes (masked); or none of it (none) — counting the earlier turns it was sent with, since an answer can repeat what one of them said.

string
Allowed values: allow values masked none
askedAt
required

When the question was asked, which the history window counts from.

string
askedBy
required

Who asked: a person, or the person whose API token asked. Null once they are deleted.

object
userId
required
string
name
required
string
askedVia
required

How the question was asked: a person’s session in the app (session), an org API token (api_token), or an agent over MCP (mcp).

string
Allowed values: session api_token mcp
replayed
required

Whether the next question at its place may send it to the model again. False for a turn before where replay starts, which a stricter AI data setting moves past everything already asked; only the newest 6 are ever sent.

boolean
draft

Whether a draft asked it — Draft everything, Fill the gaps or Draft it anyway (draftScope): one call of the draft answers several parts, and each part’s share of the answer is kept at that part’s own place, as a turn saying so, so a later question there — and Go there — finds it (D6). A draft’s turn is sent with no earlier turns, and lands after whatever its place holds without moving where replay starts.

boolean
draftId

Which draft asked it — Draft everything, Fill the gaps or Draft it anyway: the same for every part’s turn of one draft, so the import’s AI activity lists the draft as one entry. Null for a turn no draft asked, and for a draft’s turn kept before drafts said so, which is an entry of its own.

string | null
draftScope

How much of the import the draft that asked it was asked about: import, Draft everything; gaps, Fill the gaps, the parts a template’s check left open and no other; anyway, Draft it anyway, one file and module a draft found the file does not feed. Null for a turn no draft asked, and for a draft’s turn kept before drafts said, which reads as the whole import.

string | null
Allowed values: import gaps anyway
nextCursor
required

Pass as cursor for the next page; null when this was the last.

string | null
Example
{
"turns": [
{
"place": {
"kind": "source"
},
"route": "source",
"targets": [
{
"kind": "filter"
}
],
"samples": "allow",
"askedVia": "session",
"draft": false,
"draftId": null,
"draftScope": "import"
}
]
}

place names no place this server knows (code: INVALID_PLACE), or cursor is malformed (code: INVALID_CURSOR).

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

The bearer’s role is too low, or it was issued for a different org.

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

Report a problem with this page