---
title: "Edit a race or goal"
method: PATCH
path: "/events/{id}"
tags: ["Events"]
---

# Edit a race or goal

`PATCH /events/{id}`

## Request

- Base URL: `https://bodylab.lol/api/v1`
- URL: `https://bodylab.lol/api/v1/events/{id}`
- Auth: HTTP bearer

A patch that moves the date or changes the sport faces the same bounds as adding one: inside the horizon, and not into a window already dense with that sport. The rolling and total limits are not re-checked — moving a race is not adding one.

## Path parameters

- `id` string, required: Opaque identifier.

## Headers

- `X-Client-Platform` string
- `X-Client-Version` string

## Request body

- object
  - `name` string
  - `eventDate` string, date: A day on the athlete's own calendar: YYYY-MM-DD, no time zone.
  - `sport` string: Sport, from the engine's vocabulary (packages/engine/src/sports.ts), e.g. road_biking, running, hiking, strength_training. Known values: road_biking, running, hiking, strength_training, other. Treat unknown values as "other".
  - `priority` 'A' | 'B' | 'C'
  - `distanceM` number, nullable
  - `durationS` integer, nullable
  - `notes` string

## Response `204`

No content.

## Other responses

- `400`: Error: OUT_OF_HORIZON.
- `401`: Error: UNAUTHORIZED.
- `404`: Error: NOT_FOUND.
- `409`: Error: DATE_OCCUPIED, SCHEDULE_FULL.
- `429`: Error: QUOTA_EXCEEDED.

---

[API](https://skmtc.dev/bodylab/apis/body-lab-api.md) · [All operations](https://skmtc.dev/bodylab/apis/body-lab-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bodylab/apis/body-lab-api/revisions/544c201eaf88?raw)
