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

# REST API

Fieldnode API is a REST + JSON HTTP API, published as an OpenAPI 3.1 specification — clients can be generated for any language from that spec.

## API model

* **Source of truth:** OpenAPI 3.1 specification — [download `openapi.json`](/api/openapi.json).
* **Transport:** HTTPS with JSON request and response bodies.
* **URL shape:** Resource paths under `/v1/…`, plus `:batch-get` collection actions (e.g. `POST /v1/orgs:batch-get`).
* **Authentication:** PAT bearer token — see [Authentication](./authentication).
* **Errors:** Stable JSON envelope across every endpoint — see [Errors](./errors).

## OpenAPI spec

The canonical machine-readable contract is the [OpenAPI document](/api/openapi.json). Use it to:

* Browse endpoints, parameters, and response models in the API Reference section of these docs.
* Generate a typed client in your language with any OpenAPI-compatible tool, for example:
  * [openapi-typescript](https://github.com/openapi-ts/openapi-typescript) or [@hey-api/openapi-ts](https://heyapi.dev/) for TypeScript.
  * [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen) for Go.
  * [openapi-generator](https://openapi-generator.tech/) for Java, Python, C#, Ruby, and more.

There are currently no Fieldnode-published SDKs — generate the client that fits your stack from the OpenAPI spec.

## Calling the API directly

Every endpoint accepts and returns JSON. A minimal `curl` against the Lab environment:

```bash theme={null}
curl https://api.lab.fieldnode.dev/v1/parts \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer pat_your_personal_access_token'
```

## What to configure in every client

* **Environment base URL:** Lab, Sandbox, or Production (see [Introduction](./)).
* **Authorization header:** `Authorization: Bearer pat_<your_token>`.
* **`Accept: application/json`** (and `Content-Type: application/json` for requests with a body).
* **Timeouts and retries:** configure client defaults for network resiliency. Retry on `5xx` and `429` with backoff; do not retry on `4xx` other than `429`.
* **Error handling:** parse the JSON error envelope and branch on its `code` — see [Errors](./errors).
