---
title: "Renew contract"
method: POST
path: "/bus/contract/{id}/renew"
tags: ["bus"]
---

# Renew contract

`POST /bus/contract/{id}/renew`

If a contract is nearing its end height, or if it is running out of funds, it can be renewed, or refreshed, respecitively. If a contract is not renewed in due time, it will be archived and the data will need to be migrated to a different host.

## Path parameters

- `id` string, required — A unique identifier for a file contract

## Request body

- object
  - `endHeight` integer — The height at which the contract will expire
  - `expectedNewStorage` integer
  - `minNewCollateral` string — An unsigned amount of Hastings, the smallest unit of currency in Sia. 1 Siacoin (SC) equals 10^24 Hastings (H).
  - `renterFunds` string — An unsigned amount of Hastings, the smallest unit of currency in Sia. 1 Siacoin (SC) equals 10^24 Hastings (H).

## Response `200`

Contract renewed successfully

- ContractMetadata
  - `id` string — The unique identifier for the file contract.
  - `hostKey` string — The public key of the host.
  - `v2` boolean — Indicates if the contract is a V2 contract.
  - `proofHeight` integer — The height at which the storage proof needs to be submitted
  - `renewedFrom` string — The ID of the contract this one was renewed from
  - `revisionHeight` integer — The block height of the latest revision
  - `revisionNumber` integer — The current revision number of the contract
  - `size` integer — The size of the contract in bytes
  - `startHeight` integer — The block height at which the contract created
  - `state` 'pending' | 'active' | 'complete' | 'failed' — The state of the contract
  - `usability` 'good' | 'bad' — The usability status of the contract
  - `windowStart` integer — The block height when the contract's proof window starts.
  - `windowEnd` integer — The block height when the contract's proof window ends.
  - `contractPrice` string — The price of forming the contract.
  - `initialRenterFunds` string — The initial funds provided by the renter.
  - `spending` object — Costs and spending details of the contract.
    - `deletions` string — Total amount spent on sector deletions
    - `fundAccount` string — Total amount spent on funding ephemeral accounts
    - `sectorRoots` string — Total amount spent on listing sector roots
    - `uploads` string — Total amount spent on storing sectors
  - `archivalReason` 'renewed' | 'removed' | 'hostpruned' — The reason for archiving the contract, if applicable.
  - `renewedTo` string — The ID of the contract this one was renewed to, if applicable.

---

[API](https://skmtc.net/siafoundation/apis/renterd-api.md) · [All operations](https://skmtc.net/siafoundation/apis/renterd-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/siafoundation/renterd-api/versions/184a3d5207da/schema)
