Skip to main content
POST
/
v1
/
workers
/
{id}
/
activity-heartbeat
Record worker heartbeat
curl --request POST \
  --url https://api.openworklabs.com/v1/workers/{id}/activity-heartbeat \
  --header 'Content-Type: application/json' \
  --data '
{
  "isActiveRecently": true,
  "sentAt": "2023-11-07T05:31:56Z",
  "lastActivityAt": "2023-11-07T05:31:56Z",
  "openSessionCount": 4503599627370495
}
'
{
  "ok": true,
  "workerId": "<string>",
  "isActiveRecently": true,
  "openSessionCount": 0,
  "lastHeartbeatAt": "2023-11-07T05:31:56Z",
  "lastActiveAt": "2023-11-07T05:31:56Z"
}

Path Parameters

id
string<typeid>
required

Den TypeID with 'wrk_' prefix and a 26-character base32 suffix.

Required string length: 30
Pattern: ^wrk_.*

Body

application/json
isActiveRecently
boolean
required
sentAt
string<date-time>
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
lastActivityAt
string<date-time> | null
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
openSessionCount
integer
Required range: 0 <= x <= 9007199254740991

Response

Worker heartbeat accepted successfully.

ok
boolean
required
workerId
string
required
isActiveRecently
boolean
required
openSessionCount
integer | null
required
Required range: -9007199254740991 <= x <= 9007199254740991
lastHeartbeatAt
string<date-time>
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
lastActiveAt
string<date-time> | null
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$