v1

latestSwagger 2.02026-07-13151175.7 KB
Webhooks

Update a webhook

post/webhooks/{id}

Request body

namestring required

A text identifier for the webhook. More than one webhook cannot have the same name.

urlstring required

The location of the webhook.

In addition to being a valid URI, the url must also start with http or https.

contactEmailAddressstring

The email address to which emails will be sent if there are problem with invoking the webhook.

The value must be a valid email address. If this value is null, no email will be sent.

It is null by default.

triggerScope'SENT' | 'RECEIVED' required

Specifies when the webhook will be triggered.

Please note the values are case sensitive.

If the value is SENT, the webhook will be called when a status update becomes available for a message you sent (i.e. a mobile terminating (MT) message).

If the value is RECEIVED, the webhook will be called when a message is received (i.e. a mobile originating (MO) message).

Note that this field forces you to create two separate webhook entries if you want to collect all messages. However, you can use the same url for both webhooks if you want.

invokeOption'ONE' | 'MANY'

Specifies how to invoke your webhook.

If the value is ONE the array POSTed to your webhook will contain no more than a single message. Use this option if your webhook logic is unable to handle more than one messages at a time.

If the value is MANY the array POSTed to your webhook can contain up to 10 messages. This is the recommended option. The number of calls made to your webhook would be less and this will speed up your total processing time. If your webhook fails for an invoke that has more than one message, each message in the array will automatically be retried one at a time.

This value defaults to ONE - but it is recommended that you set this property to MANY.

activeboolean

Indicates whether you want the webhook activated.

If the value is true, the webhook at the given url will be invoked with an empty array ([]) as part of the validation process. If the webhook responds with a 2xx status code, the submission is accepted; if not the webhook is not created (or updated).

If the value is false the webhook will be inactive, and it will not be invoked when messages are SENT or RECEIVED.

The default value is true.

onWebAppboolean

Indicates whether you want to show this webhook on the Web App.

Webhooks shown there can be updated by the user that use the public Web site.

The default value is true.

Example request

{
  "name": "My MT Webhook",
  "url": "https://www.example.com",
  "contactEmailAddress": "tech_team@example.com",
  "triggerScope": "SENT",
  "invokeOption": "MANY",
  "active": true,
  "onWebApp": true
}

Response

The properties of the updated webhook

idnumber
namestring
urlstring
contactEmailAddressstring
triggerScopestring
activeboolean
onWebAppboolean

Example response

{
  "id": 234,
  "name": "My MT Webhook",
  "url": "https://www.example.com",
  "contactEmailAddress": "tech_team@example.com",
  "triggerScope": "SENT",
  "active": true,
  "onWebApp": true
}