---
title: "Query v2 contracts"
method: POST
path: "/v2/contracts"
tags: ["contracts"]
---

# Query v2 contracts

`POST /v2/contracts`

Queries v2 contracts matching the provided filter and returns a paginated result.

## Request body

- V2ContractFilter
  - `statuses` string[] — Filter by v2 contract statuses.
  - `contractIDs` FileContractID[] — Filter by specific contract IDs.
  - `renewedFrom` FileContractID[] — Filter by the contract ID this contract was renewed from.
  - `renewedTo` FileContractID[] — Filter by the contract ID this contract was renewed to.
  - `renterKey` PublicKey[] — Filter by renter public keys.
  - `minNegotiationHeight` integer — Minimum block height at which the contract was negotiated.
  - `maxNegotiationHeight` integer — Maximum block height at which the contract was negotiated.
  - `minExpirationHeight` integer — Minimum contract expiration block height.
  - `maxExpirationHeight` integer — Maximum contract expiration block height.
  - `limit` integer — Maximum number of v2 contracts to return per page. Defaults to 100.
  - `offset` integer — Number of contracts to skip for pagination.
  - `sortField` string — Field to sort results by. Valid values are "status", "negotiationHeight", "expirationHeight".
  - `sortDesc` boolean — Sort in descending order when true.

## Response `200`

V2 contracts matching filter.

- V2ContractsResponse
  - `count` integer, required — Total number of v2 contracts matching the filter.
  - `contracts` V2Contract[], required — V2 contracts matching the filter for the current page.

## Changes

> 8 revisions in range; 1 could not be searched.

- **2026-02-28** `42e63d370299` — 2 breaking
  - the `limit` request property's max was decreased to `100.00`
  - the `limit` request property's min was increased to `1.00`
- **2026-02-28** `087a58eeff36` — 1 info
  - the `limit` request property's min was decreased from `1.00` to `0.00`
- **2025-10-08** `103993fc0091` — 1 info
  - the `limit` request property's max was increased from `100.00` to `500.00`

[Change history](https://skmtc.dev/siafoundation/apis/hostd-api/changes/v2/contracts/post.md)

---

[API](https://skmtc.dev/siafoundation/apis/hostd-api.md) · [All operations](https://skmtc.dev/siafoundation/apis/hostd-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/siafoundation/hostd-api/revisions/08ff756929fc/schema)
