POST
/
v1
/
send-invitation
curl --request POST \
  --url https://api.wazper.com/v1/send-invitation \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "colleagueId": "<string>"
}'
{
"success": true,
"requestId": "<string>",
"invite": {
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"jobTitle": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"companyName": "<string>",
"website": "<string>",
"inviteLink": "<string>",
"redirectionLink": "<string>",
"photo": "<string>",
"team": 123,
"wazClientId": "<string>",
"toBeInvitedById": "jsmith@example.com",
"latestAction": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"emailSent": true,
"emailResult": {
"id": "<string>"
},
"emailError": "<string>"
}

POST /v1/send-invitation

This endpoint is used to send an email invitation to a colleague who has been previously created.

When it is called, it will send an invitation email to the specified colleague and update their status to “invited”.

Endpoint URL

The endpoint URL is https://api.wazper.com/v1/send-invitation

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 the colleague ID.

{
  "colleagueId": "string"
}

Request Fields:

FieldTypeRequiredDescription
colleagueIdStringYesThe unique ID of the colleague entry to invite.

Example Request (cURL)

curl -X POST 'https://api.wazper.com/v1/send-invitation' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
  "colleagueId": "tbi_xyz789"
}'

Success Response (200 OK)

The response indicates whether the invitation was successfully sent and processed.

{
  "success": true,
  "requestId": "req_clx0p...",
  "invite": {
    "id": "tbi_xyz789",
    "name": "Samuel Prospective",
    "email": "samuel.p@example.com",
    "status": "invited",
    "latestAction": "2023-10-27T12:00:00.000Z",
    "jobTitle": "Marketing Lead",
    "companyName": "Innovate Ltd.",
    "website": "https://innovate.com",
    "inviteLink": "https://app.wazper.com/invite",
    "redirectionLink": "https://app.wazper.com/dashboard",
    "photo": null,
    "createdAt": "2023-10-27T10:00:00.000Z",
    "updatedAt": "2023-10-27T12:00:00.000Z"
  },
  "emailSent": true,
  "emailResult": {
    "id": "email_id_123..."
  }
}

Error Responses

  • 400 Bad Request - Missing Colleague ID:

    { "error": "Colleague ID 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 or key not linked to an organization" }
    
  • 403 Forbidden - Waz Disabled:

    { "error": "Waz is currently disabled" }
    
  • 404 Not Found - Invalid Colleague ID:

    { "error": "Invalid or already processed colleague ID" }
    
  • 500 Internal Server Error:

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

Notes

  • This API does not consume credits from your account.
  • This API requires the colleague to have been previously created by the algorithm (when calling user-sync) or using the Create Colleague API.
  • The colleague’s status is updated to “invited”.
  • The invitation email is sent using your organization’s branding and template settings.

Authorizations

X-API-Key
string
header
required

Body

application/json

Response

200
application/json

Invitation process initiated.

The response is of type object.