# API access to Intervals.icu

**URL:** <https://forum.intervals.icu/t/api-access-to-intervals-icu/609>\
**Category:** Guide\
**Created:** [1 April 2020 16:18 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609 "2020-04-01T16:18:59Z")\
**Posts on this page:** 20\
**Page:** 8

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [6 April 2022 04:18 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/141 "2022-04-06T04:18:02Z")

</div>

The gear data is available:

```
GET /api/v1/athlete/{id}/gear{ext}

```

The ext bit can be empty for JSON or .csv for CSV download. You can also edit etc… Have a look at the endpoints used by Intervals.icu and just add in the /v1/ bit.

---

<div class="post-metadata">

**Author:** ![Gerald](https://forum.intervals.icu/user_avatar/forum.intervals.icu/gerald/32/28423_2.png) [@Gerald](https://forum.intervals.icu/u/Gerald)\
**Post date:** [11 April 2022 13:58 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/142 "2022-04-11T13:58:33Z")

</div>

I need some help please, to be able to import wellness data, per athlete, into my Excel file(s) that has their annual training plan linked to the data.

I am using the Get Data from Web option in Excel, but lack a few things to get it to work.  
Web tutorials indicate there should be an authorisation option to choose from; this is all I have.

 ![image](https://forum.intervals.icu/uploads/default/original/2X/2/2a314bb8fab0cde6f953070e1d5d93825307823f.png)

I have entered the API key and login details in the Data Source Settings.

 ![image](https://forum.intervals.icu/uploads/default/original/2X/8/88cd33f537967eb36ca847757715ff57e11ef3a5.png)

What a I doing wrong? Some easy how-to would be greatly appeciated.  
If I can get this working, it would prevent me having to manually download data, and copy and paste for each athlete’s ATP.

---

<div class="post-metadata">

**Author:** ![app4g](https://forum.intervals.icu/user_avatar/forum.intervals.icu/app4g/32/41800_2.png) [@app4g](https://forum.intervals.icu/u/app4g)\
**Post date:** [11 April 2022 14:07 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/143 "2022-04-11T14:07:23Z")

</div>

Are you using Basic Auth or OAuth?

this from 2018 tho:

> **[Get data from web - with authentication - connection error](https://learn.microsoft.com/en-us/archive/msdn-technet-forums/f3099495-eba9-4600-85c5-131257564c82)**

he newer experience uses Power Query for retrieving the web page. Specifically the From Web experience is using the M function Web.Page. Web.Page uses IE to read the webpage, and IE does not give the ability to compartmentalize cookies, which could present a security risk of leaked cookies. To prevent the security risk Basic Auth and OAuth are prohibited with Web.Page.

Or are you using Power Query?

> **[Authentication in desktop apps - Power Query](https://learn.microsoft.com/en-us/power-query/connectorauthentication)**
>
> How to select credentials for a connector in Power Query Desktop to authenticate a connection with a data source, how to select the authentication level, and how to edit or delete credentials for specific connectors and sites.

---

<div class="post-metadata">

**Author:** ![Gerald](https://forum.intervals.icu/user_avatar/forum.intervals.icu/gerald/32/28423_2.png) [@Gerald](https://forum.intervals.icu/u/Gerald)\
**Post date:** [11 April 2022 14:36 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/144 "2022-04-11T14:36:30Z")

</div>

What should I be using?

---

<div class="post-metadata">

**Author:** ![app4g](https://forum.intervals.icu/user_avatar/forum.intervals.icu/app4g/32/41800_2.png) [@app4g](https://forum.intervals.icu/u/app4g)\
**Post date:** [11 April 2022 14:47 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/145 "2022-04-11T14:47:19Z")

</div>

typically, Basic Auth means you can only access your own acc. I presume you have all your athletes’s user/pass or somehow they are linked under you as “coach” and interval’s access scope allows you (as coach) to access them all.

I would also presume that you don’t have OAuth (you need to specifically request for it).

In any case, I am not sure how to use Power Query nor the connector within excel. (Have not tried it before)

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [11 April 2022 15:05 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/146 "2022-04-11T15:05:49Z")

</div>

You should use basic auth with username API\_KEY and password your API key from the /settings page. This will let you get at everything you can see when logged in so it will work for athletes you follow. I am not familiar with the Microsoft tools you are using.

@app4g The oauth bearer tokens are more restrictive and only allow access to the specific athlete and authed scopes

---

<div class="post-metadata">

**Author:** ![Gerald](https://forum.intervals.icu/user_avatar/forum.intervals.icu/gerald/32/28423_2.png) [@Gerald](https://forum.intervals.icu/u/Gerald)\
**Post date:** [11 April 2022 15:23 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/147 "2022-04-11T15:23:25Z")

</div>

Thanks @app4g and @david

I’m basically trying to import the wellness.csv file into an excel sheet, like a normal web query.  
The problem is getting passed the authorisation step.

The URL is the wellness hyperlink:  
[https://intervals.icu/api/athlete/](https://intervals.icu/api/athlete/){my id}/wellness.csv

Access Web content allows me to enter API\_KEY and my API key in the credentials settings.  
Not sure if Privacy level makes a difference.

 ![image](https://forum.intervals.icu/uploads/default/original/2X/6/65c7bf69d5ad69c855fbe42f525947dceac53bb1.png)

However, when I try connect it gives the error

 ![image](https://forum.intervals.icu/uploads/default/original/2X/b/b51a0b263f74912a54e99835b05bdf4f4ad7d96c.png)

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [11 April 2022 16:41 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/148 "2022-04-11T16:41:34Z")

</div>

Aha you have to use /api/v1/athlete/… and not /api/athlete/…

Basically most calls the Intervals.icu app makes are part of the API but you need to add that /v1/ bit.

---

<div class="post-metadata">

**Author:** ![Gerald](https://forum.intervals.icu/user_avatar/forum.intervals.icu/gerald/32/28423_2.png) [@Gerald](https://forum.intervals.icu/u/Gerald)\
**Post date:** [11 April 2022 17:27 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/149 "2022-04-11T17:27:31Z")

</div>

BINGO!

Thanks David, it works

---

<div class="post-metadata">

**Author:** ![Gabrie](https://forum.intervals.icu/user_avatar/forum.intervals.icu/gabrie/32/41744_2.png) [@Gabrie](https://forum.intervals.icu/u/Gabrie)\
**Post date:** [13 April 2022 08:30 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/150 "2022-04-13T08:30:04Z")

</div>

Just found out about the API. Is there a how-to document that hold all the different calls available?

---

<div class="post-metadata">

**Author:** ![Rohan\_EnduroCo](https://forum.intervals.icu/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@Rohan\_EnduroCo](https://forum.intervals.icu/u/Rohan_EnduroCo)\
**Post date:** [13 April 2022 13:12 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/151 "2022-04-13T13:12:46Z")

</div>

Hi, @david

Facing an issue in posting workout using the `https://intervals.icu/api/v1/athlete/{{athlere_id}}/events/` API to the calendar using JSON format.

In the workout\_doc.steps object if I change the units from %ftp to ftp it still takes %ftp.

`{ "steps": [{ "duration": 600, "power": { "value": 63, "units": "ftp" } }] } `  
behaves like  
`{ "steps": [{ "duration": 600, "power": { "value": 63, "units": "%ftp" } }] } `

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [13 April 2022 18:17 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/152 "2022-04-13T18:17:37Z")

</div>

> [@Rohan\_EnduroCo](#):
>
> In the workout\_doc.steps object if I change the units from %ftp to ftp it still takes %ftp.

That’s because there isn’t all that much validation and “ftp” isn’t valid so it falls back to the default which is “%ftp”.

It is probably better to send in formatted text in the description field rather than the steps. For some workouts (e.g. those using distance and soon zones) Intervals.icu may re-parse the description and ignore the steps.

> [@Gabrie](#):
>
> Just found out about the API. Is there a how-to document that hold all the different calls available?

Only this thread and the one about OAuth. I hope to get a doc site up soon. Most calls made by the Intervals.icu web app are also in the API. Just change /api/blah to /api/v1/bla.

---

<div class="post-metadata">

**Author:** ![Matthew\_Roche](https://forum.intervals.icu/user_avatar/forum.intervals.icu/matthew_roche/32/2937_2.png) [@Matthew\_Roche](https://forum.intervals.icu/u/Matthew_Roche)\
**Post date:** [4 May 2022 21:16 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/153 "2022-05-04T21:16:36Z")

</div>

I’m trying to use the Wellness endpoint to access the atl / ctl data but I’m running into a slightly strange bug. Everything works well using basic authentication and the API\_KEY, but I’m getting a 403 “Access Denied” error when using the Bearer Token obtained from the OAuth log in. I’ve verified the token is correct on the Activities endpoint which works fine.

I’m using this URL: [https://intervals.icu/api/v1/athlete/i20992/wellness](https://intervals.icu/api/v1/athlete/i20992/wellness)  
With the header: Authorization: Bearer XXX

Maybe I’ve screwed something up, but do you have any ideas @david

---

<div class="post-metadata">

**Author:** ![app4g](https://forum.intervals.icu/user_avatar/forum.intervals.icu/app4g/32/41800_2.png) [@app4g](https://forum.intervals.icu/u/app4g)\
**Post date:** [5 May 2022 00:15 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/154 "2022-05-05T00:15:41Z")

</div>

Did you check if you have the right / all the access granted?  
I had this issue once, everything works w/ basic but oAuth doesn’t cos oAuth has diff access levels.

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [5 May 2022 04:44 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/155 "2022-05-05T04:44:48Z")

</div>

The app need to have `WELLNESS:READ` scope for the athlete to get at wellness data. Your app only has `ACTIVITY:READ` for that athlete.

The API\_KEY auth works differently granting access to everything the athlete can get at.

---

<div class="post-metadata">

**Author:** ![Matthew\_Roche](https://forum.intervals.icu/user_avatar/forum.intervals.icu/matthew_roche/32/2937_2.png) [@Matthew\_Roche](https://forum.intervals.icu/u/Matthew_Roche)\
**Post date:** [5 May 2022 19:44 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/156 "2022-05-05T19:44:47Z")

</div>

@David@app4g Thanks both.I knew it would be something stupid. Apologies

---

<div class="post-metadata">

**Author:** ![Ivan](https://forum.intervals.icu/user_avatar/forum.intervals.icu/ivan/32/65152_2.png) [@Ivan](https://forum.intervals.icu/u/Ivan)\
**Post date:** [17 May 2022 18:02 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/157 "2022-05-17T18:02:49Z")

</div>

Hey @david, thank you for such an amazing product and this API. Is there any way to update profile info such as name, email, avatar etc?

I can send there “name” and server even answers 200 code, but name seems unchanged

> [@david](#):
>
> ```auto
> PUT JSON to https://intervals.icu/api/v1/athlete/2049151/wellness/2021-01-24
> {
> "weight": 71.0
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [17 May 2022 18:29 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/158 "2022-05-17T18:29:15Z")

</div>

Currently you can only update name, email and some other personal settings if you are calling using the API key for the athlete being modified. You can’t update these using a bearer token from OAuth. I could change this for name and profile pic?

---

<div class="post-metadata">

**Author:** ![Ivan](https://forum.intervals.icu/user_avatar/forum.intervals.icu/ivan/32/65152_2.png) [@Ivan](https://forum.intervals.icu/u/Ivan)\
**Post date:** [17 May 2022 20:42 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/159 "2022-05-17T20:42:04Z")

</div>

I’m using API key for request above. I didn’t know that there is a possibility to authorize user with OAuth 🙂  
Can I use bearer token to update weight and resting HR as well?

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [18 May 2022 17:27 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/160 "2022-05-18T17:27:59Z")

</div>

Yes you can. You need WELLNESS:WRITE scope.

[Previous page](https://forum.intervals.icu/t/api-access-to-intervals-icu/609.md?page=7)

[Next page](https://forum.intervals.icu/t/api-access-to-intervals-icu/609.md?page=9)
