# API reference

Source: https://developers.newjune.co/api-reference

> Every resource, field, endpoint, and parameter in the New June Data API v1.

The reference is generated from the API's OpenAPI 3.1 document, the same file the API serves. When the two ever disagree, the document wins: [download it](https://developers.newjune.co/openapi.json) or fetch it from the API at `https://data.newjune.co/v1/openapi.json`.

- Base URL: `https://data.newjune.co/v1`
- Auth header: `Authorization: Bearer $NEW_JUNE_API_KEY`
- Methods: GET only (read-only)
- Format: JSON, snake_case fields, explicit nulls, ISO 8601 UTC timestamps
- OpenAPI 3.1 document: https://developers.newjune.co/openapi.json

Every endpoint is a `GET` on a flat collection, `/v1/<resource>` or `/v1/<resource>/{id}`. Related resources are linked by `_id` fields and query filters such as `?round_id=`, never by nested paths. Lists share one [envelope and cursor](https://developers.newjune.co/pagination), errors share one [shape](https://developers.newjune.co/errors), and every response uses the same [conventions](https://developers.newjune.co/conventions).

## Resources

  - [me](https://developers.newjune.co/api-reference/me): The API key making the request, and its limits.
  - [rounds](https://developers.newjune.co/api-reference/rounds): A round of golf you played or set up.
  - [hole_scores](https://developers.newjune.co/api-reference/hole-scores): Your score on one hole of a round.
  - [shots](https://developers.newjune.co/api-reference/shots): One shot from one of your rounds.
  - [reports](https://developers.newjune.co/api-reference/reports): Analysis of one of your rounds. When a round was analyzed more than once, only the newest report is available.
  - [priorities](https://developers.newjune.co/api-reference/priorities): An area of your game that your rounds point to.
  - [plans](https://developers.newjune.co/api-reference/plans): A practice plan for one of your priorities.
  - [evaluations](https://developers.newjune.co/api-reference/evaluations): A check of how a plan went in one of your rounds.
  - [focus_sets](https://developers.newjune.co/api-reference/focus-sets): The plans you were focusing on for a period of time.
  - [clubs](https://developers.newjune.co/api-reference/clubs): A club in your bag.

## Every endpoint

| Method | Path | Summary | Scope |
| --- | --- | --- | --- |
| `GET` | [`/v1/me`](https://developers.newjune.co/api-reference/me) | Get the current API key | any key |
| `GET` | [`/v1/rounds`](https://developers.newjune.co/api-reference/rounds) | List rounds | `rounds:read` |
| `GET` | [`/v1/rounds/{id}`](https://developers.newjune.co/api-reference/rounds) | Get a round | `rounds:read` |
| `GET` | [`/v1/hole_scores`](https://developers.newjune.co/api-reference/hole-scores) | List hole scores | `rounds:read` |
| `GET` | [`/v1/hole_scores/{id}`](https://developers.newjune.co/api-reference/hole-scores) | Get a hole score | `rounds:read` |
| `GET` | [`/v1/shots`](https://developers.newjune.co/api-reference/shots) | List shots | `rounds:read` |
| `GET` | [`/v1/shots/{id}`](https://developers.newjune.co/api-reference/shots) | Get a shot | `rounds:read` |
| `GET` | [`/v1/reports`](https://developers.newjune.co/api-reference/reports) | List reports | `reports:read` |
| `GET` | [`/v1/reports/{id}`](https://developers.newjune.co/api-reference/reports) | Get a report | `reports:read` |
| `GET` | [`/v1/priorities`](https://developers.newjune.co/api-reference/priorities) | List priorities | `plans:read` |
| `GET` | [`/v1/priorities/{id}`](https://developers.newjune.co/api-reference/priorities) | Get a priority | `plans:read` |
| `GET` | [`/v1/plans`](https://developers.newjune.co/api-reference/plans) | List plans | `plans:read` |
| `GET` | [`/v1/plans/{id}`](https://developers.newjune.co/api-reference/plans) | Get a plan | `plans:read` |
| `GET` | [`/v1/evaluations`](https://developers.newjune.co/api-reference/evaluations) | List evaluations | `plans:read` |
| `GET` | [`/v1/evaluations/{id}`](https://developers.newjune.co/api-reference/evaluations) | Get an evaluation | `plans:read` |
| `GET` | [`/v1/focus_sets`](https://developers.newjune.co/api-reference/focus-sets) | List focus sets | `plans:read` |
| `GET` | [`/v1/focus_sets/current`](https://developers.newjune.co/api-reference/focus-sets) | Get the current focus set | `plans:read` |
| `GET` | [`/v1/focus_sets/{id}`](https://developers.newjune.co/api-reference/focus-sets) | Get a focus set | `plans:read` |
| `GET` | [`/v1/clubs`](https://developers.newjune.co/api-reference/clubs) | List clubs | `clubs:read` |
| `GET` | [`/v1/clubs/{id}`](https://developers.newjune.co/api-reference/clubs) | Get a club | `clubs:read` |

For example, the first request most integrations make is `GET https://data.newjune.co/v1/me`.
