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>"
}
'import requests
url = "https://api.wazper.com/v1/send-invitation"
payload = { "colleagueId": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({colleagueId: '<string>'})
};
fetch('https://api.wazper.com/v1/send-invitation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wazper.com/v1/send-invitation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'colleagueId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wazper.com/v1/send-invitation"
payload := strings.NewReader("{\n \"colleagueId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wazper.com/v1/send-invitation")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"colleagueId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wazper.com/v1/send-invitation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"colleagueId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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>"
}Endpoints
Send Invitation API
API for sending an email invitation to a colleague.
POST
/
v1
/
send-invitation
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>"
}
'import requests
url = "https://api.wazper.com/v1/send-invitation"
payload = { "colleagueId": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({colleagueId: '<string>'})
};
fetch('https://api.wazper.com/v1/send-invitation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wazper.com/v1/send-invitation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'colleagueId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wazper.com/v1/send-invitation"
payload := strings.NewReader("{\n \"colleagueId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wazper.com/v1/send-invitation")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"colleagueId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wazper.com/v1/send-invitation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"colleagueId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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 ishttps://api.wazper.com/v1/send-invitation
HTTP Method
POST
Headers
| Header | Type | Required | Description |
|---|---|---|---|
X-API-Key | String | Yes | Your Wazper API Key. |
Content-Type | String | Yes | Must be application/json. |
Accept | String | No | Recommended application/json. |
Request Body
The request body must be a JSON object containing the colleague ID.{
"colleagueId": "string"
}
| Field | Type | Required | Description |
|---|---|---|---|
colleagueId | String | Yes | The 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
Body
application/json
ID of the ToBeInvited entry.