# prov.mandate.grants.heartbeat

prov.mandate.grants.heartbeat in Node SDK. Check in to keep a standing mandate alive (the dead-man switch).

## Signature

```ts
prov.mandate.grants.heartbeat(mandateId: string, params: { biometricAssertion: { authenticatorData: string; clientDataJSON: string; signature: string } }): Promise<{ grantId: string; status: string; event: "checkin" | "reactivate"; lastCheckinAt: string; nextCheckinDue: string }>
```

## Parameters

- `mandateId` (string)
- `params` ({ biometricAssertion: { authenticatorData: string; clientDataJSON: string; signature: string } })

## Returns

`Promise<{ grantId: string; status: string; event: "checkin" | "reactivate"; lastCheckinAt: string; nextCheckinDue: string }>`

## HTTP operation

[`POST /v1/mandate/grants/{id}/heartbeat`](https://provenanceauth.com/docs/api/grants.md#post-v1-mandate-grants-id-heartbeat): Check in a mandate heartbeat

## Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`grant_invalid`](https://provenanceauth.com/docs/platform/errors.md#grant_invalid)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)

## Example

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/grt_01M5QFJRZCB3FZ2V3J76K9JSFX/heartbeat`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "biometric_assertion": {
      "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
      "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
      "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
  }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/mandate/grants/grt_01M5QFJRZCB3FZ2V3J76K9JSFX/heartbeat", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
    "biometric_assertion": {
        "authenticator_data": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABQ",
        "client_data_json": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0In0",
        "signature": "MEUCIQDx5n0q4sSPVd3a2Wbl0L8kQ0YwGg"
    }
}).json()
```
