Keep a run’s claim on its import
const url = 'https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a/runs/run_7c2e/heartbeat';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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/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.
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.
The import id.
Example
imp_4d1aThe import id.
The run id, from POST /entitlements/runs/authorise.
Example
run_7c2eThe run id, from POST /entitlements/runs/authorise.
Responses
Section titled “Responses”Renewed.
object
When the claim lapses now.
Examplegenerated
{ "leaseExpiresAt": "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"}Not the session or token that authorised this run (code: NOT_YOUR_RUN), or the role is too low.
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 import or run, 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 lease ran out and the import was released (code: LEASE_LOST).
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"}