> ## 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.

# Quickstart

> Make an authenticated request and retrieve the farms in a workspace.

Public API v2 is available at `https://api.nonce.app/public-api/v2`. This guide uses a workspace API key and two read requests: discover a workspace, then list its farms.

## Prepare an API key

In the [Nonce app](https://nonce.app), select the target workspace and open **Manage → API Keys**. The API Keys view is visible to users with `workspace.manage`. Store the key in the server-side environment as `NONCE_API_KEY`; see [Authentication and access](/api-guide/v2/authentication) for permissions and credential handling.

## Select a workspace

```bash theme={null}
curl --fail-with-body \
  "https://api.nonce.app/public-api/v2/workspaces" \
  -H "Authorization: Bearer ${NONCE_API_KEY}"
```

A successful response contains `success: true` and a `data` array of accessible workspaces. Select an item by its `id` and assign that value to `WORKSPACE_ID`. The API requires the ID, not the workspace slug used in app URLs.

`ListWorkspaces` is beta. Its response also includes access relations and effective permissions; the full definition is in the [Reference](/api-reference/v2/workspaces/list-workspaces).

## List farms

```bash theme={null}
curl --fail-with-body \
  "https://api.nonce.app/public-api/v2/workspaces/${WORKSPACE_ID}/farms?page=1&page_size=20" \
  -H "Authorization: Bearer ${NONCE_API_KEY}"
```

`data` contains the farms accessible with the current credentials. An empty array is a valid result. If the current `page` is less than `pagination.total_pages`, increment `page` and request the next page.

Use a farm’s `id` from this response as the `farm_id` in farm-scoped requests. Continue with [List Miners](/api-reference/v2/miners/list-miners) or [List Agents](/api-reference/v2/agents/list-agents). Response fields and errors are covered in [Requests and responses](/api-guide/v2/requests).
