Set Channel Webhook

Registers or updates a webhook URL for a specific channel. Once configured, Rampwin will send event notifications to the provided webhook endpoint whenever the selected events occur.

Endpoint

POST /api/integrations/{channel_id}/setWebhook

Base URL

https://api.rampwin.com

Description

This API allows you to configure a webhook endpoint for a channel.

When enabled, Rampwin will automatically send HTTP POST requests to your webhook URL whenever subscribed events are triggered.

Supported events include:

  • Incoming messages
  • Outgoing messages
  • Message status updates
  • Template updates
  • Channel updates

If a webhook already exists for the channel, the configuration will be updated.


Authentication

This API supports:

  • API Key Authentication

Headers

HeaderTypeRequiredDescription
Content-TypestringYesapplication/json
X-API-KeystringYesYour Rampwin API key

Path Parameters

ParameterTypeRequiredDescription
channel_idstringYesChannel ID for which the webhook will be configured

Request Body

Core Fields

FieldTypeRequiredDescription
urlstringYesPublic webhook URL that will receive event notifications
eventsobjectYesList of events to subscribe to

Events Object

FieldTypeRequiredDescription
message_incomingbooleanNoReceive incoming message events
message_outgoingbooleanNoReceive outgoing message events
message_statusbooleanNoReceive message delivery and read status updates
template_updatebooleanNoReceive template status and update events
channel_updatebooleanNoReceive channel configuration update events

Example Request

cURL

curl --location --request POST 'https://api.rampwin.com/api/integrations/YOUR_CHANNEL_ID/setWebhook' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://your-server.com/your-webhook-receiver",
  "events": {
    "message_incoming": true,
    "message_outgoing": true,
    "message_status": true,
    "template_update": true,
    "channel_update": true
  }
}'

Response

Success (200)

{
  "success": true,
  "message": "Webhook configured successfully",
  "data": {
    "channel_id": "YOUR_CHANNEL_ID",
    "url": "https://your-server.com/your-webhook-receiver",
    "events": {
      "message_incoming": true,
      "message_outgoing": true,
      "message_status": true,
      "template_update": true,
      "channel_update": true
    }
  }
}

Error (400)

{
  "success": false,
  "message": "Validation error"
}

Error (401)

{
  "success": false,
  "message": "Unauthorized"
}

Business Logic Notes

  • Only one webhook configuration can exist per channel.
  • Calling this API again will update the existing webhook configuration.
  • The webhook URL must be publicly accessible over HTTPS.
  • Rampwin will send event payloads only for the events enabled in the events object.
  • Disabled events will not trigger webhook notifications.

Common Errors

ErrorDescription
Validation errorMissing or invalid request fields
UnauthorizedInvalid API key
Invalid channelChannel ID does not exist
Invalid webhook URLURL is malformed or inaccessible
Webhook registration failedUnable to save webhook configuration