
# Tarvena HTTP API

Start with [Start here for agents](actions.md), then follow an [agent skill](https://tarvena.pl/docs/skills/outlets-and-parcels.md): each public skill page ends with its HTTP actions.

Use `https://tarvena.pl` and [user authentication](authentication.md).

| Domain | Reference |
| --- | --- |
| Map | [Map actions and bounded reads](actions.md), [streams and parcel lookup](maps.md) |
| Water Devices and Characteristic Points | [Devices, points, and relationships](water-devices.md) |
| Calculations, including catchments | [Method descriptors](calculations.md#discovery), [validation and evaluation](calculations.md#validation-and-evaluation), [save and document insertion](calculations.md#save-an-evaluated-calculation), [catchment analysis and comparison](catchments.md) |
| Documents | [Saved bodies and conditional writes](documents.md), [specification authoring](documents.md#author-a-specification), [forms and EGiB](forms.md) |

[Projects and member policies](projects.md) and [authentication](authentication.md) support these workflows. [Named actions and schema/resource discovery](actions.md) describe JSON calls, selected schemas, resource discovery.

## Conventions

- Domain calls require `Authorization: Bearer <access_token>`.
- Writes require the [current write contract header](actions.md#write-contract).
- Send JSON bodies with `Content-Type: application/json`.
- Follow the request’s explicit CRS. Geographic REST positions use WGS84 `[longitude,latitude]`; engineering point imports use their declared projected CRS. Distances and areas use metres and square metres.
- Responses are domain objects, without a generic `data` wrapper. Most errors use `{error,message}`. Document save conflicts have their own response.
- On 401, authenticate. On 403, report denied access. On 429, honor `Retry-After` if present and use bounded backoff otherwise.
- Replace example IDs and coordinates. Keep tokens outside prompts and logs.

[Machine-readable endpoint catalogue](operations.json). `GET /api/v1/actions` lists callable actions; GET on one action URL returns its schema. POST `calculations/methods/get` returns the selected method descriptor. `GET /api/v1/resources?kind=action&owner=files/uploads/reserve` filters discovery by schema kind and owner and includes byte protocols and selected schema identities; `GET /api/v1/openapi.json` describes the action API.

## Which source to trust

The current document, project, and command results are authoritative. For CLI syntax, use the installed documentation returned by `tarvena help agent-docs` over the web copy. For HTTP calls, signed-in discovery from `GET /api/v1/actions`, each action schema, and `GET /api/v1/openapi.json` overrides this reference. The web documentation also serves readers without an install.
