List, Cancel and Delete Events
Explore how to manage events by listing them with organization IDs, canceling events without pending orders, and deleting events safely using the Eventbrite API. Understand the appropriate API calls and response handling to efficiently maintain your event lifecycle.
We'll cover the following...
List events by organization
Events can be listed in different ways, and we will be listing events by organization_id. The following URL utilizes the GET request method to retrieve all the events organized by an organization:
https://www.eventbriteapi.com/v3/organizations/{organization_id}/events/
The {organiztion_id} is the required input to list the events. It returns a paginated response with a list of events belonging to the provided {organization_id}. Let’s list the events we have created previously.
The above API call returns a list of events, and the events count can be seen under the attribute pagination.object_count.
Cancel an event
The Eventbrite API also provides us with the ability to cancel an event. The event to be canceled should not have any pending or completed orders. The following URL utilizes the POST request method to cancel an event:
https://www.eventbriteapi.com/v3/events/{event_id}/cancel/
The above API call requires {event_id} to cancel an event and returns true or false as a response.
Delete an event
We can also delete an event using the Eventbrite API. The event to be deleted should not have any pending or completed orders. The following URL utilizes the DELETE request method to delete an event:
https://www.eventbriteapi.com/v3/events/{event_id}/
The above API call requires {event_id} to delete an event and returns true or false as a response.