Skip to content

Your own help desk (custom webhook)

Use this when your help desk is not listed. NuacemOne sends handoffs and customer messages to a URL you host. Your system sends your team’s replies and the close back to a URL NuacemOne gives you. Both directions are JSON, signed with the same secret.

See Live agent handoff for how handoff works.

  • An https endpoint on the public internet that your help desk (or a small service in front of it) runs. NuacemOne will not post to private addresses.
  • A way for your system to post JSON to NuacemOne and sign it with HMAC-SHA256.
  • You are an organisation admin in NuacemOne.
  1. Build an endpoint (the events URL) that accepts the events NuacemOne sends.
  2. Check the X-Nuacem-Signature header on each request before you trust it.
  3. Make your system post events back to NuacemOne when a person joins, replies and closes.
  1. Go to Settings → Channels → Live agents → Own help desk and choose Connect Custom webhook.
  2. Enter:
    • Name: a label.
    • Events URL: your https endpoint, for example https://desk.example.com/hooks/nuacemone.
    • Auth header name (optional, default Authorization) and Auth header value (optional, for example Bearer …): sent with every request when a value is set. Stored encrypted.
  3. Choose Connect. The console shows the Webhook URL and the Signing secret.
  1. Configure your system to post to the Webhook URL and to sign with the secret.
  2. Choose Test connection.

Every request in both directions carries:

X-Nuacem-Signature: sha256=<hex HMAC-SHA256 of the raw request body, using the signing secret>

Compute the HMAC over the exact bytes of the body, before parsing it.

Node.js
const crypto = require('crypto');
const expected = 'sha256=' + crypto.createHmac('sha256', SIGNING_SECRET).update(rawBody).digest('hex');
const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers['x-nuacem-signature'] || ''));
# Python
import hmac, hashlib
expected = "sha256=" + hmac.new(SIGNING_SECRET.encode(), raw_body, hashlib.sha256).hexdigest()
ok = hmac.compare_digest(expected, request.headers.get("X-Nuacem-Signature", ""))

NuacemOne posts JSON to your events URL with these headers: Content-Type: application/json, X-Nuacem-Signature, X-Nuacem-Event (the event type) and your auth header if set. Every event has eventId, connectionId and sentAt (Unix seconds).

Sent when the agent hands over.

{
"type": "conversation.started",
"eventId": "evt_…",
"connectionId": "lac_…",
"sentAt": 1767225600,
"conversationId": "…",
"sessionId": "…",
"channel": "web",
"reason": "Customer asked for a person",
"queue": "…",
"language": "en",
"visitor": { "id": "…", "name": "…", "email": "…", "phone": "…" },
"intro": "…",
"transcript": ["Customer: …", "Assistant: …"]
}

channel is web or whatsapp. Visitor fields may be empty when not known.

Your answer may include your own id for the conversation: {"conversationId": "TICKET-123"}. If it does, NuacemOne uses that id in every later event, and you must use it too. If not, use the conversationId NuacemOne sent.

A message from the customer while a person has the chat.

{ "type": "visitor.message", "eventId": "evt_…", "connectionId": "lac_…", "sentAt": 1767225660,
"conversationId": "…", "text": "…" }

The customer left (for example, closed the chat window).

{ "type": "conversation.closed", "eventId": "evt_…", "connectionId": "lac_…", "sentAt": 1767225720,
"conversationId": "…", "by": "visitor", "text": "…" }

Post JSON to the connection’s Webhook URL, signed as above.

{ "type": "agent.joined", "eventId": "your-unique-id", "conversationId": "…", "agentName": "Priya", "text": "" }
type When Effect
agent.joined A person picks up the chat. The customer sees that the person joined.
agent.message The person writes. Put the reply in text. The reply is shown to the customer with agentName.
conversation.closed The person ends the chat. The agent takes the chat back, or the chat ends, as the agent is set up.
  • conversationId is required. Unknown or already closed conversations are ignored.
  • Give every event a unique eventId. Retries with the same eventId are applied once.
  • text is cut to 4,000 characters and agentName to 120.
  • The body may be at most 256 KB.

NuacemOne answers 200 with {"accepted": 1} (or 0 when the event was ignored, for example while the connection is off).

Choose the connection in an agent’s Live agent handoff card, or in a workflow’s Human agent step, and publish.

  1. Choose Test connection.
  2. Ask a published web chat agent for a person. Check your endpoint receives conversation.started.
  3. Post agent.joined and agent.message and check the customer sees them.
  4. Post conversation.closed and check the agent takes the chat back.
  • Your endpoint checks X-Nuacem-Signature and rejects requests that fail.
  • Your system signs every request to NuacemOne and uses unique eventIds.
  • You store the signing secret in a secret manager, not in code.
  • You use the conversationId you returned (if any) in every event.
  • You have run one full handoff and close.

Request bodies to NuacemOne are limited to 256 KB. Your endpoint should answer quickly; NuacemOne waits only a short time for each request.

Response or symptom Fix
401 invalid_signature “Not verified.” Sign the exact raw body with the current secret. If you made a new secret, update your system.
400 invalid_payload “Send JSON.” Send a JSON body with Content-Type: application/json.
400 invalid_payload “payload is not an object” The body must be a JSON object, not an array or string.
404 not_found “Unknown connection.” Use the Webhook URL from this connection exactly. The connection may have been disconnected.
413 too_large Keep the body under 256 KB.
200 with {"accepted": 0} The connection is off, the type is not one of the three, or conversationId is missing.
Events are accepted but nothing happens The conversationId is wrong (use yours if you returned one) or the chat has already ended.
Your endpoint gets nothing The Events URL must be https and reachable from the internet. Check Test connection.
Your endpoint rejects NuacemOne’s requests Check the auth header name and value on the connection, and verify the signature over the raw body.