Skip to main content

List Active Venues

Retrieve all active venues with their resource counts.
curl -X GET "https://api.hub.example/api/venues" \
  -H "Content-Type: application/json"

Response

id
string (UUID)
required
Unique identifier for the venue
ownerId
string (UUID)
required
ID of the venue owner
name
string
required
Venue name
description
string
Venue description
street
string
required
Street address
city
string
required
City
country
string
required
Country
postalCode
string
Postal/ZIP code
latitude
number
required
Latitude coordinate
longitude
number
required
Longitude coordinate
status
string
required
Venue status (ACTIVE, SUSPENDED, PENDING_APPROVAL, REJECTED)
rejectReason
string
Reason for rejection if status is REJECTED
images
array
Array of venue images
id
string (UUID)
Image identifier
url
string
Image URL
publicId
string
Public ID for CDN reference
resourceCount
integer
Number of active resources at this venue
createdAt
string (ISO 8601)
required
Creation timestamp
updatedAt
string (ISO 8601)
required
Last update timestamp

Get Venue by ID

Retrieve detailed information about a specific venue.
curl -X GET "https://api.hub.example/api/venues/{id}" \
  -H "Content-Type: application/json"

Path Parameters

id
string (UUID)
required
The unique identifier of the venue

Response

Returns a single venue object with the same structure as the List Active Venues response.

Create Venue (Owner)

Create a new venue. Requires owner authentication.
This endpoint requires owner-level authentication. The venue will be associated with the authenticated user.
curl -X POST "https://api.hub.example/api/owner/venues" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "name": "Padel Club Central",
    "description": "Premier padel facility in the city center",
    "street": "123 Main Street",
    "city": "Barcelona",
    "country": "Spain",
    "postalCode": "08001",
    "latitude": 41.3851,
    "longitude": 2.1734
  }'

Request Body

name
string
required
Venue name (must not be blank)
description
string
Detailed description of the venue
street
string
required
Street address (must not be blank)
city
string
required
City name (must not be blank)
country
string
required
Country name (must not be blank)
postalCode
string
Postal or ZIP code
latitude
number
required
Latitude coordinate (-90 to 90)
longitude
number
required
Longitude coordinate (-180 to 180)

Response

Returns the created venue object (201 Created).

Update Venue (Owner)

Update an existing venue. Requires owner authentication.
curl -X PUT "https://api.hub.example/api/owner/venues/{id}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "name": "Padel Club Central Updated",
    "description": "Updated description",
    "street": "123 Main Street",
    "city": "Barcelona",
    "country": "Spain",
    "postalCode": "08001",
    "latitude": 41.3851,
    "longitude": 2.1734
  }'

Path Parameters

id
string (UUID)
required
The unique identifier of the venue to update

Request Body

Same as Create Venue request body.

Response

Returns the updated venue object (200 OK).

Suspend Venue (Owner)

Temporarily suspend a venue, making it unavailable for bookings.
curl -X PATCH "https://api.hub.example/api/owner/venues/{id}/suspend" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
string (UUID)
required
The unique identifier of the venue to suspend

Response

Returns 204 No Content on success.

Reactivate Venue (Owner)

Reactivate a previously suspended venue.
curl -X PATCH "https://api.hub.example/api/owner/venues/{id}/reactivate" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
string (UUID)
required
The unique identifier of the venue to reactivate

Response

Returns 204 No Content on success.

Get My Venues (Owner)

Retrieve all venues owned by the authenticated user.
curl -X GET "https://api.hub.example/api/owner/venues" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

Returns an array of venue objects associated with the authenticated owner.

Add Venue Image (Owner)

Add an image to a venue.
Images should be uploaded to your CDN (e.g., Cloudinary) first, then the URL and public ID should be submitted to this endpoint.
curl -X POST "https://api.hub.example/api/owner/venues/{id}/images" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "url": "https://cdn.example.com/images/venue-court-1.jpg",
    "publicId": "venues/venue_abc123"
  }'

Path Parameters

id
string (UUID)
required
The unique identifier of the venue

Request Body

url
string
required
Full URL to the image (must not be blank)
publicId
string
required
Public identifier from your CDN (must not be blank)

Response

Returns the updated venue object with the new image included.

Delete Venue Image (Owner)

Remove an image from a venue.
curl -X DELETE "https://api.hub.example/api/owner/venues/{id}/images/{imageId}" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
string (UUID)
required
The unique identifier of the venue
imageId
string (UUID)
required
The unique identifier of the image to remove

Response

Returns 204 No Content on success.