Delete an activity
DELETE
/api/v1/activities/{activityId}
const url = 'http://localhost:8080/api/v1/activities/activity-9756441741';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url http://localhost:8080/api/v1/activities/activity-9756441741 \ --header 'Authorization: Bearer <token>'Deletes the activity together with its streams, laps, splits, best efforts and import log.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”activityId
required
string
The prefixed activity identifier, activity- included.
Responses
Section titled “Responses”The activity was deleted.
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
message
required
string
Examples
ExampleinvalidToken
{ "error": "invalid_token", "message": "A valid API token is required. Send it in the Authorization header as a Bearer token."}Headers
Section titled “Headers”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
message
required
string
Examples
ExampleunknownActivity
{ "error": "not_found", "message": "Activity \"activity-1\" not found"}This instance runs with IMPORT_MODE=stravaApi
Media typeapplication/json
Every error uses this shape.
object
error
required
A stable, machine readable code.
string
message
required
string
Examples
ExamplewrongImportMode
{ "error": "import_mode_not_files", "message": "Activities can only be deleted when running in file import mode."}