You can choose to receive notification events about your SMS messaging by registering webhooks. This is a step-by-step guide to registering a webhook to receive notification events when a message is sent, finalized, or received.

<aside> 📢

Update

You can now register webhooks through our web portal. In Volt Messaging, navigate to the Webhooks tab in your Account Settings to register new webhooks and update existing connections.

Note: during registration, an automated test request is sent to your webhook URL. Your server must return a successful response (2XX status code) to complete registration.

</aside>

📘 Instructions

First, ensure that you have access to the data necessary for utilizing the Volt GraphQL API:

  1. Have your Volt GraphQL API access token readily available. If you are unsure of where to locate your API token, contact [email protected].
  2. In order to receive webhooks, you will need a publicly accessible HTTP server capable of listening for POST requests. We recommend implementing HTTPS for securely receiving webhook events.

<aside> ➡️

If you register a webhook URL, notification events will be sent to that URL for any phone number belonging to your organization. Any routing based on the sending or receiving phone number, or any other information relating to a message, should be handled as needed within the server that handles the webhook events.

</aside>

To register a URL for receiving webhook notification events, use the Volt GraphQL API:

  1. Set the Authorization header to the value Bearer <token>, replacing <token> with the API access token belonging to your organization.
  2. Construct a GraphQL query using the registerWebhook mutation:
mutation registerWebhook ($url: String!) {
    registerWebhook (url: $url) {
        id
        url
        createdAt
        lastUpdatedAt
    }
}
  1. Construct a JSON object containing the GraphQL variables for the query created in the previous step:
{
  "url": "<https://example.com/webhooks>"
}