PATCH
/
v1
/
colleagues-update
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"
}'
{
"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 is https://api.wazper.com/v1/colleagues-update

HTTP Method

PATCH

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 and the fields to update.

{
  "id": "string",
  "status": "string (optional)",
  "email": "string (optional)"
}

Request Fields:

FieldTypeRequiredDescription
idStringYesThe unique ID of the colleague entry to update.
statusStringNoNew status for the colleague (e.g., “invited”, “deleted”, “joined”). Required if email is not provided.
emailStringNoNew 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 latestAction timestamp is automatically updated when any field is modified.
  • When updating the email, it must be in a valid email format.

Authorizations

X-API-Key
string
header
required

Body

application/json

Response

200
application/json

Colleague updated successfully.

The response is of type object.