Skip to main content
PUT
/
v1
/
webhook-subscriptions
/
{id}
curl --request PUT \
  --url https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123 \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "events": ["points.earned", "points.redeemed"],
  "is_active": false
}'
{
  "data": {
    "type": "webhook_subscription",
    "id": "whsub_abc123",
    "attributes": {
      "url": "https://example.com/webhooks/mage",
      "events": ["points.earned", "points.redeemed"],
      "is_active": false,
      "description": "Production points + tier sync",
      "created_at": "2024-01-01T00:00:00.000Z",
      "updated_at": "2024-01-02T00:00:00.000Z"
    }
  }
}
Update a webhook subscription. Send only the fields you want to change. The signing secret is not returned by this endpoint and is never changed here. To issue a new secret, use rotate secret.

Path parameters

ParameterTypeDescription
idstringThe webhook subscription ID

Request body

All fields are optional. Include any subset you want to change.
FieldTypeDescription
urlstringA new HTTPS endpoint. Must be a valid URL
eventsstring[]A non-empty array of events. Valid events: points.earned, points.redeemed, customer.tier_upgrade, customer.tier_downgrade
is_activebooleanSet to false to pause deliveries, true to resume
descriptionstring | nullA new label, or null to clear it

Errors

StatusScenario
400url not a string, url not a valid URL, events empty, one or more events invalid, or invalid JSON
401Missing or invalid API key
403The API key is read-only and cannot perform write operations
404No subscription with this ID exists for the shop
429Rate limit exceeded (6 requests/second)
curl --request PUT \
  --url https://api.mageloyalty.com/v1/webhook-subscriptions/whsub_abc123 \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "events": ["points.earned", "points.redeemed"],
  "is_active": false
}'
{
  "data": {
    "type": "webhook_subscription",
    "id": "whsub_abc123",
    "attributes": {
      "url": "https://example.com/webhooks/mage",
      "events": ["points.earned", "points.redeemed"],
      "is_active": false,
      "description": "Production points + tier sync",
      "created_at": "2024-01-01T00:00:00.000Z",
      "updated_at": "2024-01-02T00:00:00.000Z"
    }
  }
}