---
title: "Place Link Agent into maintenance mode"
method: POST
path: "/link/agents/{id}/maintenance"
tags: ["LinkAgent"]
---

# Place Link Agent into maintenance mode

`POST /link/agents/{id}/maintenance`

Place a Link Agent into maintenance mode. mabl-side routing immediately stops treating the Agent as an active target — legacy Link Servers no longer dispatch new requests to it, and the Agent's mablnet Host begins draining its carriers (refusing new streams while continuing to service in-flight ones). The Agent's status moves to `draining` immediately and to `drained` once all in-flight connections have finished. If `drain_timeout_seconds` is supplied, the Agent stops waiting for natural drain after that interval and moves to `drained` regardless; without a timeout it waits indefinitely. The Agent does not auto-shutdown — the final shutdown is left to whatever external orchestrator initiated the maintenance window (use `POST .../terminate` to stop it, or `DELETE` this resource to return it to service). Idempotent; re-posting while still draining updates `drain_timeout_seconds`.

## Path parameters

- `id` string, required

## Request body

- LinkAgentMaintenanceRequest — Optional parameters for placing a Link Agent into maintenance mode.
  - `drain_timeout_seconds` integer — Maximum seconds the Agent should wait for in-flight connections to drain before signalling that it is safe to terminate. Omit to wait indefinitely.

## Response `204`

Maintenance-mode request acknowledged

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `404` — Link Agent not found
- `default` — Unknown error

---

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