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.
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
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.
Hi. Iām trying to update Power Zones via the API. Is there any guidance on the format for the power_zones input - the Cookbook just say its Interger values as part of an array. Does this need to contain the lower and upper limits of each zone e.g. [0,150,151,220,221,260,261,300,301,340,341,430,431], or should it just include the values of the lower bouund? [0,151,221,261,301,341,431].
I only really want update the boundary between z2 and z3, but Iām assumning I need to include all the zones in the array?
thanks
the endpoint reports values in this format.
āpower_zonesā:[55,75,90,105,120,150,999]
so looks like itās the upper
Thanks! I seem to now be getting a 422 error when including the power_zones array in the exisiting API call I have working. The body is below. Any idea what might be causing the error? Auth is fine as it works without the power_zones element.
{"ftp":288,"indoor_ftp":288,"power_zones":[55,78,90,105,120,150,999]}
Thanks in advance
That endpoint was a bit buggy in that you had to update the power zones, names, sweet spot etc. all together. I have fixed that. You can now update just the zones or just the names etc⦠I still need to make similar changes to updating HR and pace zones.