If you want to build your own integrations, you can quickly subscribe to Papercups events (e.g.
message:created) via webhooks.
This page will walk you through setting up your own webhook URL. Let's get started!
Click the "Add webhook URL" to open the modal which will guide you through setting up your first webhook URL.
Enter the URL that you would like Papercups to notify of new events. After you enter a URL, we will attempt to verify it by sending it a POST request with a request body that looks like:
In order to get your URL verified, it will need to respond with the randomly generated string in the
payload. In a NodeJS backend, this might look something like:
To quickly test that your endpoint is working as expected, the following cURL command should output
PONG. (Note that it assumes your endpoint is called
/api/webhook and is running on
localhost:3000. Be sure to change the URL below to whatever you're using!)
NB: In development, you may need to use a service like ngrok to test your webhook. URLs like
127.0.0.1/api/webhook will not work.
The following events will be sent to your webhook URL once it's verified:
message:created- sent when a message is created
conversation:created- sent when a conversation is created
conversation:updated- sent when a conversation is updated (e.g. closed, assigned, etc)
customer:created(coming soon!) - sent when a customer is created
customer:updated(coming soon!) - sent when a customer is updated
As an example, the
message:created event request body would look something like this:
To see some examples of webhook integrations, check out this demo: https://github.com/papercups-io/webhooks-demo