Skip to content

Upload track from third party

POST /v1/track_upload

Upload a track file directly without user authentication, using an upload key.

This endpoint is designed for third-party applications to upload tracks on behalf of users.

Required headers:

  • X-STL-Upload-key — user's unique upload key (generated in user preferences)
  • X-STL-Secret-Key — your application's secret key provided by SportsTrackLive

Required parameters:

  • track[category_id] — category ID (e.g. 1 for paragliding). Mandatory
  • track[imported_file] — track file in GPX or IGC format. Mandatory

Optional parameters:

  • track[track_type] — type of track: "classic_track" (default) or "live_track"
  • track[time_zone] — time zone (e.g. "Europe/Paris", default "UTC")

The track will be automatically queued for analysis after upload.

Request

bash
curl -X POST -H "X-STL-Upload-key: {{upload_key}}" -H "X-STL-Secret-Key: {{secret_key}}" \
  --form 'track[track_type]="classic_track"' \
  --form 'track[category_id]="1"' \
  --form 'track[time_zone]="Europe/Paris"' \
  --form 'track[imported_file]=@"/path/to/your/file.igc"' \
  "https://api.sportstracklive.com/v1/track_upload"
http
POST /v1/track_upload HTTP/1.1
Host: api.sportstracklive.com
Content-Type: multipart/form-data
X-STL-Upload-key: {{upload_key}}
X-STL-Secret-Key: {{secret_key}}

track[track_type]=classic_track
track[category_id]=7
track[time_zone]=Europe/Paris
track[imported_file]=@file.igc

Success response

200 OKapplication/json; charset=utf-8

json
{
    "success": true,
    "track_id": 1312923,
    "status": "status_imported"
}

Error response

401 Unauthorizedapplication/json; charset=utf-8

json
{
    "code": "invalid_upload_key",
    "error": "Invalid or missing upload key"
}