---
title: "Install (or reinstall with a new token) the capacity agent; when the engine cannot, a command to run by hand is shown once"
method: POST
path: "/operator/servers/{serverId}/agent"
tags: ["Operator"]
---

# Install (or reinstall with a new token) the capacity agent; when the engine cannot, a command to run by hand is shown once

`POST /operator/servers/{serverId}/agent`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/operator/servers/{serverId}/agent`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `serverId` string, uuid, required

## Request body

- object
  - `reason` string, required

## Response `200`

Agent

- object
  - `serverId` string, uuid, required
  - `status` 'installed' | 'manual', required
  - `detail` string, nullable, required
  - `agentToken` string, nullable, required
  - `command` string, nullable, required
  - `reportUrl` string, nullable, required

## Other responses

- `400`: Invalid request (code invalid_request)
- `403`: A change on an operator-console session older than 5 minutes (details.reauthenticate), or not an operator
- `404`: Not found; also the answer to any request without a live operator-console session
- `409`: Conflict (already listed, not ready for customers, still in use, the main server)
- `429`: Too many requests (code rate_limited)
- `501`: Not available on this server (code not_configured)
- `503`: The hosting engine did not answer (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
