Webhook

Create a new webhook

Creates a new webhook that will be triggered when specific events occur within the project.

Note: The Webhook object is not used for notifying your server when incoming messages are received. To notify a URL when incoming messages are received, you can configure a webhook by creating a Service with type incoming_message_webhook.

post/v1/projects/{project_id}/webhooks

Request

  • Base URL: https://api.telerivet.com
  • URL: https://api.telerivet.com/v1/projects/{project_id}/webhooks
  • Auth: one of:
    • HTTP basic
    • OAuth 2 (authorization code, authorization URL https://telerivet.com/oauth/authorize, token URL https://api.telerivet.com/oauth/token)

Path parameters

project_idstring required

ID of the Project

Request body

urlstring required

URL to send webhook requests to. Must start with https:// or http://.

secretstring

Secret to include when sending webhook requests (up to 200 characters). Telerivet will send the secret in the password field of HTTP basic auth (with username 'telerivet').

eventsstring[]

Array of event types to trigger this webhook. Valid event types are: send_status (message status updates), send_broadcast (broadcast sent), contact_update (contact added/updated/deleted), message_metadata (message metadata updated).

varsobject

Custom variables to store with the webhook

Example request

{
  "url": "https://example.com/webhook",
  "secret": "my-webhook-secret"
}

Response

Successful response

idstring

ID of the webhook

urlstring

URL that webhook requests are sent to

secretstring

Secret included with webhook requests for authentication (sent as HTTP basic auth password with username 'telerivet')

eventsstring[]

Array of event types that trigger this webhook. Possible values: send_status (message status updates), send_broadcast (broadcast sent), contact_update (contact added/updated/deleted), message_metadata (message metadata updated)

varsobject

Custom variables stored for this webhook. Variable names may be up to 32 characters in length and can contain the characters a-z, A-Z, 0-9, and _. Values may be strings, numbers, or boolean (true/false). String values may be up to 4096 bytes in length when encoded as UTF-8. Up to 100 variables are supported per object. Setting a variable to null will delete the variable.

project_idstring

ID of the project this webhook belongs to

Example response

{
  "id": "WH4f3dac27154653e0",
  "url": "https://example.com/webhook",
  "secret": "my-webhook-secret",
  "project_id": "PJ2ad0100821a98bea"
}

Changes

No recorded changes to this operation across all 1 revision of this API.