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.
Before you start
Section titled “Before you start”- 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.
In your help desk
Section titled “In your help desk”- Build an endpoint (the events URL) that accepts the events NuacemOne sends.
- Check the
X-Nuacem-Signatureheader on each request before you trust it. - Make your system post events back to NuacemOne when a person joins, replies and closes.
In NuacemOne
Section titled “In NuacemOne”- Go to Settings → Channels → Live agents → Own help desk and choose Connect Custom webhook.
- 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 exampleBearer …): sent with every request when a value is set. Stored encrypted.
- Choose Connect. The console shows the Webhook URL and the Signing secret.
- Configure your system to post to the Webhook URL and to sign with the secret.
- Choose Test connection.
Signing
Section titled “Signing”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.
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'] || ''));# Pythonimport hmac, hashlibexpected = "sha256=" + hmac.new(SIGNING_SECRET.encode(), raw_body, hashlib.sha256).hexdigest()ok = hmac.compare_digest(expected, request.headers.get("X-Nuacem-Signature", ""))Events NuacemOne sends
Section titled “Events NuacemOne sends”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).
conversation.started
Section titled “conversation.started”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.
visitor.message
Section titled “visitor.message”A message from the customer while a person has the chat.
{ "type": "visitor.message", "eventId": "evt_…", "connectionId": "lac_…", "sentAt": 1767225660, "conversationId": "…", "text": "…" }conversation.closed
Section titled “conversation.closed”The customer left (for example, closed the chat window).
{ "type": "conversation.closed", "eventId": "evt_…", "connectionId": "lac_…", "sentAt": 1767225720, "conversationId": "…", "by": "visitor", "text": "…" }Events you send to NuacemOne
Section titled “Events you send to NuacemOne”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. |
conversationIdis required. Unknown or already closed conversations are ignored.- Give every event a unique
eventId. Retries with the sameeventIdare applied once. textis cut to 4,000 characters andagentNameto 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).
Use it
Section titled “Use it”Choose the connection in an agent’s Live agent handoff card, or in a workflow’s Human agent step, and publish.
Test it
Section titled “Test it”- Choose Test connection.
- Ask a published web chat agent for a person. Check your endpoint receives
conversation.started. - Post
agent.joinedandagent.messageand check the customer sees them. - Post
conversation.closedand check the agent takes the chat back.
Go-live checklist
Section titled “Go-live checklist”- Your endpoint checks
X-Nuacem-Signatureand 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
conversationIdyou returned (if any) in every event. - You have run one full handoff and close.
Limits and costs
Section titled “Limits and costs”Request bodies to NuacemOne are limited to 256 KB. Your endpoint should answer quickly; NuacemOne waits only a short time for each request.
Troubleshooting
Section titled “Troubleshooting”| 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. |