Start an import
const url = 'https://api.sloose.com/orgs/org_9f3c/imports';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","templateId":"example","connectorId":"example","enabledModules":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sloose.com/orgs/org_9f3c/imports \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "templateId": "example", "connectorId": "example", "enabledModules": [ "example" ] }'Any member may start one; it is theirs (§7). From a template, the template’s recipe, modules and version are copied, with its connection when it names one this person may use that can still write. Every import lands on Target: a blank one to choose where it writes, one from a template to be checked against its connection and files (slice 6 of the draft-and-refine plan).
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.
Request Body
Section titled “Request Body”object
What it is called; a template’s name, or “Untitled import”, when absent.
Start from this template: its recipe, modules and version are copied — and its connection, when it names one this person may use that is still connected. The import lands on Target, where the template is checked against the connection and each file as it arrives.
The connection to import into: somebody’s choice, or the page’s pre-selection — the org’s only connection, or the CRM around the tab. Absent: the template’s, when it names one this person may use; otherwise none, and one is chosen on Target before anything can run.
Examplegenerated
{ "name": "example", "templateId": "example", "connectorId": "example", "enabledModules": [ "example" ]}Responses
Section titled “Responses”Started.
object
object
The connection Target names; null until one is chosen.
The template this import was started from or saved as.
The template version it copied: “the template has moved on” compares this.
Who started it — the person, or the person a token acts as. Null only for an import a schedule started, which is nobody’s own.
The token held, when one was.
Where it stands. An import being deleted is not returned at all: it reads as gone the moment its delete is accepted.
Whichever step the wizard of the day left it on, as that wizard names it.
The write precondition: every change names the version it was made against, and a stale one is refused 409 IMPORT_CHANGED.
The run that holds the import; every other write is refused while one does.
The import’s own flows, value maps and run policy, migrated to the current schema version on read. Null until the wizard writes one, or when it could not be migrated.
Migration steps applied to the recipe on read.
object
Where the rows came from: file, paste, generated, connection.
Which reader read the bytes: delimited or xlsx.
The SHA-256 of the file stored for the source, hex: the identity of its bytes, which changes with every new file and never with a new reading of the same one. With how they are read (reader, options, sheetName), what says an AI answer that proposed a change to the file (a reshape, a sample, a re-read) was not taken: the same bytes, read the same way, are still the file it was proposed for. Null for a file stored before it was kept; the sheets of one workbook share their workbook’s.
Which kept answer made this file — { turnId, index }, the turn and the reshape, sample or re-read in its targets — or null: what says such an answer was used, on the server and in the app alike, where the file’s shape cannot. Written with every file stored for the source and every new reading of it, from the upload’s madeByAnswer, and null for any other.
object
How this file was reshaped from the file as read at its header row (#1363): the steps in order, each counted on the grid the ones before it left, every row a step named by its place marked so another file’s can be found by it. Written with every file stored for the source and every new reading of it, from the upload’s reshape, and null for any other.
object
object
object
One letter a cell: b blank, n a number, t other text.
Its text cells, digits taken out, case and spaces folded, joined by |.
What the reader needs to read the file again: delimiter, sheet, header row — in the shape this build reads, whatever shape they were stored in. They are stored with the version of that shape and walked forward when read; that version is not shown.
The worksheet’s name, for a source read from one; null for text. The reader finds the sheet by its place (options.sheet); a template names it by this, because a name survives next month’s workbook having its tabs reordered.
The size of the current cleaning revision; null when the source has none.
The size of the current revision of its work — the guesses waiting on it, the ones turned down, how each used one was found; null when the source has none.
The recipe flow this source feeds, paired by id and never by label or position.
The draft’s account of itself — which parts it drafted, which it could not and why — as the wizard wrote it, with its schemaVersion; null when no draft has been made.
The versions this import keeps instead of the current ones (#559): namespace → { version, library }. Empty when it keeps none. A pin whose library is no longer the one current under its name keeps nothing — the library was removed since — and the page says so.
object
object
Example
{ "import": { "status": "open", "sources": [ { "reshape": { "steps": [ { "marks": [ { "from": "start" } ] } ] } } ] }}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"}The bearer’s role is too low, it was issued for a different org, or the org has been closed (code: ORG_CLOSED) — asked in the insert itself, so a request already let in when the org closed starts nothing.
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 template or connection, 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"}The template was saved by a newer build than this server (code: FROM_FUTURE), or the connection it names cannot write — disconnected, holding no credential, its grant refused by the CRM since, or granted before connecting asked for records (code: NOT_CONNECTED): reconnect it on its page, or choose another.
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"}The template’s stored recipe is not usable under the current schema (code: INVALID_TEMPLATE, with its issues), or could not be read at all (code: UNREADABLE). Nothing was started.
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"}