Skip to content

Change an import

PATCH
/orgs/{org}/imports/{id}
curl --request PATCH \
--url https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "version": 1, "name": "example", "recipe": { "additionalProperty": "example" }, "currentStep": "example", "currentStage": "example", "draft": { "schemaVersion": 1 }, "completedSteps": [ "example" ], "enabledModules": [ "example" ], "connectorId": "example", "libraryPins": "example" }'

The recipe, name, step, stage, modules, connection or the draft’s account of itself, under version: the change and the bump land in one statement, or not at all. A change naming nothing is answered with the import as it stands and moves no version, so it can never refuse a colleague’s next write.

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.

Media typeapplication/json
object
version
required

The version this change was made against — from the last read or write.

integer
>= 1
name
string
>= 1 characters <= 200 characters
recipe

The import’s flows, value maps and run policy, in any schema version: migrated to the current one and validated before it is stored.

object
key
additional properties
currentStep
string | null
>= 1 characters <= 40 characters
currentStage
string | null
>= 1 characters <= 40 characters
draft

The draft’s account of itself — which parts it drafted, which it could not and why — with its schemaVersion; null forgets it. Kept with the guesses the draft lands, under the same version.

object
schemaVersion
required

The draft record’s own shape version.

integer
>= 1
key
additional properties
completedSteps
Array<string>
<= 20 items
enabledModules
Array<string>
<= 200 items
connectorId
string | null
>= 1 characters
libraryPins

The versions this import keeps instead of the current ones (#559): namespace → { version, library }, the library being its own id (libraryId in the resolved configuration), so a pin outlives no removal of the library. The whole set, replaced; {} or null keeps none. “Keep v3 for this import” is chosen when the current version breaks it, and its page names the choice.

object | null
Examplegenerated
{
"version": 1,
"name": "example",
"recipe": {
"additionalProperty": "example"
},
"currentStep": "example",
"currentStage": "example",
"draft": {
"schemaVersion": 1
},
"completedSteps": [
"example"
],
"enabledModules": [
"example"
],
"connectorId": "example",
"libraryPins": "example"
}

The import as it now stands.

Media typeapplication/json
object
import
required
object
id
required
string
orgId
required
string
connectorId
required

The connection Target names; null until one is chosen.

string | null
templateId
required

The template this import was started from or saved as.

string | null
templateVersion
required

The template version it copied: “the template has moved on” compares this.

integer | null
name
required
string
createdByUserId
required

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.

string | null
tokenId
required

The token held, when one was.

string | null
createdByScheduleId
required
string | null
status
required

Where it stands. An import being deleted is not returned at all: it reads as gone the moment its delete is accepted.

string
Allowed values: open running attention done
currentStep
required

Whichever step the wizard of the day left it on, as that wizard names it.

string | null
currentStage
required
string | null
completedSteps
required
Array<string>
enabledModules
required
Array<string>
version
required

The write precondition: every change names the version it was made against, and a stale one is refused 409 IMPORT_CHANGED.

integer
updatedByUserId
required
string | null
updatedByTokenId
required
string | null
updatedByScheduleId
required
string | null
runningRunId
required

The run that holds the import; every other write is refused while one does.

string | null
lastRunAt
required
string | null
createdAt
required
string
updatedAt
required
string
recipe
required

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.

object | null
migrated
required

Migration steps applied to the recipe on read.

Array<string>
unreadable
required
string | null
sources
required
Array<object>
object
id
required
string
position
required
integer
label
required
string
defaultLabel
required
string | null
origin
required

Where the rows came from: file, paste, generated, connection.

string
reader
required

Which reader read the bytes: delimited or xlsx.

string | null
connectorId
required
string | null
madeFrom
required
string | null
byteSize
required
integer | null
digest
required

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.

string | null
madeByAnswer
required

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
turnId
required
string
>= 1 characters <= 100 characters
index
required
integer
<= 499
reshape
required

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
steps
required
Array<object>
>= 1 items
object
op
required
string
>= 1 characters
marks
Array<object>
object
from
required
string
Allowed values: start end
at
required
integer
>= 1
shape
required

One letter a cell: b blank, n a number, t other text.

string
/^[bnt]*$/
text
required

Its text cells, digits taken out, case and spaces folded, joined by |.

string
key
additional properties
options
required

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.

object | null
sheetName
required

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.

string | null
columns
required
Array<string>
rowCount
required
integer
cleaningBytes
required

The size of the current cleaning revision; null when the source has none.

integer | null
workBytes
required

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.

integer | null
flowId
required

The recipe flow this source feeds, paired by id and never by label or position.

string | null
createdAt
required
string
draft
required

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.

object | null
libraryPins
required

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
key
additional properties
object
version
required
number
library
required
string
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.

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 connection, 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), a run holds it (code: IMPORT_RUNNING, with the runId), a source’s reader options were written by a newer build of Sloose than this one (code: FROM_FUTURE, which is refused before anything is written), 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.

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 draft record is larger than 256 KB of JSON (code: DRAFT_TOO_LARGE, with the limit in characters).

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 recipe is not valid for the current schema version (INVALID_RECIPE); or a version libraryPins names is not one the org holds — no such version of that library, or a library since removed (PIN_NOT_FOUND, the namespaces in missing).

Media typeapplication/json
Any of:
object
error
required
string
code
required
string
Allowed values: INVALID_RECIPE
issues
required
Array
key
additional properties
Example
{
"code": "INVALID_RECIPE"
}

Report a problem with this page