client.sharedEvents manages shared events such as races and group events, addressed directly by id rather than scoped to an athlete. create, update and delete are not documented in the vendored OpenAPI spec but are verified to work against the live API.
| Method | What it does |
|---|---|
| SharedEventService.get | Get a shared event by ID |
| SharedEventService.create | Create a shared event |
| SharedEventService.update | Update a shared event |
| SharedEventService.delete | Delete a shared event |
Get a shared event by id, given on the command line, in a try/catch that prints the error status on failure. The test account has no known shared event id, so a 404 is the expected outcome.
const client = new IntervalsClient({ apiKey });
try {
const event = await client.sharedEvents.get(eventId);
console.log(`${event.name ?? eventId}: ${event.start_date_local ?? 'n/a'} at ${event.location ?? 'n/a'}`);
} catch (err) {
if (err instanceof IntervalsAPIError) {
console.log(`Could not fetch shared event ${eventId}: status=${err.status}`);
} else {
throw err;
}
}
create, update and delete routes are undocumented in the OpenAPI spec but verified to work. See API behaviour for the cross-service list.