Skip to content

A template’s run history

GET
/orgs/{org}/templates/{id}/runs
curl --request GET \
--url 'https://api.sloose.com/orgs/org_9f3c/templates/b3f1c8a2/runs?limit=50' \
--header 'Authorization: Bearer <token>'

The runs of this template, newest first, a page at a time: limit is the page size and cursor the nextCursor of the page before, in the same (createdAt, id) order as the org’s whole history.

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 template id.

string
Example
b3f1c8a2

The template id.

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 (createdAt, 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 (createdAt, id) order, and a malformed one is 400 INVALID_CURSOR.

A page of its runs, newest first.

Media typeapplication/json
object
runs
required
Array<object>

One import run. Retired nightly past the plan’s history window.

object
id
required
string
orgId
required
string
connectorId
required

The connection this run wrote to: its import’s, or the one the authorising request named — a run always names one, for a token as much as for a person (design §14.8). Null only on a run recorded before connections were named.

string | null
templateId
required
string | null
importId
required

The import this run ran; null for a run recorded before imports were stored.

string | null
kind
required

dry writes nothing and is free. retry is a retry charged as a FREE one: it runs the rows a run before it did not finish, and counts no second run. A retry charged as a new run is real, like any run of its own.

string
Allowed values: real dry retry
freeRetriesLeft
required

How many free retries in a row are left below this run: the chain’s three (a run of its own, which heads a chain once the period counts it, keeps all three) less the free link this run is. A retry of it is free only while this is above 0, and only if the run ended as the client said, with failed rows, and has had no free retry already. 0 too when the history cannot walk the run’s chain to its top — the purge took a run above it — which the meter reads as not free; the meter keeps every link, and may still charge such a retry as free.

integer
retryOfRunId
required

The run this one was charged as a FREE retry of (kind retry). Null for any other run — a retry charged as a new run included, whose inheritance says what it stands on (GET …/runs/{run}/inherited) — and once the history’s purge has taken the run it named.

string | null
templateVersion
required

The template version the import had copied when this ran.

integer | null
importVersion
required

The import’s version when the run took it: what the run ran is what that version said.

integer | null
userId
required
string | null
mode
required
string
Allowed values: widget server
dryRun
required
boolean
status
required

authorised is the server opening the run; running, complete, cancelled and error are the client saying how it went. over_limit is the SERVER stopping one that reported past the rows allowed in a single import — the error field then carries which limit and what it was, because the status on its own tells nobody. refused and abandoned belong to an import’s run: the ledger refusing one whose claim was already taken (the claim is released at once), and the server closing one whose client stopped renewing its lease.

string
Allowed values: authorised running complete cancelled error over_limit refused abandoned
retryable
required

Whether a retry may follow this run (retryOf on authorise): it has ended, however it ended, it was no dry run, and the history’s purge has not begun to take it (purgeStartedAt) — whatever it wrote. A retry of it inherits what its chain made. Whether that retry is FREE — no second run counted — is narrower, and the ledger’s: only of a run that ended complete, error or cancelled with failed rows and had no free retry before, and no more than three free retries in a row below a run the period counted. Any other retry is still allowed, and charged as a new run: of a run with no failed rows, one retried free already, one that is already the third free retry in a row, a run of its own that sent no row, or one stopped at its row limit (over_limit) or abandoned.

boolean
purgeStartedAt
required

When the nightly purge began to remove this run, past its plan’s history_days; null until then. Its records go before its row — and its row stays when they would not all delete — so from then on what it made cannot be read in full, and a retry of it is refused (409 RUN_RETIRED).

string | null
declaredRows
required
number
rowsWritten
required
number
rowsCreated
required
number
rowsUpdated
required
number
rowsFailed
required
number
modules
required
Array<string> | null
error
required
string | null
summary
required
object | null
startedAt
required
string | null
finishedAt
required
string | null
createdAt
required
string
userName
required

Who ran it, joined from the user row rather than left as an id — a person who has since left the org is in no member list the caller could look them up in. An API token acts as its creator, so this is filled in for a token’s run too: read tokenId/tokenName before attributing a run to a person.

string | null
userEmail
required
string | null
tokenId
required

The org API token that authorised it, or null for a person. Set from the session, so a run made with a token is distinguishable from one the same person made in the browser.

string | null
tokenName
required

What that token is called, joined from the token row. Survives revocation, because revoking keeps the row.

string | null
connectorLabel
required

What the destination is called here, joined from the connector row. Null exactly when connectorId is — see the three causes there, only two of which are historical.

string | null
nextCursor
required

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

string | null
Example
{
"runs": [
{
"kind": "real",
"mode": "widget",
"status": "authorised"
}
]
}

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 template, 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