Skip to main content

Update a webhook

Path Parameters
idstringrequired

The webhooks's unique identifier

Parameters
urlstringhttps-urlrequired

An HTTPS URL.

The URL must match the following regular expression: ^https:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)$


enabledbooleanrequired

Determines if events should be sent to the webhook or not. Defaults to true for newly created webhooks. When updating a webhook and the value is not explicitly specified the existing value will be used.


account_idsarray of string

The updated webhook will exclusively push events which belong to the given account identifiers.

If not set, the previous account identifiers filter remains unchanged.

Returns
idstringrequired

The webhook's unique identifier


urlstringhttps-urlrequired

An HTTPS URL.

The URL must match the following regular expression: ^https:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)$


enabledbooleanrequired

Determines if events should be sent to the webhook or not.


account_typeenumrequired

The account's type.

Enum:
  • live
  • test

account_idsarray of string

The webhook will exclusively push events which belong to account identifiers.

Acts as a filter: if not set, events belonging to all the organisation's accounts are pushed.


created_atstringdate-timerequired

An <a href="https://pretty-rfc.herokuapp.com/RFC3339">RFC 3339</a>-formatted timestamp.


secretstringrequired

The last 4 characters of the secret key used to generate the webhook payload HMAC.

  • PUT /webhooks/{id}
  • curl 'https://api.lune.co/v1/webhooks/ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X PUT \
      -d '{
        "url": "https://lune.co",
        "enabled": true,
        "account_ids": [
          "ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz"
        ]
      }'
      
  • Response
  • {
      "id": "ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz",
      "url": "https://lune.co",
      "enabled": true,
      "account_type": "live",
      "account_ids": [
        "ljmkOq7vXd239gAE9WALWQ8ZGVD5ExNz"
      ],
      "created_at": "1985-04-12T23:20:50.52Z",
      "secret": "secret"
    }