---
title: "Mark an agent or runtime offline on shutdown"
method: POST
path: "/close"
tags: ["Core"]
---

# Mark an agent or runtime offline on shutdown

`POST /close`

Retires the calling process. Workers may send `X-Runtime-Instance-ID`, the per-boot identifier of the calling process. It is ignored unless MULTI_RUNTIME_ENABLED is set. With multi-runtime mode on, the header is required and only that runtime is retired; the agent goes offline once no live runtime remains. With the flag off, the agent is marked offline as before.

## Headers

- `X-Runtime-Instance-ID` string — Identifies the concrete runtime instance (worker process) making the call, as generated at its boot. Required to retire a runtime when multi-runtime mode (MULTI_RUNTIME_ENABLED) is on; ignored otherwise.

## Response `204`

Runtime (and agent, when last) marked offline

## Other responses

- `400` — Missing X-Agent-ID, or missing X-Runtime-Instance-ID in multi-runtime mode
- `404` — Agent not found

---

[API](https://skmtc.net/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.net/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/58c398ac0d1b/schema)
