Webhooks & support endpoints

Endpoints for delivery webhooks and support tickets, including real-time WebSocket chat.

GET/v1/webhooks

List delivery webhook targets.

AuthPortal token
Request sampleGET /v1/webhooks
No request body.
Response sample200 OK
[
  {
    "id": "wh_123",
    "url": "https://example.com/webhook",
    "active": true
  }
]
POST/v1/webhooks

Create a webhook target. Event types: sms.delivery, sms.inbound, whatsapp.inbound, whatsapp.consent, otp.status, whatsapp.status. Failed deliveries retry automatically with exponential backoff (5xx, 429, timeouts).

AuthPortal token
Parameters
NameTypeDescriptionRequired
urlstringHTTPS endpoint.Yes
secretstringOptional signing secret.No
eventsstring[]Optional event filters. Defaults to sms.delivery only.No
Flow
  1. whatsapp.inbound - user replies, including Yes/No consent button replies.
  2. whatsapp.consent - session opened, declined, or failed (for example insufficient credits).
  3. otp.status - OTP delivery status updates for WhatsApp messages.
  4. whatsapp.status - outbound WhatsApp message delivery receipts.
  5. sms.delivery and sms.inbound - SMS delivery and inbound MO messages.
Request samplePOST /v1/webhooks
{
  "url": "https://example.com/webhook",
  "secret": "shared-secret",
  "events": [
    "whatsapp.inbound",
    "whatsapp.consent",
    "otp.status",
    "whatsapp.status",
    "sms.delivery"
  ]
}
Response sample200 OK
{
  "id": "wh_123",
  "events": [
    "whatsapp.inbound",
    "whatsapp.consent",
    "otp.status",
    "whatsapp.status",
    "sms.delivery"
  ],
  "active": true
}
GET/v1/support/tickets

List support tickets.

AuthPortal token
Request sampleGET /v1/support/tickets
No request body.
Response sample200 OK
[
  {
    "id": "ticket_123",
    "subject": "Cannot send SMS",
    "status": "open"
  }
]
POST/v1/support/tickets

Create a support ticket.

AuthPortal token
Parameters
NameTypeDescriptionRequired
subjectstringTicket subject.Yes
categorystringIssue category.Yes
prioritystringlow, normal, high.Yes
messagestringInitial message.Yes
Request samplePOST /v1/support/tickets
{
  "subject": "Cannot send SMS",
  "category": "delivery",
  "priority": "high",
  "message": "Messages fail."
}
Response sample200 OK
{
  "id": "ticket_123",
  "status": "open"
}
GET/v1/support/tickets/{ticket_id}/messages

List the messages in a support ticket.

AuthPortal token
Request sampleGET /v1/support/tickets/{ticket_id}/messages
No request body.
Response sample200 OK
[
  {
    "id": "msg_123",
    "sender_type": "user",
    "message": "Can you help?",
    "created_at": "2026-05-14T12:00:00Z"
  }
]
POST/v1/support/tickets/{ticket_id}/messages

Send a support ticket reply over HTTP. The real-time chat uses the WebSocket endpoint below when available.

AuthPortal token
Parameters
NameTypeDescriptionRequired
messagestringReply body.Yes
Request samplePOST /v1/support/tickets/{ticket_id}/messages
{
  "message": "Can you check my account?"
}
Response sample200 OK
{
  "id": "msg_124",
  "sender_type": "user",
  "message": "Can you check my account?"
}
POST/v1/support/tickets/{ticket_id}/files

Upload a PDF or image attachment into the support chat. Multipart form data only, maximum 10 MB.

AuthPortal token
Parameters
NameTypeDescriptionRequired
messagestringOptional message body.No
filefilePDF, JPG, PNG, GIF, or WEBP.Yes
Request samplePOST /v1/support/tickets/{ticket_id}/files
{
  "message": "Invoice attached",
  "file": "invoice.pdf"
}
Response sample200 OK
{
  "id": "msg_127",
  "sender_type": "user",
  "message": "Invoice attached",
  "attachments": [
    {
      "filename": "invoice.pdf",
      "content_type": "application/pdf"
    }
  ]
}
GET/v1/support-ticket-files/{file_id}

Download a support chat attachment owned by the connected user.

AuthPortal token
Request sampleGET /v1/support-ticket-files/{file_id}
No request body.
Response sample200 OK
"Binary file stream"
WS/v1/support/tickets/{ticket_id}/ws?token={portal_token}

Open a real-time WebSocket chat for the connected user's ticket. Send JSON with a message field.

AuthPortal token in query string
Parameters
NameTypeDescriptionRequired
messagestringMessage sent by the user over the socket.Yes
Request sampleWS /v1/support/tickets/{ticket_id}/ws?token={portal_token}
{
  "message": "Hello support"
}
Response sample200 OK
{
  "type": "message",
  "ticket_id": "ticket_123",
  "message": {
    "id": "msg_125",
    "sender_type": "user",
    "message": "Hello support"
  }
}
WS/v1/admin/support/tickets/{ticket_id}/ws?token={admin_token}

Open the admin side of the real-time support chat.

AuthAdmin token with support permission
Parameters
NameTypeDescriptionRequired
messagestringMessage sent by the admin over the socket.Yes
Request sampleWS /v1/admin/support/tickets/{ticket_id}/ws?token={admin_token}
{
  "message": "We are checking this now."
}
Response sample200 OK
{
  "type": "message",
  "ticket_id": "ticket_123",
  "message": {
    "id": "msg_126",
    "sender_type": "admin",
    "message": "We are checking this now."
  }
}
POST/v1/admin/support/tickets/{ticket_id}/files

Upload a PDF or image attachment from the admin side of the chat.

AuthAdmin token with support permission
Parameters
NameTypeDescriptionRequired
messagestringOptional message body.No
filefilePDF, JPG, PNG, GIF, or WEBP.Yes
Request samplePOST /v1/admin/support/tickets/{ticket_id}/files
{
  "message": "Receipt attached",
  "file": "receipt.png"
}
Response sample200 OK
{
  "id": "msg_128",
  "sender_type": "admin",
  "message": "Receipt attached",
  "attachments": [
    {
      "filename": "receipt.png",
      "content_type": "image/png"
    }
  ]
}
GET/v1/admin/support-ticket-files/{file_id}

Download a support chat attachment from the admin console.

AuthAdmin token with support permission
Request sampleGET /v1/admin/support-ticket-files/{file_id}
No request body.
Response sample200 OK
"Binary file stream"