Setup Instructions
Before you begin, make sure you have Volt Cloud connected. Volt Cloud is how Volt’s server sees the messages of your line, so webhooks do not work without it.
1. Prepare your server
Your endpoint must:
- Use
https://with a valid certificate, on a public address. - Accept a
POSTrequest with a JSON body. - Answer with a
2xxstatus in less than 10 seconds.
Volt does not follow redirects and does not read the response body. Do slow work after you answer.
A minimal endpoint in Node.js:
import express from 'express'
const app = express()
// Keep the raw body: you need the exact bytes to verify the signature.
app.post('/volt', express.raw({ type: 'application/json' }), (req, res) => {
const event = JSON.parse(req.body)
console.log(event.type, event.data)
res.sendStatus(200)
})
app.listen(3000)2. Add the endpoint in Volt
- Open Volt and go to App Store › Developer.
- In Webhooks, paste your URL.
- Choose the events: Messages received, Messages sent, or both.
- Click Validate endpoint.
Volt sends a webhook.test event to your URL. If your server answers 2xx, the endpoint is saved.
3. Save the signing secret
Volt shows the signing secret of the endpoint once. It starts with whsec_. Copy it and store it as a secret on your server. You use it to verify that an event comes from Volt.
If you lose the secret, delete the endpoint and add it again.
4. Send a message
Send a message to your line from another number. Your server receives a message.received event in a few seconds.
Manage your endpoints
Each endpoint in the list shows its status:
- Active: the last event was delivered.
- Failing: the last attempt failed. Volt shows the reason, for example
the server answered 503.
You can change the events of an endpoint with its toggles, send the test event again with Send test, and delete the endpoint. When you delete an endpoint, events that wait for a retry are dropped.