Skip to content

Keep a run’s claim on its import

POST
/orgs/{org}/imports/{id}/runs/{run}/heartbeat
curl --request POST \
--url https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a/runs/run_7c2e/heartbeat \
--header 'Authorization: Bearer <token>'

The client that authorised the run renews its claim every thirty seconds, on a two-minute lease — a dry run and a run paused on an error too, since neither writes. A lease that ran out is lost, not revived: the import may have been released and changed since, and the answer is 409 LEASE_LOST. Only the session or token that authorised the run may renew it.

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.

run
required

The run id, from POST /entitlements/runs/authorise.

string
Example
run_7c2e

The run id, from POST /entitlements/runs/authorise.

Renewed.

Media typeapplication/json
object
leaseExpiresAt
required

When the claim lapses now.

string
Examplegenerated
{
"leaseExpiresAt": "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"
}

Not the session or token that authorised this run (code: NOT_YOUR_RUN), or the role is too low.

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

The lease ran out and the import was released (code: LEASE_LOST).

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