Update an agent
Partially updates an agent using JSON Merge Patch semantics (RFC 7396):
- Omitted field — the stored value is left unchanged.
- Explicit null — clears the value. Only description accepts null (it is never null, so an explicit null maps to "").
- Any other value — replaces the stored value.
name has no meaningful "unset" state: an explicit null falls back to the stored value, same as omitting it — it can never be blanked.
slug changes only when you send it: renaming an agent never changes its slug on its own, and an explicit null is treated as omitted. A sent slug is trimmed and lowercased, must match the create path's rules, and must be unique in the project (409 names the colliding slug). Changing it has effects outside this agent: saved links, Terraform references and trace sources (service.name) that name the old slug stop matching this agent, unless a source also equals the agent's name (case-insensitive), which still matches.
Request
- Base URL: https://app.lastping.dev
- URL: https://app.lastping.dev/api/v1/agents/{id}
- Auth: API key in header X-Api-Key
Request body
Example request
{
"name": "Nightly ETL bot",
"description": "Runs the nightly ETL pipeline and owns its monitors.",
"slug": "nightly-etl-bot"
}Response
Updated agent.
Example response
{
"id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"slug": "nightly-etl-bot",
"name": "Nightly ETL bot",
"description": "Runs the nightly ETL pipeline and owns its monitors.",
"status": "up",
"monitor_count": 3,
"last_seen": "2026-07-10T03:00:05Z",
"spend_24h": {
"cost_usd": "0.006600",
"cost_source": "estimated",
"tokens_in": 150,
"tokens_out": 50,
"runs": 1
},
"runs_7d": [
{
"day": "2026-09-14",
"runs": 12
}
],
"usage_24h": {
"day": "2026-09-20",
"model": "claude-sonnet-4-5",
"provider": "anthropic",
"tokens_in": 182340,
"tokens_out": 20411,
"tokens_cache_read": 95012,
"tokens_cache_write": 4100,
"cost_usd": "0.853221",
"cost_source": "estimated",
"origin": "traces"
},
"top_dependencies": [
{
"kind": "database",
"name": "postgresql",
"direction": "out",
"calls": 1480,
"errors": 12,
"error_rate": 0.0081,
"p50_ms": 10,
"p95_ms": 25,
"series": [
{
"day": "2026-09-20",
"calls": 210,
"errors": 2
}
]
}
],
"created_at": "2026-07-01T12:00:00Z"
}Changes
No recorded changes to this operation across all 2 revisions of this API.