Skip to content

List segments

GET
/api/v1/activities/{activityId}/segments
curl --request GET \
--url http://localhost:8080/api/v1/activities/activity-9756441741/segments \
--header 'Authorization: Bearer <token>'

Lists the segment one activity in the order they were ridden

activityId
required
string

The prefixed activity identifier, activity- included.

All segment efforts of the activity.

Media typeapplication/json
object
segmentEfforts
required
Array<object>
object
id
required
string
segmentId
required
string
name
required

The name of the segment.

string
startDateLocal
required
string
elapsedTimeInSeconds
required
integer
distanceInMeter
required
integer
averagePower
required
number | null
averageHeartRate
required
integer | null
maxHeartRate
required
integer | null
rank
required

The position of this effort among all efforts on the segment, fastest first.

integer | null
pagination
required
object
page
required
integer
size
required
integer
total
required
integer
totalPages
required
integer

Example

{
"segmentEfforts": [
{
"id": "segmentEffort-3159640357452378822",
"segmentId": "segment-17267489",
"name": "Alpe du Zwift",
"startDateLocal": "2023-10-10T10:00:00",
"elapsedTimeInSeconds": 300,
"distanceInMeter": 1500,
"averagePower": 250.5,
"averageHeartRate": 150,
"maxHeartRate": 172,
"rank": 2
}
]
}

The Authorization header was missing, malformed, or did not match the configured key.

Media typeapplication/json

Every error uses this shape.

object
error
required

A stable, machine readable code.

string
Allowed values: invalid_token insufficient_scope missing_file unsupported_media_type unsupported_file_type file_too_large import_mode_not_files file_not_available not_found method_not_allowed bad_request internal_error
message
required
string

Examples

ExampleinvalidToken
{
"error": "invalid_token",
"message": "A valid token is required. Send it in the Authorization header as a Bearer token."
}
WWW-Authenticate
string

No activity with this identifier exists.

Media typeapplication/json

Every error uses this shape.

object
error
required

A stable, machine readable code.

string
Allowed values: invalid_token insufficient_scope missing_file unsupported_media_type unsupported_file_type file_too_large import_mode_not_files file_not_available not_found method_not_allowed bad_request internal_error
message
required
string

Examples

ExampleunknownActivity
{
"error": "not_found",
"message": "Activity \"activity-1\" not found"
}