stravalib.client.Client.update_activity#

Client.update_activity(activity_id, name=None, activity_type=None, sport_type=None, private=None, commute=None, trainer=None, gear_id=None, description=None, device_name=None, hide_from_home=None)[source]#

Updates the properties of a specific activity.

https://developers.strava.com/docs/reference/#api-Activities-updateActivityById

Parameters:
  • activity_id (int) – The ID of the activity to update.

  • name (str, default=None) – The name of the activity.

  • activity_type (str, default=None) – The activity type (case-insensitive). Deprecated. Prefer to use sport_type. In a request where both type and sport_type are present, this field will be ignored. See https://developers.strava.com/docs/reference/#api-models-UpdatableActivity. Possible values: ride, run, swim, workout, hike, walk, nordicski, alpineski, backcountryski, iceskate, inlineskate, kitesurf, rollerski, windsurf, workout, snowboard, snowshoe

  • sport_type (str, default=None) – Possible values (case-sensitive): AlpineSki, BackcountrySki, Badminton, Canoeing, Crossfit, EBikeRide, Elliptical, EMountainBikeRide, Golf, GravelRide, Handcycle, HighIntensityIntervalTraining, Hike, IceSkate, InlineSkate, Kayaking, Kitesurf, MountainBikeRide, NordicSki, Pickleball, Pilates, Racquetball, Ride, RockClimbing, RollerSki, Rowing, Run, Sail, Skateboard, Snowboard, Snowshoe, Soccer, Squash, StairStepper, StandUpPaddling, Surfing, Swim, TableTennis, Tennis, TrailRun, Velomobile, VirtualRide, VirtualRow, VirtualRun, Walk, WeightTraining, Wheelchair, Windsurf, Workout, Yoga

  • private (bool, default=None) – Whether the activity is private. .. deprecated:: 1.0 This param is not supported by the Strava API and may be removed in the future.

  • commute (bool, default=None) – Whether the activity is a commute.

  • trainer (bool, default=None) – Whether this is a trainer activity.

  • gear_id (int, default=None) – Alpha-numeric ID of gear (bike, shoes) used on this activity.

  • description (str, default=None) – Description for the activity.

  • device_name (str, default=None) – Device name for the activity .. deprecated:: 1.0 This param is not supported by the Strava API and may be removed in the future.

  • hide_from_home (bool, default=None) – Whether the activity is muted (hidden from Home and Club feeds).

Return type:

Updates the activity in the selected Strava account