Update a Webhook

PATCH

/v1/customers/:id

Updates the webhook with the given ID and provided attributes.


Attributes

url

A valid URL of the endpoint that should receive webhook events.

events

An array of webhook event types that should be sent to the webhook endpoint.

See the list of available event types.

secret

A string used by Lemon Squeezy to sign requests for increased security.

Learn about receiving signed requests.


curl -X "PATCH" "https://api.lemonsqueezy.com/v1/customers/1" \
  -H 'Accept: application/vnd.api+json' \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {api_key}' \
  -d $'{
    "data": {
      "type": "customers",
      "id": "1",
      "attributes": {
        "name": "John Doe",
        "email": "[email protected]",
        "status": "archived"
      }
    }
  }'

Returns

Returns the updated Webhook object.

{
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://api.lemonsqueezy.com/v1/webhooks/1"
  },
  "data": {
    "type": "webhooks",
    "id": "1",
    "attributes": {
      "store_id": 1,
      "url": "https://mysite.com/webhooks/",
      "events": [
        "order_created",
        "order_refunded",
        "subscription_created",
        "subscription_updated",
        "subscription_expired"
      ],
      "last_sent_at": "2022-11-22T07:38:06.000000Z",
      "created_at": "2022-06-07T08:32:47.000000Z",
      "updated_at": "2022-06-07T08:41:37.000000Z",
      "test_mode": false
    },
    "relationships": {
      "store": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/webhooks/1/store",
          "self": "https://api.lemonsqueezy.com/v1/webhooks/1/relationships/store"
        }
      }
    },
    "links": {
      "self": "https://api.lemonsqueezy.com/v1/webhooks/1"
    }
  }
}

Was this page helpful?