Create Webhook

Description

Summary: Creates a new webhook subscription via the TextPeak API.
Details: This endpoint registers a new webhook that will receive event notifications from the TextPeak platform. When a specified trigger event occurs (e.g., message delivery), the platform sends an HTTP request to the configured URL with the event payload. You can customize the webhook's HTTP method, headers, retry behavior, and apply filters to limit which events are forwarded (e.g., only events from specific streams). Additional query parameters can also be appended to the webhook request using the params field. Webhooks can be created in an active or inactive state using the activated flag. Authentication is performed via a TextPeak API key passed in the Authorization header.

Authentication & Scopes

Authentication is handled via a TextPeak API key provided in the Authorization header. No OAuth scopes are defined; access is granted or denied based on the validity of the API key.

MethodDetails
API KeyPass your TextPeak API key directly in the Authorization header value.

Headers

HeaderRequiredDescription
AuthorizationYesYour TextPeak API key that authenticates the request.
Content-TypeYesMust be set to application/json. The API only accepts JSON-formatted request bodies.
acceptYesMust be set to application/json. Indicates that the client expects a JSON response.

Parameters

This endpoint does not use path or query parameters.

Request Body

The request body is a JSON object defining the webhook subscription configuration.

FieldTypeRequiredDescription
namestringYesA human-readable name for the webhook (e.g., "API test", "Delivery Notifications").
urlstringYesThe destination URL that will receive the webhook event payloads (e.g., "https://textpeak.commpeak.com").
webhookTriggerstringYesThe event type that triggers the webhook. Defines which platform events will fire this webhook (e.g., "MESSAGE_DELIVERY").
methodstringYesThe HTTP method used when sending the webhook request to the destination URL (e.g., "POST", "GET").
filterobjectNoAn object containing filter criteria to limit which events trigger the webhook. Only events matching the filter will be forwarded.
paramsobjectNoAn object of key-value pairs appended as additional parameters to the webhook request (e.g., {"send_bulk": 1}).
headersobjectNoAn object of custom HTTP headers to include in the webhook request sent to the destination URL (e.g., {"x-example": "blablabla"}).
retriesintegerNoThe number of retry attempts if the webhook delivery fails. Set to 0 for no retries (e.g., 5).
activatedbooleanYesWhether the webhook is active and will receive events. Set to true to enable or false to create in a disabled state.

Filter Object

FieldTypeDescription
stream_idarrayAn array of stream IDs to filter events by. Only events originating from the specified streams will trigger the webhook (e.g., [3]).

Examples

This endpoint has a saved example demonstrating usage:

  • Create Webhook — Creating a webhook subscription with a trigger, filters, custom headers, retry configuration, and activation status.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
boolean
filter
object
headers
object
string
string
params
object
number
string
string
Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json