Update Colleague
curl --request PATCH \
--url https://api.wazper.com/v1/colleagues-update \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"id": "<string>",
"status": "<string>",
"email": "jsmith@example.com"
}
'import requests
url = "https://api.wazper.com/v1/colleagues-update"
payload = {
"id": "<string>",
"status": "<string>",
"email": "jsmith@example.com"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', status: '<string>', email: 'jsmith@example.com'})
};
fetch('https://api.wazper.com/v1/colleagues-update', 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/colleagues-update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'status' => '<string>',
'email' => 'jsmith@example.com'
]),
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/colleagues-update"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"status\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.wazper.com/v1/colleagues-update")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"status\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wazper.com/v1/colleagues-update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"status\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}Endpoints
Update Colleague API
API for updating an existing colleague (potential invitee) entry.
PATCH
/
v1
/
colleagues-update
Update Colleague
curl --request PATCH \
--url https://api.wazper.com/v1/colleagues-update \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"id": "<string>",
"status": "<string>",
"email": "jsmith@example.com"
}
'import requests
url = "https://api.wazper.com/v1/colleagues-update"
payload = {
"id": "<string>",
"status": "<string>",
"email": "jsmith@example.com"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', status: '<string>', email: 'jsmith@example.com'})
};
fetch('https://api.wazper.com/v1/colleagues-update', 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/colleagues-update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'status' => '<string>',
'email' => 'jsmith@example.com'
]),
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/colleagues-update"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"status\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.wazper.com/v1/colleagues-update")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"status\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wazper.com/v1/colleagues-update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"status\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}PATCH /v1/colleagues-update
This endpoint is used to update an existing colleague entry in your organization.
When it is called, it will modify the specified colleague’s information, typically to change their status or email address.
Endpoint URL
The endpoint URL ishttps://api.wazper.com/v1/colleagues-update
HTTP Method
PATCH
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 and the fields to update.{
"id": "string",
"status": "string (optional)",
"email": "string (optional)"
}
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The unique ID of the colleague entry to update. |
status | String | No | New status for the colleague (e.g., “invited”, “deleted”, “joined”). Required if email is not provided. |
email | String | No | New email address for the colleague. Must be a valid email format. Required if status is not provided. |
Example Request (cURL)
curl -X PATCH 'https://api.wazper.com/v1/colleagues-update' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"id": "tbi_xyz789",
"status": "invited"
}'
Success Response (200 OK)
The response contains the updated colleague entry with the modified information.{
"id": "tbi_xyz789",
"name": "Samuel Prospective",
"email": "samuel.p@example.com",
"status": "invited",
"latestAction": "2023-10-27T11: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-27T11:00:00.000Z"
}
Error Responses
-
400 Bad Request - Missing Required Fields:
{ "error": "Required fields missing: id and either status or email are required" } -
400 Bad Request - Invalid Email Format:
{ "error": "Invalid email format" } -
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 - Colleague Not Found:
{ "error": "Colleague with ID tbi_nonexistent not found for client org_abc123xyz." } -
409 Conflict - Duplicate Email:
{ "error": "A colleague with the new email (new.email@example.com) may already exist." } -
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.
- You must provide either a status or email field to update, or both.
- The
latestActiontimestamp is automatically updated when any field is modified. - When updating the email, it must be in a valid email format.
Authorizations
Body
application/json
Response
Colleague updated successfully.
Unique ID of the colleague entry (ToBeInvited table).
Name of the colleague.
Email of the colleague.
Job title.
Current status (e.g., pending, invited, joined).
Creation timestamp.
Company name.
Website URL.
Invite link.
Redirection link.
Photo URL.
Team identifier.
Wazper Client ID.
Email of the user who created this entry.
Timestamp of the last action.
Timestamp of last update.