SendStreak logo
menu

Set the webhook configuration

Replaces the account’s webhook configuration: target URL, authentication, and the events to deliver. The response returns the signing secret - generated on the first save, the stored one on later saves - while account reads always mask it. Use it to verify webhook payload signatures.

Endpoint

PUT https://api.sendstreak.com/v2/accounts/{accountId}/webhooks

All v2 endpoints require a bearer token - see Authentication.

Path parameters

Parameter Type Description
accountId string The account the request is scoped to.

Request body

Field Type Required Description
authType one of: basic, bearer, none yes How SendStreak authenticates against your webhook endpoint.
events array of strings yes Event types to deliver, e.g. message opens or bounces.
passwordOrToken string no Password (basic) or token (bearer) for the webhook endpoint. Write-only.
signingSecret string no Secret for verifying payload signatures. Write-only: returned from the PUT webhooks call, masked on account reads.
url string (uri) yes HTTPS endpoint that receives the webhook deliveries.
username string no Username for basic authentication.

Response

The stored webhook config, including the signing secret.

{
  "authType": "basic",
  "events": [
    "message_bounced"
  ],
  "passwordOrToken": "webhook-bearer-token",
  "signingSecret": "whsec_9f8e7d6c5b4a39281706",
  "url": "https://example.com/webhooks/sendstreak",
  "username": "smtp-user"
}

Errors

Status Description
400 The request body or parameters failed validation.
401 Missing or invalid token, or the token is not authorized for this account/user.

See Errors and rate limits for what error responses look like.

Curl example

curl --location --request PUT 'https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/webhooks' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "authType": "basic",
  "events": [
    "message_bounced"
  ],
  "passwordOrToken": "webhook-bearer-token",
  "signingSecret": "whsec_9f8e7d6c5b4a39281706",
  "url": "https://example.com/webhooks/sendstreak",
  "username": "smtp-user"
}'
Try SendStreak for Free now!