{ "swagger": "2.0", "info": { "description": "A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities", "title": "Workout Tracker", "contact": { "url": "https://github.com/jovandeginste/workout-tracker/issues" }, "license": { "name": "MIT", "url": "https://github.com/jovandeginste/workout-tracker?tab=License-1-ov-file" }, "version": "1.0" }, "basePath": "/api/v1", "paths": { "/daily": { "get": { "produces": [ "application/json" ], "summary": "List the daily measurements of the current user", "parameters": [ { "type": "integer", "description": "Number of measurements to return; default 50; -1 is no limit", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/definitions/database.Measurement" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Update the daily measurement of the current user", "parameters": [ { "description": "Measurement data", "name": "measurement", "in": "body", "required": true, "schema": { "$ref": "#/definitions/app.Measurement" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.Measurement" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/import/{program}": { "post": { "produces": [ "application/json" ], "summary": "Import a workout", "parameters": [ { "type": "string", "description": "Program that generates the workout file", "name": "program", "in": "path", "required": true }, { "type": "string", "description": "Name of the imported workout", "name": "name", "in": "query" }, { "type": "string", "description": "Type of the imported workout", "name": "type", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.Workout" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/records": { "get": { "produces": [ "application/json" ], "summary": "List all records of the current user for the specified workout type", "parameters": [ { "type": "string", "description": "Workout type", "name": "type", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.WorkoutRecord" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/statistics": { "get": { "produces": [ "application/json" ], "summary": "List all statistics of the current user", "parameters": [ { "type": "string", "description": "Start of time range", "name": "since", "in": "query" }, { "type": "string", "description": "Bucket size", "name": "per", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.Statistics" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/totals": { "get": { "produces": [ "application/json" ], "summary": "List all totals of the current user for the specified workout type", "parameters": [ { "type": "string", "description": "Workout type", "name": "type", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.Bucket" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/whoami": { "get": { "produces": [ "application/json" ], "summary": "Show the information of the owner of the API key", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.User" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/workouts": { "get": { "produces": [ "application/json" ], "summary": "List all workouts of the current user", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/definitions/database.Workout" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/workouts/": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Create a new workout", "parameters": [ { "description": "Workout data", "name": "workout", "in": "body", "required": true, "schema": { "$ref": "#/definitions/app.ManualWorkout" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/app.ManualWorkout" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/workouts/coordinates": { "get": { "produces": [ "application/json" ], "summary": "List all coordinates of all workouts of the current user", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/geojson.FeatureCollection" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/workouts/{id}": { "get": { "produces": [ "application/json" ], "summary": "Get all information about a workout", "parameters": [ { "type": "integer", "description": "Workout ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "description": "Include details", "name": "details", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.Workout" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } }, "/workouts/{id}/breakdown": { "get": { "produces": [ "application/json" ], "summary": "Break down a workdown per units", "parameters": [ { "type": "integer", "description": "Workout ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Unit", "name": "unit", "in": "query" }, { "type": "integer", "description": "Count", "name": "count", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/app.APIResponse" }, { "type": "object", "properties": { "results": { "$ref": "#/definitions/database.WorkoutBreakdown" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/app.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/app.APIResponse" } } } } } }, "definitions": { "app.APIResponse": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "string" } }, "results": {} } }, "app.Event": { "type": "object", "properties": { "end": { "type": "string" }, "start": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" } } }, "app.ManualWorkout": { "type": "object", "properties": { "custom_type": { "type": "string" }, "date": { "type": "string" }, "distance": { "type": "number" }, "duration_hours": { "type": "integer" }, "duration_minutes": { "type": "integer" }, "duration_seconds": { "type": "integer" }, "location": { "type": "string" }, "name": { "type": "string" }, "notes": { "type": "string" }, "repetitions": { "type": "integer" }, "timezone": { "type": "string" }, "type": { "$ref": "#/definitions/database.WorkoutType" }, "weight": { "type": "number" } } }, "app.Measurement": { "type": "object", "properties": { "date": { "description": "The date of the measurement", "type": "string" }, "height": { "description": "The height of the user, in centimeter", "type": "number" }, "height_unit": { "description": "The unit of the height (or the user's preferred unit)", "type": "string" }, "steps": { "description": "The number of steps taken", "type": "number" }, "weight": { "description": "The weight of the user, in kilograms", "type": "number" }, "weight_unit": { "description": "The unit of the weight (or the user's preferred unit)", "type": "string" } } }, "database.BreakdownItem": { "type": "object", "properties": { "counter": { "description": "Counter of this item in the list of items", "type": "integer" }, "distance": { "description": "Distance in this item", "type": "number" }, "distance2D": { "description": "2D distance in this item", "type": "number" }, "duration": { "description": "Duration in this item", "type": "integer" }, "firstPoint": { "description": "First GPS point in this item", "allOf": [ { "$ref": "#/definitions/database.MapPoint" } ] }, "isBest": { "description": "Whether this item is the best of the list", "type": "boolean" }, "isWorst": { "description": "Whether this item is the worst of the list", "type": "boolean" }, "lastPoint": { "description": "Last GPS point in this item", "allOf": [ { "$ref": "#/definitions/database.MapPoint" } ] }, "localAverageSpeed": { "description": "The average speed in the bucket, localized", "type": "string" }, "localCadence": { "description": "The starting cadence in the bucket, localized", "type": "string" }, "localDistance": { "description": "The total distance in the bucket, localized", "type": "string" }, "localElevation": { "description": "The starting elevation in the bucket, localized", "type": "string" }, "localHeartRate": { "description": "The starting heart rate in the bucket, localized", "type": "string" }, "localTotalDistance": { "description": "Total distance in all items up to and including this item", "type": "string" }, "speed": { "description": "Speed in this item", "type": "number" }, "totalDistance": { "description": "Total distance in all items up to and including this item", "type": "number" }, "totalDistance2D": { "description": "Total 2D distance in all items up to and including this item", "type": "number" }, "totalDuration": { "description": "Total duration in all items up to and including this item", "type": "integer" }, "totalDurationSeconds": { "description": "The total duration in the bucket, in seconds", "type": "number" }, "unitCount": { "description": "Count of the unit per item", "type": "number" }, "unitName": { "description": "Unit name", "type": "string" } } }, "database.Bucket": { "type": "object", "properties": { "averageSpeed": { "description": "The average speed in the bucket", "type": "number" }, "averageSpeedNoPause": { "description": "The average speed without pause in the bucket", "type": "number" }, "bucket": { "description": "The name of the bucket", "type": "string" }, "distance": { "description": "The total distance in the bucket", "type": "number" }, "duration": { "description": "The total duration in the bucket", "type": "integer" }, "durationSeconds": { "description": "The total duration in the bucket, in seconds", "type": "number" }, "localAverageSpeed": { "description": "The average speed in the bucket, localized", "type": "string" }, "localAverageSpeedNoPause": { "description": "The average speed without pause in the bucket, localized", "type": "string" }, "localDistance": { "description": "The total distance in the bucket, localized", "type": "string" }, "localDuration": { "description": "The total duration in the bucket, localized", "type": "string" }, "localMaxSpeed": { "description": "The max speed in the bucket, localized", "type": "string" }, "localUp": { "description": "The total up elevation in the bucket, localized", "type": "string" }, "maxSpeed": { "description": "The max speed in the bucket", "type": "number" }, "raw_bucket": { "description": "One day in the bucket (for statistic rendering)", "type": "string" }, "up": { "description": "The total up elevation in the bucket", "type": "number" }, "workoutType": { "description": "The type of the workout", "allOf": [ { "$ref": "#/definitions/database.WorkoutType" } ] }, "workouts": { "description": "The number of workouts in the bucket", "type": "integer" } } }, "database.Buckets": { "type": "object", "properties": { "buckets": { "type": "object", "additionalProperties": { "$ref": "#/definitions/database.Bucket" } }, "localWorkoutType": { "type": "string" }, "workoutType": { "$ref": "#/definitions/database.WorkoutType" } } }, "database.Category": { "type": "string", "enum": [ "Hors Catégorie", "Category 1", "Category 2", "Category 3", "Category 4", "Category 5", "Category 6", "Uncategorized" ], "x-enum-varnames": [ "CategoryHorsCategorie", "Category1", "Category2", "Category3", "Category4", "Category5", "Category6", "CategoryUncategorized" ] }, "database.DurationRecord": { "type": "object", "properties": { "date": { "description": "The timestamp of the record", "type": "string" }, "id": { "description": "The workout ID of the record", "type": "integer" }, "value": { "description": "The value of the record", "type": "integer" } } }, "database.Equipment": { "type": "object", "properties": { "active": { "description": "Whether this equipment is active", "type": "boolean" }, "createdAt": { "type": "string" }, "default_for": { "description": "Which workout types to add this equipment by default", "type": "array", "items": { "$ref": "#/definitions/database.WorkoutType" } }, "description": { "description": "More information about the equipment", "type": "string" }, "id": { "type": "integer" }, "name": { "description": "The name of the gear", "type": "string" }, "notes": { "description": "The notes associated with the equipment, in markdown", "type": "string" }, "updatedAt": { "type": "string" }, "user": { "$ref": "#/definitions/database.User" }, "userID": { "description": "The ID of the user who owns the workout", "type": "integer" }, "workouts": { "type": "array", "items": { "$ref": "#/definitions/database.Workout" } } } }, "database.ExtraMetrics": { "type": "object", "additionalProperties": { "type": "number", "format": "float64" } }, "database.Float64Record": { "type": "object", "properties": { "date": { "description": "The timestamp of the record", "type": "string" }, "id": { "description": "The workout ID of the record", "type": "integer" }, "value": { "description": "The value of the record", "type": "number" } } }, "database.GPXData": { "type": "object", "properties": { "checksum": { "description": "The checksum of the content", "type": "array", "items": { "type": "integer" } }, "content": { "description": "The file content", "type": "array", "items": { "type": "integer" } }, "createdAt": { "type": "string" }, "filename": { "description": "The filename of the file", "type": "string" }, "id": { "type": "integer" }, "updatedAt": { "type": "string" }, "workoutID": { "description": "The ID of the workout", "type": "integer" } } }, "database.MapCenter": { "type": "object", "properties": { "lat": { "description": "Latitude", "type": "number" }, "lng": { "description": "Longitude", "type": "number" }, "tz": { "description": "Timezone", "type": "string" } } }, "database.MapData": { "type": "object", "properties": { "address": { "description": "The address of the workout", "allOf": [ { "$ref": "#/definitions/geo.Address" } ] }, "addressString": { "description": "The generic location of the workout", "type": "string" }, "averageCadence": { "description": "The average cadence of the workout", "type": "number" }, "averagePower": { "description": "The average power of the workout", "type": "number" }, "averageSpeed": { "description": "The average speed of the workout", "type": "number" }, "averageSpeedNoPause": { "description": "The average speed of the workout without pausing", "type": "number" }, "center": { "description": "The center of the workout (in coordinates)", "allOf": [ { "$ref": "#/definitions/database.MapCenter" } ] }, "climbs": { "description": "Auto-detected climbs", "type": "array", "items": { "$ref": "#/definitions/database.Segment" } }, "createdAt": { "type": "string" }, "creator": { "description": "The tool that created this workout", "type": "string" }, "details": { "description": "The details of the workout", "allOf": [ { "$ref": "#/definitions/database.MapDataDetails" } ] }, "extraMetrics": { "description": "Extra metrics available", "type": "array", "items": { "type": "string" } }, "id": { "type": "integer" }, "maxCadence": { "description": "The maximum cadence of the workout", "type": "number" }, "maxElevation": { "description": "The maximum elevation of the workout", "type": "number" }, "maxPower": { "description": "The maximum power of the workout", "type": "number" }, "maxSpeed": { "description": "The maximum speed of the workout", "type": "number" }, "minElevation": { "description": "The minimum elevation of the workout", "type": "number" }, "name": { "description": "The name of the workout", "type": "string" }, "pauseDuration": { "description": "The total pause duration of the workout", "type": "integer" }, "start": { "description": "The start time of the workout", "type": "string" }, "stop": { "description": "The stop time of the workout", "type": "string" }, "totalCalories": { "description": "The total calories of the workout", "type": "number" }, "totalDistance": { "description": "The total distance of the workout", "type": "number" }, "totalDistance2D": { "description": "The total 2D distance of the workout", "type": "number" }, "totalDown": { "description": "The total distance down of the workout", "type": "number" }, "totalDuration": { "description": "The total duration of the workout", "type": "integer" }, "totalRepetitions": { "description": "The number of repetitions of the workout", "type": "integer" }, "totalUp": { "description": "The total distance up of the workout", "type": "number" }, "totalWeight": { "description": "The weight of the workout", "type": "number" }, "type": { "description": "The type of the workout", "type": "string" }, "updatedAt": { "type": "string" }, "workoutID": { "description": "The workout this data belongs to", "type": "integer" } } }, "database.MapDataDetails": { "type": "object", "properties": { "createdAt": { "type": "string" }, "id": { "type": "integer" }, "mapDataID": { "description": "The ID of the map data these details belong to", "type": "integer" }, "points": { "description": "The GPS points of the workout", "type": "array", "items": { "$ref": "#/definitions/database.MapPoint" } }, "updatedAt": { "type": "string" } } }, "database.MapPoint": { "type": "object", "properties": { "distance": { "description": "The distance from the previous point", "type": "number" }, "distance2D": { "description": "The 2D distance from the previous point", "type": "number" }, "duration": { "description": "The duration from the previous point", "type": "integer" }, "elevation": { "description": "The elevation of the point", "type": "number" }, "extraMetrics": { "description": "Extra metrics at this point", "allOf": [ { "$ref": "#/definitions/database.ExtraMetrics" } ] }, "lat": { "description": "The latitude of the point", "type": "number" }, "lng": { "description": "The longitude of the point", "type": "number" }, "slopeGrade": { "description": "The grade of the slope at this point", "type": "number" }, "time": { "description": "The time the point was recorded", "type": "string" }, "totalDistance": { "description": "The total distance of the workout up to this point", "type": "number" }, "totalDistance2D": { "description": "The total 2D distance of the workout up to this point", "type": "number" }, "totalDuration": { "description": "The total duration of the workout up to this point", "type": "integer" } } }, "database.Measurement": { "type": "object", "properties": { "createdAt": { "type": "string" }, "date": { "description": "The date of the measurement", "type": "string" }, "height": { "description": "The height of the user, in centimeter", "type": "number" }, "id": { "type": "integer" }, "steps": { "description": "The number of steps taken", "type": "number" }, "updatedAt": { "type": "string" }, "userID": { "description": "The ID of the user who owns the workout", "type": "integer" }, "weight": { "description": "The weight of the user, in kilograms", "type": "number" } } }, "database.Profile": { "type": "object", "properties": { "api_active": { "description": "Whether the user's API key is active", "type": "boolean" }, "auto_import_directory": { "description": "The user's preferred directory for auto-import", "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "language": { "description": "The user's preferred language", "type": "string" }, "prefer_full_date": { "description": "Whether to show full dates in the workout details", "type": "boolean" }, "preferredUnits": { "description": "The user's preferred units", "allOf": [ { "$ref": "#/definitions/database.UserPreferredUnits" } ] }, "show_tabs": { "description": "Whether to show tabs in web UI", "type": "boolean" }, "socials_disabled": { "description": "Whether social sharing buttons are disabled when viewing a workout", "type": "boolean" }, "theme": { "description": "The user's preferred color scheme", "type": "string" }, "timezone": { "description": "The user's preferred timezone", "type": "string" }, "totals_show": { "description": "What workout type of totals to show", "allOf": [ { "$ref": "#/definitions/database.WorkoutType" } ] }, "updatedAt": { "type": "string" }, "userID": { "description": "The ID of the user who owns this profile", "type": "integer" } } }, "database.RouteSegment": { "type": "object", "properties": { "addressString": { "description": "The generic location of the workout", "type": "string" }, "bidirectional": { "description": "Whether the route segment is bidirectional", "type": "boolean" }, "center": { "description": "The center of the workout (in coordinates)", "allOf": [ { "$ref": "#/definitions/database.MapCenter" } ] }, "checksum": { "description": "The checksum of the content", "type": "array", "items": { "type": "integer" } }, "circular": { "description": "Whether the route segment is circular", "type": "boolean" }, "content": { "description": "The file content", "type": "array", "items": { "type": "integer" } }, "createdAt": { "type": "string" }, "dirty": { "description": "Whether the route segment should be recalculated", "type": "boolean" }, "filename": { "description": "The filename of the file", "type": "string" }, "geoAddress": { "description": "The address of the workout", "allOf": [ { "$ref": "#/definitions/geo.Address" } ] }, "id": { "type": "integer" }, "maxElevation": { "description": "The maximum elevation of the workout", "type": "number" }, "minElevation": { "description": "The minimum elevation of the workout", "type": "number" }, "name": { "description": "The name of the workout", "type": "string" }, "notes": { "description": "The notes associated with the workout, in markdown", "type": "string" }, "points": { "description": "The GPS points of the workout", "type": "array", "items": { "$ref": "#/definitions/database.MapPoint" } }, "routeSegmentMatches": { "description": "The matches of the route segment", "type": "array", "items": { "$ref": "#/definitions/database.RouteSegmentMatch" } }, "totalDistance": { "description": "The total distance of the workout", "type": "number" }, "totalDown": { "description": "The total distance down of the workout", "type": "number" }, "totalUp": { "description": "The total distance up of the workout", "type": "number" }, "updatedAt": { "type": "string" } } }, "database.RouteSegmentMatch": { "type": "object", "properties": { "distance": { "description": "The total distance of the route segment for this workout", "type": "number" }, "duration": { "description": "The total duration of the route segment for this workout", "type": "integer" }, "firstID": { "description": "The index of the first point of the route", "type": "integer" }, "lastID": { "description": "The index of the last point of the route", "type": "integer" }, "routeSegment": { "$ref": "#/definitions/database.RouteSegment" }, "routeSegmentID": { "description": "The ID of the route segment", "type": "integer" }, "workout": { "$ref": "#/definitions/database.Workout" }, "workoutID": { "description": "The ID of the workout", "type": "integer" } } }, "database.Segment": { "type": "object", "properties": { "avg_slope": { "type": "number" }, "category": { "$ref": "#/definitions/database.Category" }, "duration": { "type": "integer" }, "end": { "$ref": "#/definitions/database.MapPoint" }, "end_idx": { "type": "integer" }, "gain": { "type": "number" }, "index": { "type": "integer" }, "length_m": { "type": "number" }, "start": { "$ref": "#/definitions/database.MapPoint" }, "start_idx": { "type": "integer" }, "type": { "$ref": "#/definitions/database.SlopeKind" } } }, "database.SlopeKind": { "type": "string", "enum": [ "climb", "descent" ], "x-enum-varnames": [ "SlopeKindClimb", "SlopeKindDescent" ] }, "database.Statistics": { "type": "object", "properties": { "bucketFormat": { "description": "The bucket format in strftime format", "type": "string" }, "buckets": { "description": "The statistics buckets", "type": "object", "additionalProperties": { "$ref": "#/definitions/database.Buckets" } }, "userID": { "description": "The user ID", "type": "integer" } } }, "database.User": { "type": "object", "properties": { "active": { "description": "Whether the user is active", "type": "boolean" }, "admin": { "description": "Whether the user is an admin", "type": "boolean" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "lastVersion": { "description": "Which version of the app the user has last seen and acknowledged", "type": "string" }, "name": { "description": "The user's name", "type": "string" }, "profile": { "description": "The user's profile settings", "allOf": [ { "$ref": "#/definitions/database.Profile" } ] }, "updatedAt": { "type": "string" }, "username": { "description": "The user's username", "type": "string" } } }, "database.UserPreferredUnits": { "type": "object", "properties": { "distance": { "description": "The user's preferred distance unit", "type": "string" }, "elevation": { "description": "The user's preferred elevation unit", "type": "string" }, "height": { "description": "The user's preferred height unit", "type": "string" }, "speed": { "description": "The user's preferred speed unit", "type": "string" }, "weight": { "description": "The user's preferred weight unit", "type": "string" } } }, "database.Workout": { "type": "object", "properties": { "createdAt": { "type": "string" }, "custom_type": { "description": "The type of the workout, custom", "type": "string" }, "data": { "description": "The map data associated with the workout", "allOf": [ { "$ref": "#/definitions/database.MapData" } ] }, "date": { "description": "The timestamp the workout was recorded", "type": "string" }, "dirty": { "description": "Whether the workout has been modified and the details should be re-rendered", "type": "boolean" }, "equipment": { "description": "Which equipment is used for this workout", "type": "array", "items": { "$ref": "#/definitions/database.Equipment" } }, "gpx": { "description": "The file data associated with the workout", "allOf": [ { "$ref": "#/definitions/database.GPXData" } ] }, "id": { "type": "integer" }, "locked": { "description": "Whether the workout's main attributes should be auto-updated", "type": "boolean" }, "name": { "description": "The name of the workout", "type": "string" }, "notes": { "description": "The notes associated with the workout, in markdown", "type": "string" }, "publicUUID": { "description": "UUID to publicly share a workout - this UUID can be rotated", "type": "string" }, "routeSegmentMatches": { "description": "Which route segments match", "type": "array", "items": { "$ref": "#/definitions/database.RouteSegmentMatch" } }, "type": { "description": "The type of the workout", "allOf": [ { "$ref": "#/definitions/database.WorkoutType" } ] }, "updatedAt": { "type": "string" }, "user": { "description": "The user who owns the workout", "allOf": [ { "$ref": "#/definitions/database.User" } ] }, "userID": { "description": "The ID of the user who owns the workout", "type": "integer" } } }, "database.WorkoutBreakdown": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/database.BreakdownItem" } }, "unit": { "type": "string" } } }, "database.WorkoutRecord": { "type": "object", "properties": { "active": { "description": "Whether there is any data in the record", "type": "boolean" }, "averageSpeed": { "description": "The record with the maximum average speed", "allOf": [ { "$ref": "#/definitions/database.Float64Record" } ] }, "averageSpeedNoPause": { "description": "The record with the maximum average speed without pause", "allOf": [ { "$ref": "#/definitions/database.Float64Record" } ] }, "distance": { "description": "The record with the maximum distance", "allOf": [ { "$ref": "#/definitions/database.Float64Record" } ] }, "duration": { "description": "The record with the maximum duration", "allOf": [ { "$ref": "#/definitions/database.DurationRecord" } ] }, "maxSpeed": { "description": "The record with the maximum max speed", "allOf": [ { "$ref": "#/definitions/database.Float64Record" } ] }, "totalUp": { "description": "The record with the maximum up elevation", "allOf": [ { "$ref": "#/definitions/database.Float64Record" } ] }, "workoutType": { "description": "The type of the workout", "allOf": [ { "$ref": "#/definitions/database.WorkoutType" } ] } } }, "database.WorkoutType": { "type": "string", "enum": [ "unknown", "auto", "running", "cycling", "indoor-cycling", "indoor-running", "mountain-biking", "alpine-climbing", "mountaineering", "e-cycling", "horse-riding", "inline-skating", "walking", "skiing", "snowboarding", "swimming", "kayaking", "golfing", "hiking", "push-ups", "sit-ups", "squats", "core", "weight-lifting", "rowing", "table-tennis", "tennis", "ice-skating", "badminton", "football", "dancing", "other" ], "x-enum-varnames": [ "WorkoutTypeUnknown", "WorkoutTypeAutoDetect", "WorkoutTypeRunning", "WorkoutTypeCycling", "WorkoutTypeIndoorCycling", "WorkoutTypeIndoorRunning", "WorkoutTypeMountainBiking", "WorkoutTypeAlpineClimbing", "WorkoutTypeMountaineering", "WorkoutTypeECycling", "WorkoutTypeHorseRiding", "WorkoutTypeInlineSkating", "WorkoutTypeWalking", "WorkoutTypeSkiing", "WorkoutTypeSnowboarding", "WorkoutTypeSwimming", "WorkoutTypeKayaking", "WorkoutTypeGolfing", "WorkoutTypeHiking", "WorkoutTypePushups", "WorkoutTypeSitups", "WorkoutTypeSquats", "WorkoutTypeCore", "WorkoutTypeWeightLifting", "WorkoutTypeRowing", "WorkoutTypeTableTennis", "WorkoutTypeTennis", "WorkoutTypeIceSkating", "WorkoutTypeBadminton", "WorkoutTypeFootball", "WorkoutTypeDancing", "WorkoutTypeOther" ] }, "geo.Address": { "type": "object", "properties": { "city": { "type": "string" }, "country": { "type": "string" }, "countryCode": { "type": "string" }, "county": { "type": "string" }, "formattedAddress": { "type": "string" }, "houseNumber": { "type": "string" }, "postcode": { "type": "string" }, "state": { "type": "string" }, "stateCode": { "type": "string" }, "stateDistrict": { "type": "string" }, "street": { "type": "string" }, "suburb": { "type": "string" } } }, "geojson.Feature": { "type": "object", "properties": { "bbox": { "type": "array", "items": { "type": "number" } }, "geometry": {}, "id": {}, "properties": { "$ref": "#/definitions/geojson.Properties" }, "type": { "type": "string" } } }, "geojson.FeatureCollection": { "type": "object", "properties": { "bbox": { "type": "array", "items": { "type": "number" } }, "features": { "type": "array", "items": { "$ref": "#/definitions/geojson.Feature" } }, "type": { "type": "string" } } }, "geojson.Properties": { "type": "object", "additionalProperties": true } } }