Skip Main Navigation
Page Content

Webhooks

A webhook is a way for web apps to get real-time notifications when various objects change in Eventbrite. They are a very effective tool for apps using the Eventbrite API to keep their information up to date.

Currently, the Webhooks provided by Eventbrite track five objects: Attendees, Events, Organizers, Orders, and Venues. Please follow our engineering blog to receive updates about Eventbrite’s Webhook system.

  • Event Actions
    • Publish
    • Unpublish
    • Create
    • Update
  • Order Actions
    • Place
    • Update
    • Refund
  • Attendee Actions
    • Update
    • Check_in
    • Check_out
  • Organizer Actions
    • Update
  • Ticket Class Actions
    • Create
    • Delete
    • Update
  • Venue Actions
    • Update

Prerequisites

In order to use Webhooks, you will need the following:

  • At least one event
  • An Eventbrite API User Key
  • A registered app
  • A public, online web site that can receive webhooks. This can be built in Django, Flask, Rails, Node.js, PHP, or any tool for creating of web pages.

Creating a Webhook

Let’s go to the Webhooks Dashboard and click on the ‘Add webhook’ button.

../../_images/manage_webhooks_1.png

Choose one of your events, enter the URL http://httpbin.org/post, then select both Events and Orders. To save, press the Add Webhook button:

../../_images/add_webhook.png

Warning

When creating your own website that receives webhooks, we recommend sending them to a ‘private, unpublished’ URL. This way your site doesn’t have to worry about bogus messages being received. Also note that if a webhook receives a ‘410 Gone’ response it will automatically unsubscribe from the enpoint which sent the 410 response.

You will be sent to the newly created webhook’s detail page:

../../_images/webhook_detail_1.png

Testing a Webhook

Click on the Test button, which will run a test delivery request for us:

../../_images/webhook_detail_2.png

Look at the small, green ‘200 OK’ button. The ‘200’ and ‘OK’ correspond to one the HTTP status definitions for a standard successful HTTP request. Any webhook delivery request that returns a number beginning with 2 (two) is considered a success.

Go ahead and click on the small, green ‘200 OK’ button, it will expand, displaying the following information:

../../_images/webhook_detail_3.png

The Request Headers and Request Payload are what the Eventbrite Webhooks system sent to the endpoint URL (your site). The Request Payload is valid JSON, which you can parse and use.

Conversely, the Response Headers and Response Body comprise the data sent back by the receiving app. The delivery response is stored for 15 days.

Note

Delivery requests and their responses are stored for 15 days.

Composition of Webhooks

Eventbrite Webhooks are designed to be used in conjunction with the Eventbrite API v3. With that in mind, webhooks are constructed as an HTTP request with the following properties:

  • Sent via the post method
  • application/json mimetype defined in the headers
  • valid JSON payload
Attribute Description
api_url The object whose creation or update triggered the webhook
config.endpoint_url The target URL specified when the Webhook was created.

Example Webhook JSON payload:

{
  "api_url": "https://www.eventbriteapi.com/v3/orders/1234567890/",
  "config": {
    "endpoint_url": "https://myawesomeapp.com/webhook"
  }
}

Failed Webhooks

On occasion, a webhook delivery request will return a number that isn’t in the 2xx pattern. This might have occurred because the target app responded with an error code, too many redirects, or suffered fromlatency issues. When this occurs, the Webhook system will display the request with a small, red button with the appropriate error-level HTTP status code and message.

../../_images/webhook_404_1.png

When a non-2xx patterned response occurs, the Eventbrite Webhooks system will continue to resend the request once every ten minutes until it either receives a success or ten additional attempts are made. This is done to provide app maintainers the opportunity to correct any problems with their system.

You can also manually resend a failed webhook delivery request. Go to the Webhook’s detail page and click on the red failure button. When it expands, there will be a green ‘resend hook’ button.

../../_images/webhook_404_2.png

Deleting Webhooks

If we want to remove a Webhook, go to the Webhook’s detail page and click the big, blue ‘Delete’ button.

../../_images/webhook_detail_1.png

When pressed, we are prompted for confirmation before deletion.

../../_images/webhook_delete.png

Warning

Please think very carefully before deleting webhooks. This action permenantly deletes not just the webhook, but all of its delivery request and delivery response history.