#%RAML 1.0 --- title: OpenWorkout baseUri: http://openworkout.cloud/api/{version} mediaType: application/json version: v1 types: UUID: type: string pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ export_format_type: type: string pattern: ('csv'|'gpx'|'tcx') /update_status: description: Used by the mobile application to update it's status. post: queryParameters: DeviceId: UUID ActivityId: UUID responses: 200: Empty string 500: An internal exception was thrown. /activity_track: description: Returns the activity track as a collection of JSON objects. get: queryParameters: activity_id: UUID num_points: number responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 401: Failed authentication. The session token was expired, invalid, or not provided. 500: An internal exception was thrown. /activity_metadata: description: Returns the activity metadata as a collection of JSON objects. get: queryParameters: activity_id: UUID responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 500: An internal exception was thrown. /activity_sensordata: description: Returns the activity sensordata as a collection of JSON objects. Sensor names are specified as a comma-separated list. get: queryParameters: activity_id: UUID sensors: List responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 500: An internal exception was thrown. /activity_summarydata: description: Returns data computed from the activity. Summmary items are specified as a comma-separated list. get: queryParameters: activity_id: UUID summary_items: List responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 500: An internal exception was thrown. /update_activity_metadata: description: post: queryParameters: activity_id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_new_lap: description: post: queryParameters: activity_id: UUID lap start time: number responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /login: description: Authenticates a username and password. post: queryParameters: username: string password: string responses: 200: application/json 401: Failed authentication. The username and password were invalid, or not provided. 500: An internal exception was thrown. /create_login: description: Creates a new account. post: queryParameters: username: string realname: string password1: string password2: string responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 401: Failed authentication. The username and password were not provided or did not meet security requirements. 500: An internal exception was thrown. /login_status: description: Determines if the current user has a valid session token. get: responses: 200: string 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /logout: description: Terminates the current user's session. post: responses: 200: string 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_email: description: Updates the user's email address. post: queryParameters: email: string responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_password: description: Updates the user's password. post: queryParameters: old_password: string new_password1: string new_password2: string responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_users_gear: description: Removes the current user's gear (all of it). post: queryParameters: password: string responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_users_activities: description: Removes the current user's activity data (all of it). post: queryParameters: password: string responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_user: description: Removes the current user and all associated data. post: queryParameters: password: string responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_devices: description: Returns a list of JSON objects describing all of the devices claimed by the logged in user. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_all_activities: description: Returns a list of JSON objects describing all of the user's activities and the activities of the user's friends. get: queryParameters: start?: date-only end?: date-only start_time?: number end_time?: number responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_my_activities: description: Returns a list of JSON objects describing all of the user's activities. get: queryParameters: start?: date-only end?: date-only start_time?: number end_time?: number responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_activity: description: Removes the specified activity. post: queryParameters: activity_id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /add_activity: description: Used when manually creating an activity, such as when logging strength training activities. post: queryParameters: Distance: number Duration: number time: number activity_type: string responses: 200: 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /upload_activity_file: description: Creates a new activity from data contained with the appended file. post: responses: 200: UUID 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /upload_activity_photo: description: Uploads a photo and associates it with an activity. post: queryParameters: activity_id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_activity_photos: description: Lists all photos associated with an activity. get: queryParameters: activity_id: UUID responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_activity_photo: description: Deletes a photo and removes it from an activity. post: queryParameters: activity_id: UUID photo_id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_tags_on_activity: description: Sets the tags on an activity. Tags are provided in a dictionary {"tag0", "foo"|, {"tag1", "bar"), etc. post: queryParameters: activity_id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_tag_from_activity: description: Deletes a tag from an activity. post: queryParameters: activity_id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_sensor_data: description: Deletes the specified set of sensor data (power, cadence, heart rate, etc.) from an activity. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_matched_users: description: Lists user's whose usernames match the search criteria. Results are limited to the first 100 users. post: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_pending_friends: description: Lists the users who are requesting friendship with the logged in user. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_friends: description: Lists the users who are friends with the logged in user. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /request_to_be_friends: description: Sends a request to friend another user. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /confirm_request_to_be_friends: description: Takes a user to the pending friends list and adds them to the actual friends list. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /unfriend: description: Removes a user from the list of users that are friends with the logged in user. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /trim_activity: description: post: queryParameters: activity_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /export_activity: description: Returns the activity in the specified format. get: queryParameters: activity_id: UUID export_format: export_format_type responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /export_workout: description: Returns the workout in the specified format. get: queryParameters: workout_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /claim_device: description: Associates the device specified by the unique identifier with the logged in user's account. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_tags: description: Lists the tags for the specified activity. get: queryParameters: activity_id: UUID responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_comment: description: Adds a comment to the specified activity. post: queryParameters: activity_id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_comments: description: Lists comments for the specified activity. get: queryParameters: activity_id: UUID responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_gear: description: Creates a new gear record for the current user, such as a new bike or pair of shoes. post: responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_gear: description: Lists gear associated with the current user. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_gear_defaults: description: Lists the gear that is, by default, associated with each activity type. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_gear: description: Updates the gear name or description. post: responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_gear_defaults: description: Updates the gear a user wants to associate with an activity type, by default, is received. post: queryParameters: activity_type: string gear_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_gear: description: Delete's the specified gear record and all associated service records. delete: queryParameters: gear_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /retire_gear: description: Marks the specified gear as retired. post: queryParameters: gear_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_service_record: description: Appends service information for a piece of gear (intended for tracking bicycle service data). post: responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_service_record: description: Deletes service informatio for a piece of gear. delete: responses: 200: OK 401: 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_race: description: Creates a race (workout goal) on a user's profile. post: responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_race: description: Removes a race (workout goal) on a user's profile. delete: responses: 200: OK 401: 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_settings: description: post: responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_profile: description: post: responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_visibility: description: Updates activity visibility. post: responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /refresh_analysis: description: Schedules the specified activity for (re)analysis. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /refresh_personal_records: description: Refreshes the cache of personal records in the event it may have become corrupted by deleting activities, or changing activity types. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /generate_workout_plan: description: Schedules workout plan generation. Will generate workouts for the week. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_planned_workouts: description: Lists planned/scheduled workouts. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /update_planned_workouts: description: Replace all of a user's planned/scheduled workouts. post: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_planned_workout: description: Deletes a specified planned/scheduled workout. delete: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_planned_workouts: description: Deletes all of a user's planned/scheduled workouts. delete: queryParameters: workout_id: UUID responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_interval_workouts: description: Lists interval workouts. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_race: description: Adds a race to the calendar. post: responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /create_pace_plan: description: Creates a pace plan. post: queryParameters: name: string description: string target distance: number target distance units: number target time: number target splits: number target splits units: number route: string last updated time: number responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_pace_plans: description: Lists pace plans. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_pace_plan: description: Deletes the specified pace plan. delete: queryParameters: id: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_workout_ical_url: description: Returns a link to the ical url for their planned workouts. get: responses: 200: A URL string. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_location_description: description: Returns the political location that corresponds to an activity. get: queryParameters: activity_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_location_summary: description: Returns the summary of all political locations in which activities have occurred. Result is a JSON string. get: responses: 200: A JSON formatted string. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /activity_hash_from_id: description: Given the activity hash, return sthe activity ID, or an error if not found. Only looks at the logged in user's activities. get: queryParameters: activity_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /has_activity: description: Given the activity ID has hash, returns whether or not the activity exists in the database for the logged in user. get: queryParameters: activity_id: UUID responses: 200: OK 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_personal_records: description: Returns the user's personal records. Result is a JSON string. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_running_paces: description: Returns the user's estimated running paces. Result is a JSON string. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_distance_for_tag: description: Returns the amount of distance logged to activities with the given tag. Result is a JSON string. get: queryParameters: tag: string responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_task_statuses: description: Returns a description of all deferred tasks for the logged in user. Result is a JSON string. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_record_progression: description: Returns an ordered list containing the time and activity ID of the user's record progression for the specified record and activity type, i.e. best running 5K. Result is a JSON string. get: queryParameters: activity_type: string record_name: string responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_user_setting: description: Returns the value associated with the specified user setting. get: queryParameters: requested setting: string responses: 200: The value associated with the requested setting. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /get_user_settings: description: Returns a JSON list of values associated with the specified user settings. Input is a comma-separated list. get: queryParameters: requested settings: List responses: 200: The value associated with the requested setting. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /estimate_vo2_max: description: Returns the user's estimated VO2 max. get: responses: 200: The value. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /estimate_bmi: description: Returns the user's estimated BMI. get: responses: 200: The value. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_power_zones: description: get: queryParameters: estimated ftp: number responses: 200: The value associated with the requested setting. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 500: An internal exception was thrown. /list_hr_zones: description: get: queryParameters: max heart rate: number estimated max heart rate: number responses: 200: The value associated with the requested setting. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 500: An internal exception was thrown. /generate_api_key: description: Generates a new API key for the logged in user. post: responses: 200: UUID 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /delete_api_key: description: Deletes the specified API key. delete: queryParameters: key: UUID responses: 200: Empty string 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_api_keys: description: Returns the API keys associated witht he logged in user. get: responses: 200: application/json 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /list_activity_types: description: Returns the list of all activity types the software understands. get: responses: 200: application/json 500: An internal exception was thrown. /list_workout_types_for_activity: description: Returns a the list of workout types that that correspond with the given activity type (i.e. running has easy runs, tempo runs, etc.). get: responses: 200: application/json 500: An internal exception was thrown. /list_unsynched_activities: description: Returns any changes since the last time the device was synched. get: queryParameters: timestamp: number responsses: 200: application/json /merge_activity_files: description: Takes two files and attempts to merge them. post: responses: 200: The merged file 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown. /merge_activities: description: Takes multiple activities (specified by their unique id) and attempts to merge them, replacing the earliest activity in the list. post: responses: 200: The activity ID of the merged activity. 400: Malformed request. Either required parameters were missing or the supplied parameters were malformed. 403: Failed authentication. The user is not logged in. 500: An internal exception was thrown.