Skip to content

Authorise a run before writing anything

POST
/entitlements/runs/authorise
curl --request POST \
--url https://api.sloose.com/entitlements/runs/authorise \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "declaredRows": 1, "projectId": "example" }'

Checks the run against the plan and returns a run id to report progress against.

An authorised run always completes. Everything is checked here, once, rather than part-way through an import that has already written half its rows. A set bigger than the plan allows in one run is refused with LIMIT_ROWS_PER_RUN; an org that has used its import runs for the period is refused with LIMIT_RUNS. A run counts against the period at its first written row, so a dry run, a cancelled run or one that writes nothing costs nothing. Rows per month are bookkeeping for browser runs, never a refusal.

Media typeapplication/json
object
declaredRows

How many rows the run intends to write. Must be a non-negative number.

number | null
projectId

The project this run came from, when it came from a saved one. Ignored unless it names a project in this org.

string | null
key
additional properties
Examplegenerated
{
"declaredRows": 1,
"projectId": "example"
}

Authorised. Allowance is reserved.

Media typeapplication/json
object
ok
required
boolean
runId
required

Report progress against this id.

string
key
additional properties
Example
{
"ok": true
}

declaredRows is missing, negative or not a number.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "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"
}

Refused. code says why — the set is too big for one run, the period’s runs are used, or the org is suspended.

Media typeapplication/json
object
ok
required
boolean
code
required

Why an action was refused. A closed set: the widget switches on it.

string
Allowed values: LIMIT_ROWS LIMIT_RUNS LIMIT_ROWS_PER_RUN LIMIT_CONNECTORS LIMIT_MODULES LIMIT_SCHEDULES LIMIT_CRM_USERS LIMIT_SANDBOX FEATURE_SHARED_PROJECTS FEATURE_HELPER_LIBRARIES FEATURE_SERVER_RUN FEATURE_MCP FEATURE_ROLLBACK FEATURE_SCHEDULED_IMPORTS CREDITS_EXHAUSTED STATUS_SUSPENDED STATUS_PAST_DUE
allowanceRemaining
number
runsRemaining
number | null
rowsPerRun

With LIMIT_ROWS_PER_RUN: the most rows one run may declare.

number
key
additional properties
Example
{
"ok": false,
"code": "LIMIT_ROWS"
}