---
title: "更新Agent心跳"
method: POST
path: "/api/v1/monitor/agent/heartbeat"
tags: ["监控"]
---

# 更新Agent心跳

`POST /api/v1/monitor/agent/heartbeat`

Agent主动上报心跳信息，通过IP自动识别主机

## Request body

- ModelAgentHeartbeatDto
  - `hostname` string — Agent所在主机的hostname
  - `ip` string — Agent所在主机的IP地址 (内网IP)
  - `pid` integer — Agent进程ID
  - `port` integer — Agent监听端口
  - `token` string — 认证token

## Response `200`

OK

- ResultResult
  - `code` integer — 状态码
  - `data` unknown
  - `message` string — 提示信息

---

[API](https://skmtc.net/opsre/apis/devops.md) · [All operations](https://skmtc.net/opsre/apis/devops/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opsre/devops/revisions/25cac8835c4c/schema)
