Description
Summary: Updates an existing webhook subscription by its ID via the TextPeak API.
Details: This endpoint modifies the configuration of a specific webhook identified by its unique ID provided as a path parameter. You can update any combination of the webhook's properties, including its name, destination URL, trigger type, HTTP method, filter criteria, custom headers, query parameters, retry behavior, and activation status. The request body should contain the full updated webhook configuration as a JSON object. 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.
| Method | Details |
|---|---|
| API Key | Pass your TextPeak API key directly in the Authorization header value. |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your TextPeak API key that authenticates the request. |
Content-Type | Yes | Must be set to application/json. The API only accepts JSON-formatted request bodies. |
accept | Yes | Must be set to application/json. Indicates that the client expects a JSON response. |
Parameters
This endpoint uses a path parameter to identify the webhook to update.
| Parameter | Type | Required | Location | Description |
|---|---|---|---|---|
id | integer | Yes | Path | The unique identifier of the webhook to update. |
Request Body
The request body is a JSON object containing the updated webhook subscription configuration.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | A human-readable name for the webhook (e.g., "Delivery Notifications"). |
url | string | No | The destination URL that will receive the webhook event payloads (e.g., "https://example.com/webhook"). |
webhookTrigger | string | No | The event type that triggers the webhook. Defines which platform events will fire this webhook (e.g., "SHORT_URL_CLICK", "MESSAGE_DELIVERY", "INCOMING_MESSAGE"). |
method | string | No | The HTTP method used when sending the webhook request to the destination URL (e.g., "POST", "GET"). |
filter | object | No | An object containing filter criteria to limit which events trigger the webhook. Only events matching the filter will be forwarded. |
params | object | No | An object of key-value pairs appended as additional parameters to the webhook request (e.g., {"send_bulk": 2}). |
headers | object | No | An object of custom HTTP headers to include in the webhook request sent to the destination URL (e.g., {"x-example": "value"}). |
retries | integer | No | The number of retry attempts if the webhook delivery fails. Set to 0 for no retries (e.g., 100). |
activated | boolean | No | Whether the webhook is active and will receive events. Set to true to enable or false to disable. |
Filter Object
| Field | Type | Description |
|---|---|---|
stream_id | integer or array | A stream ID or array of stream IDs to filter events by. Only events originating from the specified streams will trigger the webhook (e.g., 3 or [3]). |
Examples
This endpoint has a saved example demonstrating usage:
- Update webhook — Updating an existing webhook subscription with modified trigger, filters, headers, retry configuration, and activation status.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||