Skip to main content

Overview

Webhooks deliver real-time event notifications from Nexconn to your server over HTTP. Instead of configuring a separate callback URL for each service, you register a single endpoint and select the events you want to receive. Nexconn sends a POST request to that URL whenever a selected event occurs.

Set up webhooks

  1. Log in to the Nexconn Console.

  2. Go to Chat>Chat settings>Webhooks.

  3. Click Config.

    Config the webhooks
  4. Enter your webhook URL (must begin with https:// or http://).

  5. Add the events you want to receive.

  6. Save the configuration.

note

The *:pre_messaging events (message sent before delivery) are only available on Chat Pro plans. The option is disabled if your app is not on a qualifying plan.

IP allowlist

If your network restricts inbound IP addresses, add the following IP addresses to your allowlist. Without this, your server cannot receive webhook deliveries.

  • Singapore: 52.221.93.74, 8.219.168.45, 8.219.93.148, 8.219.215.35, 8.219.43.97, 47.245.124.194, 8.222.167.17, 47.236.149.1, 8.219.217.193, 8.222.202.67, 43.156.138.254, 43.163.81.196, 43.156.239.53
  • North America: 52.41.206.152
  • Saudi Arabia: 8.213.17.80, 8.213.16.171, 8.213.28.96, 101.46.58.181, 80.238.230.175, 101.46.53.241

Event envelope

Every webhook request body is a single JSON object with the following envelope structure. Fields with empty or null values are omitted from the payload.

JSON
{
"type": "user:connection_status",
"id": "550e8400-e29b-41d4-a716-446655440000",
"time": 1730192400000,
"data": [
{ "..." }
]
}
FieldTypeRequiredDescription
typeStringYesEvent type identifier. See Event types.
idStringYesUnique event ID (UUID or Snowflake ID). Use this to correlate with server-side logs.
timeLongYesTime the event was generated, as a Unix timestamp in milliseconds.
dataArrayYesEvent payload. Each element contains the fields specific to the event type. In most cases the array contains one element; the array format allows batched delivery in future revisions.

Verify webhook signatures

Each webhook request includes four signature parameters in the HTTP request headers. Verify these on your server to confirm the request originated from Nexconn and that the payload has not been tampered with.

HeaderTypeDescription
AppKeyStringThe App Key for your application.
NonceStringA random string, up to 18 characters.
TimestampStringUnix timestamp in milliseconds.
SignatureStringData signature. Computed by concatenating App Secret + Nonce + Timestamp and applying SHA1. The result is a lowercase hexadecimal string.

Signature formula

Signature = sha1(AppSecret + Nonce + Timestamp)

Concatenate your App Secret, the Nonce header value, and the Timestamp header value as plain strings (no separators), then apply SHA1. Compare the result against the Signature header value. Discard requests where the values do not match.

Verification example

PHP:

PHP
$appSecret   = 'your-own-app-secret'; // Replace with your App Secret.
$nonce = $_SERVER['HTTP_NONCE'];
$timestamp = $_SERVER['HTTP_TIMESTAMP'];
$signature = $_SERVER['HTTP_SIGNATURE'];

$localSignature = sha1($appSecret . $nonce . $timestamp);

if (strcmp($signature, $localSignature) === 0) {
echo 'OK';
} else {
echo 'Error';
}

Delivery behavior

PropertyValue
HTTP methodPOST
Content-Typeapplication/json
Single-request timeout5 seconds
Retries on timeout2 (3 total attempts per event)
Circuit breakerIf 30 events within a 1-minute window all exhaust retries, Nexconn pauses delivery to that URL for 1 minute, then automatically resumes.
Abnormal offline detectionFor user:connection_status events, when a client loses connectivity without an explicit disconnect, the offline event is delivered within 5 minutes.

A request is considered successful when Nexconn receives any HTTP 2xx response. If the request times out or returns a non-2xx status, Nexconn retries up to two more times. If all attempts fail, the event is not retried further.

Request example

The following shows what Nexconn sends to your webhook URL:

HTTP
POST /webhook HTTP/1.1
Host: example.com
Content-Type: application/json
AppKey: your-app-key
Nonce: 8f3a2b1c
Timestamp: 1709020800000
Signature: a1b2c3d4e5f6...

{"type":"user:connection_status","id":"550e8400-e29b-41d4-a716-446655440001","time":1730192400000,"data":[{"status":"0","userId":"user_001","os":"iOS","time":1730192400000}]}

Event types

The following table lists all available webhook event types. Select the events you need in the console.

User events

Event typeDescriptionReference
user:connection_statusFired when a user connects, disconnects, or logs out.User connection status
user:activation_stateFired when a user is deactivated or reactivated via the server API.User activation state
user:profile_updateFired when a user's profile or metadata is updated.User profile update
user:friendshipFired when a friendship relationship changes (request, accept, reject, remove, or server-initiated add).User friendship

Message events

Event typeDescriptionReference
message:sendFired after a message is successfully sent in any channel type.Message sent
message:deleteFired when a message is recalled (soft-deleted) or permanently deleted.Message deleted
direct_channel:pre_messagingFired before a direct channel message is delivered. Your server can modify or block the message.Pre-messaging
group_channel:pre_messagingFired before a group channel message is delivered. Your server can modify or block the message.Pre-messaging
open_channel:pre_messagingFired before an open channel message is delivered. Your server can modify or block the message.Pre-messaging
community_channel:pre_messagingFired before a community channel message is delivered. Your server can modify or block the message.Pre-messaging

Group channel events

Event typeDescriptionReference
group_channel:changedFired when a group's profile, custom profile, or permissions are updated.Group channel changed
group_channel:operationFired when a member joins, leaves, is kicked, or when the group is created, dissolved, or ownership is transferred.Group channel operation

Open channel events

Event typeDescriptionReference
open_channel:operationFired when a user joins, leaves, or is banned from an open channel, or when an open channel is created or destroyed.Open channel operation
open_channel:metadata_updateFired when a key-value metadata attribute on an open channel is set, updated, or deleted.Open channel metadata update

Channel types

Several event payloads include a channelType field that identifies the channel type. The values are:

ValueChannel type
1Direct channel (one-to-one)
3Group channel
4Open channel
6System channel
10Community channel