Integration API

ShadoU API

Connect apps, devices, and services to ShadoU.

The ShadoU API allows developers and partner apps to read and write activity data, connect athlete accounts with OAuth 2.0, and build integrations around tracking, analytics, coaching, and social features.

What you can do

  • Connect external apps to a ShadoU account
  • Import activities into ShadoU
  • Export activity data from ShadoU
  • Read athlete profile and activity summaries
  • Sync workout data, posts, and selected account metadata
  • Build coaching, training, and analytics integrations

Supported integration methods

  • OAuth 2.0 authorization
  • GPX file import
  • Strava connect + import
  • Direct API integration
  • Future support may include FIT, TCX, and webhook-based sync

For Athletes

You can import activity files into ShadoU even if your device or app does not have a direct integration yet.

Import a GPX file

You can upload a GPX file manually from the web portal.

  1. Open Activity
  2. Select Import
  3. Choose your .gpx file
  4. Review the detected activity details
  5. Save the activity to your profile

What GPX import includes

  • route points
  • timestamps
  • distance path
  • elevation data when available

Depending on the source, GPX may not include

  • heart rate
  • cadence
  • power
  • stroke rate
  • advanced device metrics

Connect Strava

You can also connect Strava from the import page and pull your recent activities directly into ShadoU without manual GPX export.

  • Connect Strava from Import
  • Authorize ShadoU to read your activities
  • Import recent Strava sessions into the portal

Imported Strava activities are visible and scored, but wallet rewards remain reserved for direct ShadoU app uploads received within 24 hours of the actual activity.

GPX import notes

  • Large files may take longer to process
  • Elevation-based scoring depends on the quality of recorded altitude
  • Duplicate imports may be flagged
  • Invalid or corrupted files may be rejected

Best results

  • export directly from your recording device or trusted app
  • keep timestamps intact
  • avoid heavily edited route files
  • use files with accurate GPS and elevation data

For Developers

OAuth 2.0 with ShadoU

External apps can connect to ShadoU using OAuth 2.0. This allows a user to authorize your application to access their ShadoU account without sharing their password.

Typical OAuth flow

  1. Your app sends the user to the ShadoU authorization page
  2. The user signs in and approves requested permissions
  3. ShadoU redirects back to your application with an authorization code
  4. Your backend exchanges the code for an access token
  5. Your app uses the access token to call the ShadoU API

Supported grant type

  • Authorization Code
  • Authorization Code with PKCE is recommended for public clients and mobile apps

Recommended use cases

  • Mobile apps
  • Web apps
  • Coaching platforms
  • Analytics tools
  • Event and marketplace integrations

Typical scopes

profile:readactivities:readactivities:writesocial:readwallet:readcoaching:readcoaching:write

Only request the scopes your integration actually needs.

Register an App

To use OAuth 2.0, developers must register an application in the ShadoU developer area.

Registration includes

  • Application name
  • Description
  • Redirect URI(s)
  • App website
  • Contact email
  • Requested scopes

After registration

  • client_id
  • client_secret for confidential clients
  • environment details for authorization and token exchange

Redirect URI rules

  • Must exactly match a registered redirect URI
  • HTTPS is required for production
  • Localhost may be allowed in development

Security Requirements

  • Never expose a client secret in public frontend code
  • Use PKCE for mobile and public clients
  • Store tokens securely
  • Use HTTPS only
  • Request the minimum required scopes
  • Refresh and revoke tokens safely

Token handling

  • Access tokens are short-lived
  • Refresh tokens may be used if enabled for your app
  • Revoked or expired tokens must not be retried indefinitely

Activity Import API

Apps that have been authorized by a user may submit activity data to ShadoU through the API.

Expected import behavior

  • sport type
  • start time
  • duration
  • distance
  • route points
  • elevation
  • optional metrics such as heart rate, cadence, and power

Processing behavior

  • validated
  • normalized
  • scored using the ShadoU scoring engine
  • flagged if data appears invalid or unrealistic

Beta endpoint examples

POST /api/auth.php?action=register
POST /api/auth.php?action=login
GET /api/auth.php?action=me
POST /api/auth.php?action=create-token
POST /api/auth.php?action=sync-profile
POST /api/activities.php?action=start
POST /api/activities.php
POST /api/activities.php?action=recalculate
POST /api/workouts.php?action=create
POST /api/workouts.php?action=start
POST /api/workouts.php?action=append-step
POST /api/workouts.php?action=save-effort
POST /api/workouts.php?action=upload-samples
POST /api/workouts.php?action=upload-events
POST /api/workouts.php?action=finish
GET /api/workouts.php?action=list
GET /api/workouts.php?action=detail&id=<uuid>
GET /api/messages.php?action=list
GET /api/messages.php?action=thread&conversation_id=<uuid>
POST /api/messages.php?action=send
POST /api/messages.php?action=mark-read
POST /api/messages.php?action=open
POST /api/social.php?action=wallet-transfer
POST /api/social.php?action=create-post
GET /api/social.php?action=feed
GET /api/social.php?action=list-groups
POST /api/social.php?action=create-group
GET /api/strava.php?action=status
GET /api/strava.php?action=connect
POST /api/strava.php?action=import
curl -X POST https://shadou.top/api/activities.php \
  -H 'Authorization: Bearer shd_xxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "sport_type":"walk",
    "started_at":"2026-04-12T06:00:00Z",
    "ended_at":"2026-04-12T06:42:16Z",
    "duration_seconds":2536,
    "distance_meters":8420,
    "step_count":10240,
    "source_app":"Partner App",
    "source_mode":"immerse",
    "profile_sync":{
      "display_name":"DenisZ",
      "primary_sport":"walk",
      "country_code":"SI"
    }
  }'

The activity ingest endpoint now scores uploads immediately, stores the backend verified scoring version, and in immerse mode can sync profile fields in the same request. For immersive activity social flow, call action=start when recording begins to create the live start post, then upload the completed activity to create the linked completion post. The Android app should show a local Projected Score from SHADOU_ACTIVITY_ALGORITHM.md; the backend Verified Score uses the same formulas after verification.

Workout ingest is now the durable model for ERG, mixed sessions, and future planned training. Use a stable client_workout_id, stable client_step_id for planned steps or repeat groups, stable client_effort_id for actual blocks, and monotonic sample seq values. Finishing a workout links meaningful efforts back to legacy activity rows so existing scoring, feed, and wallet behavior stays compatible.

Walking rules: tracked GPS walking uses 5 SADO / km at 10:00/km before factors. General pedometer-style steps are separate at 1 SADO / 1k steps, capped at 15,000 steps/day. Send step_count when available and use source_mode=general-steps for background daily step sync with a stable external_id per user + UTC day. Same-day background rewards are net of steps already rewarded through tracked activities so the same walking is not paid twice.

For create-post, send a stable client_post_id per submit attempt so double taps and timeout retries return the same post.

Reward policy: manual GPX uploads and Strava imports can still be imported and scored, but Ĺ ADO wallet rewards are only credited for direct ShadoU app uploads received within 24 hours of the activity.

Rate Limits

  • reasonable per-user and per-app limits apply
  • burst abuse may be throttled
  • repeated invalid requests may be blocked

If your integration needs higher limits, contact ShadoU support.

Versioning

The API should be versioned to preserve stability.

/api/v1/...

Breaking changes should only be introduced in a new version.

Errors

200 OK201 Created400 Bad Request401 Unauthorized403 Forbidden404 Not Found429 Too Many Requests

Error responses should include a clear machine-readable code and a human-readable message.

Webhooks

  • new activity created
  • activity updated
  • coach booking events
  • wallet events
  • marketplace events

Need help?

If you are building an integration and need access, testing support, or higher limits, contact the ShadoU team through the developer support section.