Make your product
work with UP.

Workouts

Get the user's workout list

Returns the list of workouts of the current user. This list can be paginated by date or timestamp.
URI Method Response Type Returns
/nudge/api/users/@me/workouts GET application/json Collection>Workout
Parameter Type Description
date int Date, formatted as YYYYMMDD. If omitted, returns the information for today.
page_token int Timestamp used to paginate the list of workouts. The Developer must use the "next" link provided in the "links" section.
start_time int To be used along with end_time. Epoch timestamp that denotes the start of the time range queried for events.
end_time int To be used with start_time. Epoch timestamp that denotes the end of the time range queried for events.
updated_after int Epoch timestamp to list events that are updated later than the timestamp. To be used with start_time to list events that were completed after said start_time.
limit int Maximum number of results to return

Example:

GET https://jawbone.com/nudge/api/v.1.0/users/@me/workouts?start_time=1383289200 HTTP/1.1
Host: jawbone.com
	

Will return:

HTTP 200 Ok
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "items": 
      [{
         "xid": "40F7_htRRnT8Vo7nRBZO1X",
         "title": "Run",
         "type": "workout",
         "sub_type": 2,
         "time_created": 1384963500,
         "time_updated": 1385049599,
         "time_completed": 1385099220,
         "date": 20131121,
         "place_lat": "37.451572",
         "place_lon": "-122.184435",
         "place_acc": 10,
         "place_name": "Gym",
         "route": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
         "image": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
         "snapshot_image": "/nudge/image/e/1385107735/40F7_htRRnT8VJ5BRfj-_A/grEGutn_3mE.png"
         "details": {
            "steps": 5128
            "time": 2460
            "bg_active_time": 2163
            "meters": 5116
            "km": 5.116
            "intensity": 3
            "calories": 691
            "bmr": 56.071321076
            "bg_calories": 448.95380111
            "bmr_calories": 56.071321076
            "tz": "America/Los_Angeles"
         }
      },
      {
      ... more items ....
      }],
      "links": 
      {
         "next": "/nudge/api/v.1.0/users/6xl39CsoVp2KirfHwVq_Fx/workouts?page_token=1384390680"
      },
      “size”: 10
   }   
}
	
Data Value Type Description
xid string Unique ID for this event. Can be used to retrieve data for this specific event, see below.
title string Title of this workout
type string Type of event, in this case a workout.
sub_type int Workout type, see Type table below.
time_created int Epoch timestamp when this workout was created.
time_updated int Epoch timestamp when this workout was updated.
time_completed int Epoch timestamp when this workout was completed.
date int Date when this workout was created, formatted as YYYYMMDD.
place_lat float Latitude of location where workout was logged.
place_lon float Longitude of location where workout was logged.
place_acc int Accuracy of location where workout was logged, in meters.
place_name string Name of location where workout was logged.
route URI Link to the image of route taken for workout (relative, add prefix https://jawbone.com)
image URI Link to the image of this workout (relative, add prefix https://jawbone.com)
snapshot_image URI Link to the image of this workout's intensity (relative, add prefix https://jawbone.com)
steps int Number of steps during this workout. Note steps will only be provided if the user was wearing the physical UP band during workout.
time int Total time for this workout, in seconds.
bg_active_time int Total time in movement as logged by the UP band. Note bg_active_time will only be provided if the user was wearing the physical UP band during workout.
meters int Total distance travelled, in meters.
km int Total distance travelled, in meters.
intensity int Intensity of the workout as selected by the user or 3rd party app. 1 = easy, 2 = moderate, 3 = intermediate, 4 = difficult, 5 = hard
calories int Total calories burned during workout.
bmr int Basal metabolic rate during workout.
bg_calories int Calories burned as logged by the UP band. Note bg_calories will only be provided if the user was wearing the physical UP band during workout.
tz int Time zone when this sleep was logged, Olson format.
size int Number of items in this list.
next URI Link to next page of data (relative, add https://jawbone.com as prefix).
Type Description
1 walk
2 run
3 lift weights
4 cross train
5 nike training
6 yoga
7 pilates
8 body weight exercise
9 crossfit
10 p90x
11 zumba
12 trx
13 swim
14 bike
15 elliptical
16 bar method
17 kinect exercises
18 tennis
19 basketball
20 golf
21 soccer
22 ski snowboard
23 dance
24 hike
25 cross country skiing
26 stationary bike
27 cardio
28 game

Get information about a specific workout

Returns detailed information about the given workout.
URI Method Response Type Returns
/nudge/api/workouts/{xid} GET application/json Workout

Example:

GET https://jawbone.com/nudge/api/v.1.0/workouts/40F7_htRRnT8Vo7nRBZO1X HTTP/1.1
Host: jawbone.com
	

Will return:

HTTP 200 Ok
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Run",
      "type": "workout",
      "sub_type": 2,
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "time_completed": 1385099220,
      "date": 20131121,
      "place_lat": "37.451572",
      "place_lon": "-122.184435",
      "place_acc": 10,
      "place_name": "Gym",
      "route": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
      "image": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
      "snapshot_image": "/nudge/image/e/1385107735/40F7_htRRnT8VJ5BRfj-_A/grEGutn_3mE.png"
      "details": {
         "steps": 5128
         "time": 2460
         "bg_active_time": 2163
         "meters": 5116
         "km": 5.116
         "intensity": 3
         "calories": 691
         "bmr": 56.071321076
         "bg_calories": 448.95380111
         "bmr_calories": 56.071321076
         "tz": "America/Los_Angeles"
   }
}
	

Get the user's workout graphs

Returns the image of the given workout.
URI Method Response Type Returns
/nudge/api/workouts/{xid}/image GET image/png Binary image

Example:

GET https://jawbone.com/nudge/api/v.1.0/workouts/40F7_htRRnT8Vo7nRBZO1X/image HTTP/1.1
Host: jawbone.com
	

Will return:

Binary contents of the image.
	

Get workout intensity

Returns a time-series of the workout intensity during the day. Each entry is a tuple that contains a timestamp, and the average intensity during that period. Currently, it's an arbitrary equidistributed list of timestamps.
URI Method Response Type Returns
/nudge/api/workouts/{xid}/snapshot GET application/json Snapshot

Example:

GET https://jawbone.com/nudge/api/v.1.0/workouts/40F7_htRRnT8Vo7nRBZO1X/snapshot HTTP/1.1
Host: jawbone.com
	

Will return:

HTTP 200 Ok
{
   “meta”:
   {
      “user_xid”: “b9yCLa3f01yf”,
      “message”: “OK”,
      “code”: 200
      "time": 1386296310
   },
   “data”:
   [
      [1312369860, 41],
      [1312369920, 38],
      [1312369980, 0],
      ...
   ]
}
	

Create workout

Creates a new workout.
URI Method Response Type Returns
/nudge/api/users/@me/workouts POST application/json Workout
Parameter Type Description
sub_type int Type of workout (see list below)
time_created int [required] Start time of the workout (seconds since the epoch)
time_completed int End time of the workout (seconds since the epoch)
tz string Timezone where the workout was created.
calories int Number of calories burned during the workout.
distance int Distance traveled during the workout, in meters.
image_url string URL with an image of the workout.
intensity int Intensity of the workout (1 = easy, 2 = moderate, 3 = intermediate, 4 = difficult, 5 = hard).
Type Description
1 walk
2 run
3 lift weights
4 cross train
5 nike training **
6 yoga
7 pilates
8 body weight exercise **
9 crossfit **
10 p90x **
11 zumba **
12 trx **
13 swim
14 bike
15 elliptical
16 bar method **
17 kinect exercises **
18 tennis
19 basketball
20 golf **
21 soccer
22 ski snowboard
23 dance
24 hike
25 cross country skiing
26 stationary bike
27 cardio
28 game

** The UP client currently does not support these workout subtypes. These subtypes will appear as generic workout events on the UP client. But these subtypes can be stored and retrieved via the workouts API.

Example:

POST https://jawbone.com/nudge/api/v.1.0/users/@me/workouts HTTP/1.1
Host: jawbone.com
time_created=1368652731&time_completed=1368656325&sub_type=3&calories=115
	

Will return:

HTTP 201 Created
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Run",
      "type": "workout",
      "sub_type": 2,
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "time_completed": 1385099220,
      "date": 20131121,
      "place_lat": "37.451572",
      "place_lon": "-122.184435",
      "place_acc": 10,
      "place_name": "Gym",
      "route": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
      "image": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
      "snapshot_image": "/nudge/image/e/1385107735/40F7_htRRnT8VJ5BRfj-_A/grEGutn_3mE.png"
      "details": {
         "steps": 5128
         "time": 2460
         "bg_active_time": 2163
         "meters": 5116
         "km": 5.116
         "intensity": 3
         "calories": 691
         "bmr": 56.071321076
         "bg_calories": 448.95380111
         "bmr_calories": 56.071321076
         "tz": "America/Los_Angeles"
   }
}
	

Update workout

Updates an existing workout.
URI Method Response Type Returns
/nudge/api/workouts/{xid}/partialUpdate POST application/json Workout
Parameter Type Description
sub_type int Type of workout (see list below)
time_created int Start time of the workout (seconds since the epoch)
time_completed int End time of the workout (seconds since the epoch)
tz string Timezone where the workout was created.
calories int Number of calories burned during the workout.
distance int Distance traveled during the workout, in meters.
image_url string URL with an image of the workout.
intensity int Intensity of the workout (1 = easy, 2 = moderate, 3 = intermediate, 4 = difficult, 5 = hard).

Example:

POST https://jawbone.com/nudge/api/v.1.0/workouts/{xid}/partialUpdate HTTP/1.1
Host: jawbone.com
sub_type=2&calories=300
	

Will return:

HTTP 200 OK
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Run",
      "type": "workout",
      "sub_type": 2,
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "time_completed": 1385099220,
      "date": 20131121,
      "place_lat": "37.451572",
      "place_lon": "-122.184435",
      "place_acc": 10,
      "place_name": "Gym",
      "route": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
      "image": "/nudge/image/d/3c1b0970533811e39d7f12313d00449a_image.png"
      "snapshot_image": "/nudge/image/e/1385107735/40F7_htRRnT8VJ5BRfj-_A/grEGutn_3mE.png"
      "details": {
         "steps": 5128
         "time": 2460
         "bg_active_time": 2163
         "meters": 5116
         "km": 5.116
         "intensity": 3
         "calories": 691
         "bmr": 56.071321076
         "bg_calories": 448.95380111
         "bmr_calories": 56.071321076
         "tz": "America/Los_Angeles"
   }
}
	

Delete workout event.

Deletes an existing workout event. The event must have been created by the partner for this call to succeed.
URI Method Response Type Returns
/nudge/api/workouts/{xid} DELETE application/json Status

Example:

DELETE https://jawbone.com/nudge/api/v.1.0/workouts/40F7_htRRnT8Vo7nRBZO1X HTTP/1.1
Host: jawbone.com
Content-Type: application/x-www-form-urlencoded
	

Will return:

HTTP 200 OK
{
   "meta": 
   {
      "user_xid": "6xl39CsoVp2KirfHwVq_Fx",
      "message": "OK",
      "code": 200,
      "time": 1351121565
   },
   "data": {}
}