Get started
Quickstart
Add one person to your team and log their first workout on staging. You need the staging key we sent you and a terminal.
- 1
Keep your key in an environment variable
Every sample in these docs reads the key from
AG_API_KEY, so it never ends up in your code.Terminalexport AG_API_KEY=ag_test_your_key_here - 2
See which workouts your team takes
Send only the keys in
activityTypesas a workout'stype.earnsBysays whether it needs a distance or calories.curl "https://dyb5ahy4siv91.cloudfront.net/partner/v1/team" \ -H "Authorization: Bearer $AG_API_KEY" - 3
Add a person
They join your team at once and get a welcome email. Staging only adds addresses we allow, so send us the ones you test with first.
curl -X POST "https://dyb5ahy4siv91.cloudfront.net/partner/v1/users" \ -H "Authorization: Bearer $AG_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "maria.lopez@example.com", "name": "Maria Lopez", "partnerUserId": "emp-1042", "language": "DE" }' - 4
Log a workout
Set
startedAtto a time earlier today and name the person by yourpartnerUserId. The response tells you whether it counted.curl -X POST "https://dyb5ahy4siv91.cloudfront.net/partner/v1/activities" \ -H "Authorization: Bearer $AG_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "partnerUserId": "emp-1042", "externalId": "wk-20261014-0007", "type": "RUNNING", "startedAt": "2026-10-14T05:30:00Z", "durationSeconds": 2700, "distanceMeters": 8200 }'201 Created{ "id": "2b4eb032-c972-4360-a140-b46ad7a08805", "externalId": "wk-20261014-0007", "userId": "3f6c2a1e-8b4d-4e7a-9c15-2d8e6f0a7b93", "type": "RUNNING", "startedAt": "2026-10-14T05:30:00Z", "durationSeconds": 2700, "distanceMeters": 8200, "kilocalories": null, "status": "COUNTED", "impact": { "unit": "TREE", "amount": 0.4, "reducedBy": null }, "teamId": "7a1d9e40-5c2b-4f8e-a6d3-1b0c9e8f2a57", "createdAt": "2026-10-14T06:16:02Z" } - 5
Read the workout back
curl "https://dyb5ahy4siv91.cloudfront.net/partner/v1/activities/wk-20261014-0007" \ -H "Authorization: Bearer $AG_API_KEY"
Prefer clicking to typing?
The playground sends the same calls to staging from your browser. Paste your test key and pick an endpoint.