> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nonce.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Requests and responses

> Resource paths, request bodies, pagination, and API errors.

Public API v2 uses `https://api.nonce.app/public-api/v2`. Workspace resources include a `workspace_id` in the path, and farm resources also include a `farm_id`. These IDs come from API responses and are distinct from display names and slugs.

## Request parameters

Simple lists use query parameters. Structured searches use POST with a JSON body and `Content-Type: application/json`; POST does not always mean a write operation.

For example, [Search Miners](/api-reference/v2/miners/search-miners) can read online miners with:

```json theme={null}
{
  "status": { "eq": "online" },
  "page": 1,
  "page_size": 20
}
```

Supported filters and defaults vary by endpoint and are defined in each endpoint’s Reference.

## Successful responses

Responses contain `success`, `data`, and `error`. On success, `success` is `true` and `error` is `null`; `data` is an object or array as defined by the endpoint.

Paginated lists also include `pagination`. An empty list is still a successful response:

```json theme={null}
{
  "success": true,
  "data": [],
  "pagination": {
    "total": 0,
    "page": 1,
    "page_size": 20,
    "total_pages": 0
  },
  "error": null
}
```

For paginated lists and searches, `page` defaults to 1 and `page_size` to 20, with a maximum page size of 10,000. Read subsequent pages while `page < total_pages`. Not every endpoint paginates: `ListWorkspaces` returns an unpaginated array, and historical metric queries use time windows.

## Errors

API errors use `success: false`, `data: null`, and an `error` object with `code` and `message`. For example, a missing or inaccessible farm can produce:

```json theme={null}
{
  "success": false,
  "data": null,
  "error": {
    "code": "FARM_NOT_FOUND",
    "message": "Farm not found"
  }
}
```

Validation errors may include `error.details.field_errors`, which identifies invalid fields. When `error.traceId` is present, include it with the endpoint and request time when contacting support. Credentials must be excluded from reports.

A 400 response requires a corrected request. Other access errors are covered in [Authentication and access](/api-guide/v2/authentication#access-errors). Retry guidance is in [Rate limits and retries](/api-guide/v2/rate-limits).

## Time, units, and missing values

Timestamp fields use ISO 8601 as specified by each endpoint. Hashrate is expressed in H/s, power in W, and mining efficiency in J/TH unless the field definition states otherwise. A `null` metric indicates missing data and must not be interpreted as zero.
