Venue Creation
Learn how to create, update and retrieve a venue using the Eventbrite API.
We'll cover the following
An event can be online or have a venue where it will take place. If we have set the value of online_event
to true
, the event will not have any venue. On the other hand, if we want to conduct the event at a particular place, we need to create a venue object and associate it with the event.
Create venue
The following URL utilizes the POST
request method to create a venue within an organization:
https://www.eventbriteapi.com/v3/organizations/{organization_id}/venues/
Some important request parameters include the following:
Request Parameters
Object | Type | Category | Description |
| String | Required | Name of the venue |
| Enum | Optional | Age bracket for the audience |
| Integer | Optional | Venue audience capacity |
| String | Optional | Google place ID for the venue |
| String | Optional | ID of the organizer from the team associated with the venue |
| String | Optional | Part 1 of the address |
| String | Optional | Part 2 of the address |
| String | Optional | City where the venue is located |
| String | Optional | ISO 3166-2 2- or 3-character region code for the state, province, region, or district |
| String | Optional | Postal code for the venue |
| String | Optional | ISO 3166-1 2-character international code for the country |
| String | Optional | Latitude of the venue address |
| String | Optional | Longitude of the venue address |
Let’s try to create a venue using the API call. You can substitute the values with your own in the request object bodyParameter
.
const endpointUrl = new URL('https://www.eventbriteapi.com/v3/organizations/{{ORGANIZATION_ID}}/venues/');const headerParameters = {'Authorization': 'Bearer {{PRIVATE_TOKEN}}','Content-Type': 'application/json'};const bodyParameters = JSON.stringify({"venue": {"name": "Venue Name","address": {"address_1": "Enter address_1 here","address_2": "Enter address_2 here","city": "city name","country": "US"}}});const options = {method: 'POST',headers: headerParameters,body: bodyParameters,};async function createVenue() {try {const response = await fetch(endpointUrl, options);printResponse(response);} catch (error) {printError(error);}}// Calling function to make API callcreateVenue();
- Line 1: We define the endpoint URL and it has
ORGANIZATION_ID
as the URL parameter. - Line 8–18: We define the request parameters required to create a venue.
- Line 20–24: We set the API call options by specifying the header and body, and by setting the request method as
POST
. - Line 26–33: We create a function called
createVenue
to make an API call using fetch and to handle any exception if it occurs. TheprintResponse
andprintError
are the custom functions to print the respective objects. - Line 36: We invoke the
createVenue
function.
The response object has the same parameters except the following:
Response Fields
Object | Type | Description |
| String | Unique ID of the venue |
| String | Resource URI of the venue |
The response object has separated address attributes and a combined address as localized_multi_line_address_display
. If we have not specified the latitude
and longitude
, the API will find the possible values of latitude
and longitude
from the addresses and assign them.
We can assign the venue id
to an event using the update call or create the venue object beforehand and provide it during the event creation.
Update venue
We can update the details of the venue. The following URL utilizes the POST
request method to update the venue:
https://www.eventbriteapi.com/v3/venues/{venue_id}/
The venue_id
is required to update the venue. We can update every attribute except venue id
. This API call returns the updated object of the venue.
Let’s try an example to update venue.name
and venue.address.city
.
const endpointUrl = new URL('https://www.eventbriteapi.com/v3/venues/{{VENUE_ID}}/');const headerParameters = {'Authorization': 'Bearer {{PRIVATE_TOKEN}}','Content-Type': 'application/json'};const bodyParameters = JSON.stringify({"venue": {"name": "New venue name","address": {"city": "New city name"}}});const options = {method: 'POST',headers: headerParameters,body: bodyParameters,};async function updateVenue() {try {const response = await fetch(endpointUrl, options);printResponse(response);} catch (error) {printError(error);}}// Calling function to make API callupdateVenue();
- Line 1: We define the endpoint URL; it has
VENUE_ID
as the URL parameter. - Line 8–15: We define the request parameters with new values for the venue to update it.
List venues
We can list all the venues within an organization. The following URL utilizes the GET
request method to list the venues:
https://www.eventbriteapi.com/v3/organizations/{organization_id}/venues/
The organization_id
is required for this API call, and it returns a paginated object with a list of venues.
const endpointUrl = new URL('https://www.eventbriteapi.com/v3/organizations/{{ORGANIZATION_ID}}/venues/');const headerParameters = {'Authorization': 'Bearer {{PRIVATE_TOKEN}}','Content-Type': 'application/json'};const options = {method: 'GET',headers: headerParameters,};async function retrieveVenue() {try {const response = await fetch(endpointUrl, options);printResponse(response);} catch (error) {printError(error);}}// Calling function to make API callretrieveVenue();