apistrava

Strava API - How set activity type for Uploaded Activity?


I want to upload my gpx files via Strava API. I read documentation and there is no mention about set Activity type and privacy at Upload endpoint and no API for editing activities.

What can I do?


Solution

  • You can edit activity type and set the hide_from_home flag to true.

    The recipe is as following:

    1. Upload activity via Upload Activity (createUpload).

    2. Get activity_id via Get Upload (getUploadById) method. It may take a while to get that ID as the upload needs to be processed by Strava.

    3. After you get Activity ID, you can update the activity via Update Activity (updateActivityById) PUT method. There, you can set one of the UpdatableActivity. Ones that might be interesting for you are:

    There is no possibility to update private property via the API as for the moment.