Lune Docs Logo

Webhook

Create a webhook

HTTP POST to /v1/webhooks
Request body

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@:%_\+.~#?&\/\/=]*)$

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

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

An account's unique identifier

Response

The webhook's unique identifier

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@:%_\+.~#?&\/\/=]*)$

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

The account's type.

live
test

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.

An account's unique identifier

The webhook's creation timestamp.

The secret key used to generate the webhook payload HMAC.

Errors
This API operation can return the following errors:
HTTP status codeError code
400
api_version_invalid
400
bundle_selection_ratios_invalid
400
bundle_selection_bundle_invalid
400
order_value_invalid
400
bundle_id_invalid
400
id_invalid
400
distance_invalid
400
test_account_name_update_disallowed
400
bundle_selection_ratios_invalid_format
400
address_not_found

List all webhooks

HTTP GET to /v1/webhooks
Query parameters

Filter by account identifiers: return webhooks which push events for the given account identifiers.

Response

You can configure webhook endpoints via the API to be notified about events that occur in your accounts or client accounts.

The webhook's unique identifier

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@:%_\+.~#?&\/\/=]*)$

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

The account's type.

live
test

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.

An account's unique identifier

The webhook's creation timestamp.

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

Errors
This API operation can return the following errors:
HTTP status codeError code
401
429

Get a webhook

HTTP GET to /v1/webhooks/{id}
Query parameters

The webhooks's unique identifier

Response

You can configure webhook endpoints via the API to be notified about events that occur in your accounts or client accounts.

The webhook's unique identifier

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@:%_\+.~#?&\/\/=]*)$

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

The account's type.

live
test

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.

An account's unique identifier

The webhook's creation timestamp.

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

Errors
This API operation can return the following errors:
HTTP status codeError code
401
404
429

Update a webhook

HTTP PUT to /v1/webhooks/{id}
Query parameters

The webhooks's unique identifier

Request body

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@:%_\+.~#?&\/\/=]*)$

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.

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

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

An account's unique identifier

Response

You can configure webhook endpoints via the API to be notified about events that occur in your accounts or client accounts.

The webhook's unique identifier

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@:%_\+.~#?&\/\/=]*)$

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

The account's type.

live
test

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.

An account's unique identifier

The webhook's creation timestamp.

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

Errors
This API operation can return the following errors:
HTTP status codeError code
400
api_version_invalid
400
bundle_selection_ratios_invalid
400
bundle_selection_bundle_invalid
400
order_value_invalid
400
bundle_id_invalid
400
id_invalid
400
distance_invalid
400
test_account_name_update_disallowed
400
bundle_selection_ratios_invalid_format
400
address_not_found

Delete a webhook

HTTP DELETE to /v1/webhooks/{id}
Query parameters

The webhooks's unique identifier

Errors
This API operation can return the following errors:
HTTP status codeError code
204
401
404
429

Rotate a webhook secret

HTTP PUT to /v1/webhooks/{id}/rotate-secretThe existing secret will be invalidated immediately and subsequent webhook payloads will be accompanied by HMACs using the new secret.
Query parameters

The webhooks's unique identifier

Response

The webhook's unique identifier

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@:%_\+.~#?&\/\/=]*)$

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

The account's type.

live
test

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.

An account's unique identifier

The webhook's creation timestamp.

The secret key used to generate the webhook payload HMAC.

Errors
This API operation can return the following errors:
HTTP status codeError code
401
404
429