# Send an agent heartbeat

Source: https://langbot.ai/docs/api/account/agent-heartbeat

`POST /v1/agent/heartbeat`

Tell the dashboard your local agent is running and which strategies it has. Nothing runs on the server.

**Auth.** An API token: `Authorization: Bearer lb_…` ([create one](https://langbot.ai/app/tokens)). Signed-in web sessions work too.

**Limits.** Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

## Parameters

### Body

| Name | Type | Required | Description |
|---|---|---|---|
| `agent_id` | string | no | A stable id for this agent. Default `default`. |
| `status` | string | no | `online`, or any short state. Default `online`. |
| `strategies` | array of object | no | The strategies it is running. |
| `meta` | object | no | Anything else to show on the dashboard (no secrets). |

## Request

**curl**

```bash
curl -X POST "https://api.langbot.ai/v1/agent/heartbeat" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"agent_id": "laptop", "status": "online", "strategies": ["MentionSniper"]}'
```

**Python**

```python
from langbot import LangbotClient

async with LangbotClient() as lb:  # reads LANGBOT_API_TOKEN
    await lb.agent_heartbeat({"agent_id": "laptop", "status": "online", "strategies": ["MentionSniper"]})
```

**TypeScript**

```ts
import { LangbotClient } from "@langbotai/sdk";

const lb = new LangbotClient(); // reads LANGBOT_API_TOKEN
await lb.agentHeartbeat({ agent_id: "laptop", status: "online", strategies: ["MentionSniper"] });
```

## Response

`200 OK`

```json
{ "ok": true, "ts": 1760050000000, "agent_id": "laptop" }
```

`langbot run` sends one every 30 s. The dashboard shows an agent as online for 90 s after its last heartbeat.

## Errors

| Status | `code` | When |
|---|---|---|
| 401 | `auth_required` | No token was sent. |
| 401 | `token_invalid` | The token was not recognised (mistyped, revoked or expired). |
| 422 | `validation_error` | A parameter failed validation; `detail[].loc` names it. |
| 429 | `rate_limited` | Over your request budget; wait `Retry-After` seconds. |

Every error body is `{"detail": …, "code": "…"}`; branch on `code`. All codes: [Errors](https://langbot.ai/docs/api#errors).
