Guides
Adding people
Adding a person#
Send their email and name, and your own ID for them as partnerUserId. Then you can log their workouts with your ID and never have to store ours.
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"
}'Adding is safe to repeat. The response depends on who the email belongs to:
| Response | When |
|---|---|
201 + the person | New email. The welcome email goes out. |
200 + the person | The email is already in your team. Safe to retry: nothing changes and no second email goes out. |
409 already_in_team | The email belongs to someone in another team. |
409 team_full | Your team has reached its maximum number of members. |
409 person_unlinked | The person's link to your team ended. It is final: they cannot be added again. |
Pointing at a person#
When you log a workout, name the person with exactly one of these fields:
| Field | Example |
|---|---|
partnerUserId | emp-1042 |
userEmail | maria.lopez@example.com |
userId | 3f6c2a1e-8b4d-4e7a-9c15-2d8e6f0a7b93 |
Your own ID is set when you add the person. If you added someone without one, a later retry of Add a person can set it once; after that it does not change. Anyone who is not in your team, whether they exist or not, gets 404 user_not_found.
Checking on a person#
Look someone up to see whether they are still linked to your team, by our userIdor by your own partnerUserId (an exact match, case included). The answer is the link, not their profile: no name, email or workouts.
curl "https://dyb5ahy4siv91.cloudfront.net/partner/v1/users/3f6c2a1e-8b4d-4e7a-9c15-2d8e6f0a7b93" \
-H "Authorization: Bearer $AG_API_KEY"curl "https://dyb5ahy4siv91.cloudfront.net/partner/v1/users?partnerUserId=emp-1042" \
-H "Authorization: Bearer $AG_API_KEY"status is LINKED or ENDED. ENDED covers every way a link ends, and who ended it and why is not shared. LINKED only means the link exists, not that the person opened the app or got the welcome email. Anyone you did not add gets 404 user_not_found, so a lookup never tells whether an account exists. There is no call to list everyone you added: keep your own list.
The welcome email#
We send it, in the person's language, the moment they join your team. It is a welcome, not an invitation: the account already exists. It tells them:
- That your company added them, and to which team.
- What we receive from you: their name, email and workouts (type, start time, duration, distance, calories). Nothing else.
- That each workout turns into real impact for the team’s project, and that the team and its sponsor see their workouts and totals.
- How to sign into the Active Giving app with the same email, if they want to.
- How to leave the team, and a “this wasn’t me” link if they did not expect it.
Tell your people first
Let your people know before you add them, so the email is no surprise. Your agreement with us covers what you may share and how you inform them.When someone leaves#
A person leaves your team, for good, when they:
- use the “this wasn’t me” or “leave” link in their welcome email,
- leave the team or delete their account in the app,
- are removed by the team’s managers or by us.
That is final. A lookup then says status: "ENDED", and adding them again or sending a workout for them answers 409 person_unlinked: stop sending anything for them. Their past workouts and impact stay.
A 404 for someone you added
If a lookup for someone you added before answers404 user_not_found, their account was deleted. Do not add them again: they asked to leave.See Errors and retries.