# Hosts API reference

> The hosts you provide: enrollment tokens, listings, names, benchmarks, network and removal.

Source: https://legion.ambient.xyz/docs/api/hosts

- [List pending enrollment tokens](https://legion.ambient.xyz/docs/api/hosts/list-enrollment-tokens): `GET /v1/enrollment-tokens`. Lists the organization's enrollment tokens that are neither used, revoked nor expired.
- [Create a host enrollment token](https://legion.ambient.xyz/docs/api/hosts/create-enrollment-token): `POST /v1/enrollment-tokens`. Creates a single-use token the Legion agent uses to register one host to the caller's organization.
- [Revoke an enrollment token](https://legion.ambient.xyz/docs/api/hosts/revoke-enrollment-token): `DELETE /v1/enrollment-tokens/{enrollment_token_id}`. Revokes an unused enrollment token, so no host can register with it.
- [List the organization's hosts](https://legion.ambient.xyz/docs/api/hosts/list-hosts): `GET /v1/hosts`. Hosts removed by their provider, Legion or the timeout (state removed) are left out unless include_removed is true.
- [Get a host](https://legion.ambient.xyz/docs/api/hosts/get-host): `GET /v1/hosts/{host_id}`.
- [Remove a host](https://legion.ambient.xyz/docs/api/hosts/remove-host): `POST /v1/hosts/{host_id}/remove`. Removes the host: its state becomes removed with removed_reason provider, it leaves offers and the default host list, and its agent credentials are…
- [The organization's maintenance windows](https://legion.ambient.xyz/docs/api/hosts/list-maintenance-windows): `GET /v1/maintenance-windows`. .
- [Schedule maintenance on one or many hosts](https://legion.ambient.xyz/docs/api/hosts/schedule-maintenance): `POST /v1/maintenance-windows`. .
- [What scheduling maintenance would do](https://legion.ambient.xyz/docs/api/hosts/preview-maintenance): `GET /v1/maintenance-windows/preview`. .
- [Move or change scheduled maintenance windows](https://legion.ambient.xyz/docs/api/hosts/reschedule-maintenance): `POST /v1/maintenance-windows/reschedule`. .
- [Cancel scheduled maintenance windows](https://legion.ambient.xyz/docs/api/hosts/cancel-maintenance): `POST /v1/maintenance-windows/cancel`. .
- [End active maintenance windows now ("done with maintenance")](https://legion.ambient.xyz/docs/api/hosts/end-maintenance): `POST /v1/maintenance-windows/end`. .
- [Preview what is on a host before removing it](https://legion.ambient.xyz/docs/api/hosts/get-host-removal-preview): `GET /v1/hosts/{host_id}/removal-preview`. .
- [Rename a host](https://legion.ambient.xyz/docs/api/hosts/rename-host): `PUT /v1/hosts/{host_id}/name`. Gives the host a new friendly name.
- [Set a host's price and availability](https://legion.ambient.xyz/docs/api/hosts/update-listing): `PUT /v1/hosts/{host_id}/listing`. Sets the on-demand price per GPU-hour, the optional interruptible price and whether the host appears in offers.
- [A host's benchmark runs, newest first](https://legion.ambient.xyz/docs/api/hosts/list-host-benchmarks): `GET /v1/hosts/{host_id}/benchmarks`. The provider's history of its host's benchmarks: each run as Legion kept it, with what was verified and what was flagged.
- [Progress of a host's first benchmark](https://legion.ambient.xyz/docs/api/hosts/get-host-first-benchmark): `GET /v1/hosts/{host_id}/first-benchmark`. Where the host's first benchmark stands and, once it completed, how Legion judged it.
- [Ask your host to benchmark again](https://legion.ambient.xyz/docs/api/hosts/request-host-benchmark): `POST /v1/hosts/{host_id}/benchmark-request`. A host that serves a rental accepts the request too and runs the benchmarks once it is idle (never during a rental, which they would slow down); the…
- [Take your host off its start-failure pause](https://legion.ambient.xyz/docs/api/hosts/release-host-start-hold): `POST /v1/hosts/{host_id}/start-hold/release`. .
- [A host's GPU benchmark runs, newest first](https://legion.ambient.xyz/docs/api/hosts/list-host-gpu-benchmarks): `GET /v1/hosts/{host_id}/gpu-benchmarks`. The provider's history of its host's GPU benchmarks: each run as Legion kept it, with what was flagged.
- [A host's listing price history, newest first](https://legion.ambient.xyz/docs/api/hosts/list-host-listing-history): `GET /v1/hosts/{host_id}/listing-history`. Every change of the host's listing: when it was listed or unlisted, or its price changed, with the old and new price and who made the change (actor: a…
- [What Legion recommends the host charge per GPU-hour](https://legion.ambient.xyz/docs/api/hosts/get-host-price-recommendation): `GET /v1/hosts/{host_id}/price-recommendation`. The price advisor: a deterministic recommendation for the host's GPU class, for an on-demand price and for an interruptible one, each with a low to high…
- [A host's network state and the abuse flags raised on its rentals](https://legion.ambient.xyz/docs/api/hosts/get-host-network): `GET /v1/hosts/{host_id}/network`. Whether the host's agent applies network policies and how far it has got, for the provider's own host: the agent's version and capabilities…
- [Set the destinations blocked for rentals on a host](https://legion.ambient.xyz/docs/api/hosts/update-host-network): `PUT /v1/hosts/{host_id}/network`. Changes the fields given and leaves the others as they are.
