Skip to main content

Owner Resources API

Resources represent bookable items at your venue (typically padel courts). As an owner, you can create resources, configure their schedules, set pricing rules, and manage their operational status.

List All My Resources

Retrieve all resources across all venues you own.
curl -X GET https://api.hub.com/api/owner/resources \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

id
string (UUID)
required
Unique identifier for the resource
venueId
string (UUID)
required
ID of the venue this resource belongs to
name
string
required
Resource name (e.g., “Court 1”)
description
string
Detailed description of the resource
type
string
required
Resource type (e.g., PADEL_COURT, TENNIS_COURT)
slotDurationMinutes
integer
required
Duration of each booking slot in minutes
status
string
required
Resource status: ACTIVE, SUSPENDED, PENDING_APPROVAL, REJECTED
rejectReason
string
Reason for rejection (if status is REJECTED)
schedules
array
Array of weekly schedules defining opening hours
priceRules
array
Array of pricing rules based on day type and time
images
array
Array of resource images
createdAt
string (ISO 8601)
required
Creation timestamp
updatedAt
string (ISO 8601)
required
Last update timestamp

Create Resource

Create a new resource (court) at one of your venues.
curl -X POST https://api.hub.com/api/owner/venues/{venueId}/resources \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Court 1",
    "description": "Professional padel court with LED lighting",
    "type": "PADEL_COURT",
    "slotDurationMinutes": 90
  }'

Path Parameters

venueId
string (UUID)
required
ID of the venue to create the resource in

Request Body

name
string
required
Resource name (cannot be blank)
description
string
Detailed description of the resource
type
string
required
Resource type (PADEL_COURT, TENNIS_COURT, etc.)
slotDurationMinutes
integer
required
Duration of each booking slot in minutes (typically 90 for padel)

Response

Returns the created resource object with HTTP status 201 (Created).

Set Schedule

Define opening and closing times for a specific day of the week.
curl -X PUT https://api.hub.com/api/owner/resources/{resourceId}/schedules \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dayOfWeek": "MONDAY",
    "openingTime": "08:00:00",
    "closingTime": "22:00:00"
  }'

Path Parameters

id
string (UUID)
required
Resource ID to set schedule for

Request Body

dayOfWeek
string
required
Day of week: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
openingTime
string (time)
Opening time in HH:mm:ss format. Set to null to close on this day.
closingTime
string (time)
Closing time in HH:mm:ss format. Set to null to close on this day.

Response

Returns the updated resource object with the new schedule included.
To mark a day as closed, set both openingTime and closingTime to null. You need to set the schedule for each day of the week separately.

Add Price Rule

Add a pricing rule based on day type (weekday/weekend) and time range.
curl -X POST https://api.hub.com/api/owner/resources/{resourceId}/price-rules \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dayType": "WEEKEND",
    "startTime": "10:00:00",
    "endTime": "14:00:00",
    "price": 35.00,
    "currency": "EUR"
  }'

Path Parameters

id
string (UUID)
required
Resource ID to add price rule to

Request Body

dayType
string
required
Day type: WEEKDAY or WEEKEND
startTime
string (time)
required
Start time for this price rule (HH:mm:ss)
endTime
string (time)
required
End time for this price rule (HH:mm:ss)
price
number
required
Price for bookings in this time range
currency
string
required
Currency code (e.g., EUR, USD)

Response

Returns the updated resource object with the new price rule included.

Pricing Example

// Peak hours on weekends
{
  "dayType": "WEEKEND",
  "startTime": "10:00:00",
  "endTime": "14:00:00",
  "price": 35.00,
  "currency": "EUR"
}

// Off-peak hours on weekdays
{
  "dayType": "WEEKDAY",
  "startTime": "08:00:00",
  "endTime": "16:00:00",
  "price": 20.00,
  "currency": "EUR"
}

// Evening hours on weekdays
{
  "dayType": "WEEKDAY",
  "startTime": "16:00:00",
  "endTime": "22:00:00",
  "price": 28.00,
  "currency": "EUR"
}

Remove Price Rule

Delete a specific pricing rule from a resource.
curl -X DELETE https://api.hub.com/api/owner/resources/{resourceId}/price-rules/{ruleId} \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
string (UUID)
required
Resource ID
ruleId
string (UUID)
required
Price rule ID to delete

Response

Returns HTTP status 204 (No Content) on success.

Suspend Resource

Temporarily suspend a resource. Suspended resources cannot be booked.
curl -X PATCH https://api.hub.com/api/owner/resources/{resourceId}/suspend \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
string (UUID)
required
Resource ID to suspend

Response

Returns HTTP status 204 (No Content) on success.

Reactivate Resource

Reactivate a previously suspended resource.
curl -X PATCH https://api.hub.com/api/owner/resources/{resourceId}/reactivate \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
string (UUID)
required
Resource ID to reactivate

Response

Returns HTTP status 204 (No Content) on success.

Add Resource Image

Add an image to a resource. Images should be uploaded to your CDN first.
curl -X POST https://api.hub.com/api/owner/resources/{resourceId}/images \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://cdn.example.com/images/court-1.jpg",
    "publicId": "court-1-photo-123"
  }'

Path Parameters

id
string (UUID)
required
Resource ID to add image to

Request Body

url
string
required
Full URL to the image (cannot be blank)
publicId
string
required
Public identifier for the image (cannot be blank)

Response

Returns the updated resource object with the new image included.

Delete Resource Image

Remove an image from a resource.
curl -X DELETE https://api.hub.com/api/owner/resources/{resourceId}/images/{imageId} \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
string (UUID)
required
Resource ID
imageId
string (UUID)
required
Image ID to delete

Response

Returns HTTP status 200 (OK) on success.

Resource Setup Workflow

  1. Create the resource with basic information
  2. Set schedules for each day of the week
  3. Add price rules for different time slots and day types
  4. Add images to showcase the court
  5. Wait for approval (new resources start in PENDING_APPROVAL status)
Resources must have both schedules and price rules configured before they can accept bookings. Ensure you set up the full weekly schedule and pricing structure after creating a resource.

Build docs developers (and LLMs) love