Sync users
Introduction
This guide shows you how to mirror your system's users into Upheal so that providers, clients, and the provider-client relationships are kept consistent across both platforms.
There are two flows you'll typically run:
- Initial sync — one-time bulk import of all existing providers and clients when you first integrate.
- Ongoing sync — keep both systems aligned as users are created, updated, or removed in your system.
Upheal exposes both V1 and V2 user-management endpoints. This guide uses V2 wherever it exists and falls back to V1 only for endpoints that V2 does not provide.
Rate limits
The user-management endpoints share a default rate limit of 300 requests per minute, per API key. When you exceed it, the API returns 429 Too Many Requests.
Recommendations:
- For an initial sync of thousands of users, process them sequentially or with low concurrency to stay under the limit.
- Implement exponential backoff on
429responses. - The V1 and V2 endpoints share the same limit — splitting calls across versions does not raise the effective ceiling.
Initial sync
Run providers first, then clients. Clients reference providers by Upheal userId, so all providers must exist before you can assign them.
On every create call, pass partnerUserId (your internal ID for the user). Upheal includes it in webhook payloads, which makes incoming events easy to attribute to the right record in your system.
1. Sync providers
For each provider in your system:
Check if the provider already exists. Call
POST /users/checkwith the provider's email.- If
isUserExistsistrue, store the returneduserIdand move on to the next provider. - If
isUserExistsisfalse, continue to step 2.
- If
Create the provider in Upheal. Call
POST /users/providers(V2) with at leastemail,firstName, andlastName. Store the returneduserIdagainst your internal provider record — you'll need it when creating clients.The create response contains an
inviteUrlthat the provider can use to finish setting up their Upheal account.- If providers in your integration also use Upheal's UI directly (for example, to manage notes or join video calls), share
inviteUrlwith them. - If your integration is API-only and providers never interact with Upheal's UI, you can ignore
inviteUrl.
- If providers in your integration also use Upheal's UI directly (for example, to manage notes or join video calls), share
2. Sync clients
Only start this step once all providers have been synced and you have their Upheal userIds on hand.
For each client in your system:
- Check if the client already exists. Call
POST /users/checkwith the client's email (if you have one).- If
isUserExistsistrue, store the returneduserIdand skip to step 3. - If
isUserExistsisfalse, continue to step 2.
- If
- Create the client in Upheal. Call
POST /users/clients(V2). Required fields arefirstName,lastName, andtherapistUserId— settherapistUserIdto the UphealuserIdof the client's primary provider. - Assign additional providers, if needed. If the client sees more than one provider, call
POST /users/{userId}/providers(V1) with the complete list ofproviderUserIds.
POST /users/{userId}/providers is a full-list replace — it replaces every provider currently assigned to the client with the list you submit. Always send the entire list, not just additions or removals.
Keep users in sync
Once the initial sync is done, mirror future changes in your system to Upheal as they happen. Trigger the matching Upheal call on each event in your system.
New provider in your system
Call POST /users/providers (V2) to create the provider in Upheal. Decide whether to share inviteUrl with the provider (same rule as in the initial sync).
New client in your system
Call POST /users/clients (V2) with therapistUserId set to the client's primary provider in Upheal. If the client sees multiple providers, follow up with POST /users/{userId}/providers (V1) and the full list.
User updated in your system
- For fields that apply to any user (such as name, pronoun, date of birth, partner ID), call
PUT /users/{userId}(V2). - For provider-specific fields (
nationalProviderIdentifier,therapyLicence,noteIdentifier,defaultNoteTemplateIds), callPUT /users/providers/{providerUserId}(V2).
Client's providers change
Use this whenever a client's provider assignment changes — adding a provider, removing one, or swapping the only provider for a different one. Call POST /users/{userId}/providers (V1) with the new complete list of provider IDs. Send every provider the client should now see, not only the ones being added or removed.
User leaves your system
Call DELETE /users/{userId} (V1) to remove the user from Upheal. V2 does not currently expose a delete endpoint; use V1 for deletes.