POST
/
v1
/
user-sync
curl --request POST \
  --url https://api.wazper.com/v1/user-sync \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "user": {
    "email": "jsmith@example.com",
    "country": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "name": "<string>",
    "jobTitle": "<string>",
    "inviteLink": "<string>"
  }
}'
{
"success": true,
"status": "processing",
"requestId": "<string>",
"userId": "<string>",
"message": "Request accepted and is being processed asynchronously."
}

POST /v1/user-sync

This endpoint is used to sync a user you have with the Wazper algorithm.

When it is called, it will run the Wazper algorithm to try to find the colleagues of that user.

Endpoint URL

The endpoint URL ishttps://api.wazper.com/v1/user-sync

HTTP Method

POST

Headers

HeaderTypeRequiredDescription
X-API-KeyStringYesYour Wazper API Key.
Content-TypeStringYesMust be application/json.
AcceptStringNoRecommended application/json.

Request Body

The request body must be a JSON object containing a user object.

{
  "user": {
    "email": "string",
    "country": "string",
    "firstName": "string (optional)",
    "lastName": "string (optional)",
    "name": "string (optional)",
    "jobTitle": "string (optional)",
    "inviteLink": "string (optional)"
  }
}

User Object Fields:

FieldTypeRequiredDescription
emailStringYesThe user’s email address. This is used as the primary identifier for creating or updating the user.
countryStringYesThe user’s country. This needs to be a country name, if you are using the API, you need to provide this Information accurately to get accurate results.
firstNameStringNoThe user’s first name.
lastNameStringNoThe user’s last name.
nameStringNoThe user’s full name. If firstName and lastName are provided, they will be concatenated if name is not.
jobTitleStringNoThe user’s job title.
inviteLinkStringNoA custom invite link for the user. If not provided, the client’s default invite link may be used. (in the case where you have an invitation link per user that can be used by his colleagues).

Example Request (cURL)

curl -X POST 'https://api.wazper.com/v1/user-sync' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
  "user": {
    "email": "john.doe@example.com",
    "country": "US",
    "firstName": "John",
    "lastName": "Doe",
    "jobTitle": "Software Engineer"
  }
}'

Success Response (202 Accepted)

The response indicates that the request has been accepted for processing. The actual user synchronization and webhook trigger happen asynchronously.

{
  "success": true,
  "status": "processing",
  "requestId": "req_generated_id",
  "userId": "user_generated_id",
  "message": "Request accepted and is being processed asynchronously."
}

Error Responses

  • 400 Bad Request - User Email Required:

    { "error": "User email is required" }
    
  • 400 Bad Request - User IP/Country Required:

    { "error": "User IP (country) is required" }
    
  • 400 Bad Request - API Key Not Linked:

    { "error": "API Key is not linked to a valid organization." }
    
  • 401 Unauthorized - API Key Required:

    { "error": "API Key is required" }
    
  • 401 Unauthorized - Invalid API Key:

    { "error": "Invalid API Key" }
    
  • 401 Unauthorized - Invalid Organization:

    { "error": "Invalid organization ID" }
    
  • 402 Payment Required - No Credits:

    { "error": "API Key has no remaining credits." }
    
  • 500 Internal Server Error:

    { "success": false, "error": "Internal server error", "details": "The error message from the server." }
    

Notes

  • This API will run the Wazper algorithm to find the colleagues of the user.
  • If the user has a personal email address (gmail, outlook, etc..) the algorithm will not run for him.
  • You are only billed a credit when more than 1 colleague is found.
  • You need to handle the country recognition using the IP of the user for example and pass the name of the country to the API.

Authorizations

X-API-Key
string
header
required

Body

application/json

Response

202
application/json

Request accepted for asynchronous processing.

The response is of type object.