Record Heartbeat
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.
Record a heartbeat for a work item to maintain the lease.
Parameters
Returns
Record Heartbeat
WorkHeartbeatParams parameters = new()
{
EnvironmentID = "env_011CZkZ9X2dpNyB7HsEFoRfW",
WorkID = "work_id",
};
var betaSelfHostedWorkHeartbeatResponse = await client.Beta.Environments.Work.Heartbeat(parameters);
Console.WriteLine(betaSelfHostedWorkHeartbeatResponse);Response 200
{
"last_heartbeat": "last_heartbeat",
"lease_extended": true,
"state": "queued",
"ttl_seconds": 0,
"type": "work_heartbeat"
}Returns Examples
Response 200
{
"last_heartbeat": "last_heartbeat",
"lease_extended": true,
"state": "queued",
"ttl_seconds": 0,
"type": "work_heartbeat"
}