Upsert a user and enroll them in a program

Create or update a user based on a set of matching criteria, then create a draft enrollment in a program, in a single call.

The endpoint searches for an existing user using the match_by block. firstname and lastname are required. Any additional criterion provided narrows the search (AND semantics): the more criteria are sent, the more precise the identification. Comparison on firstname and lastname is case-insensitive and accent-insensitive, with leading and trailing whitespace trimmed. Other criteria are compared strictly.

If exactly one user matches all the provided criteria, their data is updated from the user payload.
If no user matches, a new user is created from the user payload.
If more than one user matches, the call is rejected with a 409 and no write is performed.
A draft program enrollment is then created on the program referenced by program_identifier. The endpoint is idempotent on identical replays: if the resolved user is already enrolled on that program, the existing enrollment is returned as-is instead of creating a duplicate.

Designed for SIRH-like integrations that need to push a user into a HeyTeam program in one HTTP call.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Matching criteria, target program and user data

match_by
object
required

Matching criteria used to find an existing user.
firstname and lastname are required.
Any of the optional criteria may also be provided; when present, they are combined in AND with the mandatory ones to narrow the search.
Sending only firstname and lastname can lead to a 409 if several users share the same name in the company.

integer
required

Identifier of the target program to enroll the user into.

user
object
required

User attributes used for creation or update.
On creation, firstname, lastname and at least one of professional_email or personal_email are required.
On update, every field provided in this block overwrites the current value on the matched user; fields absent from the payload are preserved as they are in the database.

Responses

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json