---
title: "Set the action at the threshold"
method: PUT
path: "/servers/{id}/threshold-action"
tags: ["Servers"]
---

# Set the action at the threshold

`PUT /servers/{id}/threshold-action`

## Request

- Base URL: `https://gpucloud.ca/api`
- URL: `https://gpucloud.ca/api/servers/{id}/threshold-action`
- Auth: HTTP bearer

What happens to this hourly server when the balance reaches its threshold and no automatic reload brings it back: HIBERNATE or DELETE. A machine that cannot be hibernated (spot) only accepts DELETE (422 HIBERNATION_NOT_SUPPORTED with the reason). A prepaid server has no threshold (409 NOT_HOURLY).

## Path parameters

- `id` string, required

## Request body

- object
  - `onFundsExhausted` 'HIBERNATE' | 'DELETE', required

## Response `200`

The effective action and the threshold

- object
  - `serverId` string
  - `onFundsExhausted` 'HIBERNATE' | 'DELETE'
  - `hibernationThresholdCad` number

## Other responses

- `400`: Invalid request
- `401`: No API key (accountAction.code NO_API_KEY) or an invalid, expired, revoked or read only key on a write (INVALID_API_KEY). Provide a valid API key as `Authorization: Bearer <key>`; accountAction gives the links to create an account and a key.
- `404`: Resource not found
- `409`: Prepaid server: no threshold
- `422`: This machine cannot be hibernated: DELETE only
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/gpucloud/apis/gpu-cloud-api.md) · [All operations](https://skmtc.dev/gpucloud/apis/gpu-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gpucloud/apis/gpu-cloud-api/revisions/ed530411f5c7?raw)
