Intervals.icu API Integration Cookbook

@david any chance that you could enable unlocking (i.e. setting "locked": false) via API for locked entries?

So one could unlock via API, change the wellness data, and then lock again?

(I had some small bugs in my script and now all the wellness data is locked :smiley: )

Hey all! Testing the integration using webhooks i noticed that the same event is delivered multiple times. Looks like it’s retrying even if my app responded with “204 No Content”.
Anyone experienced the same?

@david this is the uid of the event i received multiple times: “f269e1c2-1fb3-4b85-993d-292943144360” and it’s a “CALENDAR_UPDATED” type.
Thanks!

Please msg me the ID of your app and I will have a look. You might get multiple CALENDAR_UPDATED webhooks for the same calendar events if they are being repeatedly changed.

Ok Intervals.icu doesn’t like your 204 response and retries the webhook. I will fix that. Tx.

Amazing, thank you!

1 Like

Hi, Is there a way of getting the list of athletes I am coaching using API? I haven’t been able to find it on the docs

EDIT: Just for the records.
I found it. You can get athlete list using athlete-summary

2 Likes

If I edit an activity do I need to PUT all the fields on the API call or just those that I am going to change?

No, just the fields you want to update. Generally to clear a numeric field supply -1 as the value (most do not allow negative values).

1 Like

Yes this got done:

Hi David, do you think it’s possible to receive multiple CALENDAR_UPDATED webhooks even for deleted events?

I’m troubleshooting a case where i got a CALENDAR_UPDATED with a bunch of “deleted_events” at “2025-04-14 17:53:53 +0000”.
Around 3 minutes later (at 2025-04-14 17:56:10 +0000) i got another CALENDAR_UPDATED with the same “event_id” that got deleted on the previous webhook.
The second webhook had all the events within the “events” list, and not the “deleted_events” list so i re-created all the records on the app (but those are not visible on Intervals because they are gone).

Here a “event_id: 61138214” to give you an example.

Do you know how/why the second webhook was triggered?
Thanks!

1 Like

I have question regarding the OpenApi Spec. I’m trying to generate a client but it fails for me. I tried different tools. Nswag and Openapi-generator-cli. When i validate the spec file i get the following error. What am i missing?


Yes it is. The updated one is queued up with the data and the event can be deleted before it gets sent. The webhook processing code doesn’t re-query the data. I might change this but there will always be a race condition with delete.

If your webhook handler doesn’t return a 2xx status code then the webhook will be re-fired for a while with exponential backoff.

I have fixed these errors. Tx.

1 Like

Got it - thanks for the details!

Hi David,

I’ve been experimenting with the Intervals.icu API and running into some persistent issues I wondered if you might be able to help with.

I’ve been attempting to retrieve activity data using my API key, but consistently getting 403 errors, both via Apple Shortcuts and directly with cURL from my desktop. I’ve double-checked the endpoints, headers, and bearer token formatting, and even tried using the API tester’s generated cURL commands — all returning the same 403.

I also wasn’t sure if privacy settings might be interfering, though my understanding is that the API key should authenticate me as the account holder regardless.

Additionally, I noticed that activity IDs in the API docs are listed as int32, while athlete IDs are strings — which seemed consistent with what I was working with, but wanted to confirm there’s no mismatch expected there.

Would you mind taking a look or pointing me in the right direction? I suspect I’m either missing something obvious or possibly bumping into a permission issue on my account.

Thanks a lot for your time — I appreciate it.

You have to use basic auth, not bearer.

2 Likes

The API uses basic authentication for personal use. The username is “API_KEY” and the password your API key. Example using curl:

$ curl -u API_KEY:1l0nlqjq3j1obdhg08rz5rfhx https://intervals.icu/api/v1/athlete/2049151/activities.csv

2 Likes

That’s exactly the thing I needed to crack it thank you!

So now I’m making good progress pulling down my activities.csv list via the /athlete/{id}/activities.csv endpoint — works great.

I noticed there’s a /activities/{id}/laps.csv endpoint for rides, and was wondering: is there anything equivalent for runs? Or any way to download the full activity data or laps via the API for run activities, similar to what you can export manually from the web UI?

Apologies if I’ve missed something obvious — just getting my head around what’s possible via the API at the moment.

Thanks so much for the great platform and API access — it’s been brilliant so far. And a super responsive community too.

Hi David,

another question from my side.
Is there a possibility to check when an activity has been updated?

For example, “wellness” has an “updated: date-time” which sets a timestamp when the wellness data has been updated (e.g. steps increased from garmin).

But for activity i can’t see something similiar. There is a “icu_sync_date: date-time” but when i change my activity in garmin connect (e.g. adding a comment), the activity in intervals.icu is updated. But the “icu_sync_date” is still the same.

Is this on purpose and i need to use Webhooks (i currently have no registered app at intervals, since im just doing a little private coding project where i want to sync my activities to my own database. I just check a few times a day if there has been added activities, but i’m missing when an activity has been updated)?

Unfortunately I forgot to include a general updated data originally. I will likely add it at some point.

1 Like