# Changelog

This page lists the changes to the Parkdly API. Each version is a non-breaking update to the `v1` API.


## 0.7 (preview)

### Added

- **API v2, for apps Parkdly approves** — `GET /api/v2/courses` and `GET /api/v2/courses/:courseId` serve the version of a course the club **published**, with its layouts and holes, and one app token (`grant_type=client_credentials`) instead of a token per club. See [API v2](https://parkdly.com/docs/parkdly-api/v2-overview). v1 does not change: same answers, and it still reads the live course.
- **Paging (v2)** — `GET /api/v2/courses` answers a page at a time: `?limit=` (default 50, up to 100) and `?cursor=`, with `nextCursor` in the answer. See [List published courses](https://parkdly.com/docs/parkdly-api/v2-reference#list-published-courses).
- **Connect a club's own course (v2)** — `POST /api/v2/connect-sessions` sends the club to a Parkdly page where it picks one of its courses, or maps a new one, and the layouts you get. Read the outcome with `GET /api/v2/connect-sessions/:id`; remove a link with `DELETE /api/v2/courses/:courseId/connection`. See [API v2 reference](https://parkdly.com/docs/parkdly-api/v2-reference#connect-a-clubs-course).
- **Webhooks (v2)** — `course.published` carries the version number, not the course, and `course.deleted` carries no course. Two new events: `course.connected` and `course.disconnected`. See [API v2 webhooks](https://parkdly.com/docs/parkdly-api/v2-overview#webhooks).
- **The consent screen says what your app can do** — "Create courses for you in Parkdly, and read them", and that your app can't see the user's other courses. Login and signup name your app when a user comes from it.

## 0.6 (2026-11-09)

### Changed

- **One consistent tee, target and flight path** — v1 `teePosition`, `targetPosition` and `flightPath` now come from the main layout, as one consistent pair: the flight path always runs between the returned tee and target, or is `null`.

### Fixed

- **`updatedAt` moves when holes change** — `updatedAt` used to change only when the course itself was edited. It is now the time of the latest change to the course or anything in its answer: holes, tees, targets, flight paths and the main layout. Use it to tell when to read a course again, and compare it for a different value, not a later one: deleting a hole, tee, target or layout can make it earlier.
- **A body that is not JSON answers `400`** — `POST /api/v1/courses` with a body that is not valid JSON now answers `400 validation_error` instead of `500 internal_server_error`.

## 0.5 (2026-10-06)

### Changed

- **Deleted courses can be restored** — a user can restore a deleted course for 30 days. While deleted, the course answers `404` and is left out of `GET /api/v1/courses`, as before. When it is restored, it answers again with the same course id and hole ids, and your app receives `course.published`. `POST /api/v1/courses` with the `externalCourseId` of a deleted course restores it and answers `409 course_already_exists`, as for a course that exists. See [Webhooks](https://parkdly.com/docs/parkdly-api/webhooks).

## 0.4 (2026-06-13)

### Added

- **Rate limiting** — per-application rate limits are now enforced on all `/api/v1/` endpoints. Responses include `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers; exceeding a limit returns `429 Too Many Requests` with a `Retry-After` header. See [Rate Limits](https://parkdly.com/docs/parkdly-api/rate-limits) for the per-endpoint limits.

## 0.3 (2026-03-06)

### Added

- **`course.deleted` webhook event** — fired automatically when a user deletes an externally linked course. Payload includes full course data as it was before deletion, so your app can remove its references. See [Webhooks](https://parkdly.com/docs/parkdly-api/webhooks) for details.

## 0.2 (2026-03-06)

### Added

- **`studioUrl` field** on Course object — relative path to the course editor in Parkdly Studio. Add your Parkdly host (for example `https://parkdly.com`) before it to open it in a browser. Included in all API responses and webhook payloads.
- **`location` field** on Course object — optional `{lat, lng}` coordinates. Set it with `POST /api/v1/courses` to center the map in Parkdly Studio. Returned as `null` when not set.
- **`flightPath` input on course creation** — `POST /api/v1/courses` now accepts optional `flightPath` control points per fairway. Format matches the GET response: `[{order, lat, lng}]`. When you omit it, Parkdly generates one control point at the midpoint (existing behavior, unchanged).

## 0.1 (2026-02-15)

### Added

- Initial API release (Preview)
- OAuth 2.0 authentication with PKCE support
- `GET /api/v1/courses` — list courses
- `GET /api/v1/courses/{courseId}` — get course details
- `POST /api/v1/courses` — create course with optional fairways
- `course.published` webhook event
- Error handling and response format documentation
