Skip to main content

Overview

Blocked time types are reusable templates that define common types of unavailable time periods for your team members. Each type has a name, duration, and optional icon to help categorize and visualize different kinds of blocked times (e.g., “Lunch Break”, “Meeting”, “Personal Time Off”).

Endpoints

Create Blocked Time Type

curl -X POST https://api.reservations.com/api/v1/merchant/blocked-time-types \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Lunch Break",
    "duration": 60,
    "icon": "utensils"
  }'

Request Body

name
string
required
Name of the blocked time type (max 50 characters)
duration
integer
required
Default duration in minutes (must be at least 1)
icon
string
Optional icon identifier for visual representation (max 20 characters)

Response

Returns 201 Created on success with no body.

Update Blocked Time Type

curl -X PUT https://api.reservations.com/api/v1/merchant/blocked-time-types/123 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 123,
    "name": "Extended Lunch",
    "duration": 90,
    "icon": "utensils"
  }'

Path Parameters

id
integer
required
The ID of the blocked time type to update

Request Body

id
integer
required
The blocked time type ID (must match URL parameter)
name
string
required
Updated name (max 50 characters)
duration
integer
required
Updated duration in minutes (must be at least 1)
icon
string
Updated icon identifier (max 20 characters)

Response

Returns 200 OK on success with no body.

Delete Blocked Time Type

curl -X DELETE https://api.reservations.com/api/v1/merchant/blocked-time-types/123 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Path Parameters

id
integer
required
The ID of the blocked time type to delete

Response

Returns 200 OK on success with no body.
Deleting a blocked time type does not delete existing blocked times created from this type. Only the template itself is removed.

Get All Blocked Time Types

curl https://api.reservations.com/api/v1/merchant/blocked-time-types \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

id
integer
Unique identifier for the blocked time type
name
string
Name of the blocked time type
duration
integer
Default duration in minutes
icon
string
Icon identifier for the type

Example Response

[
  {
    "id": 1,
    "name": "Lunch Break",
    "duration": 60,
    "icon": "utensils"
  },
  {
    "id": 2,
    "name": "Meeting",
    "duration": 30,
    "icon": "users"
  },
  {
    "id": 3,
    "name": "Personal Time",
    "duration": 120,
    "icon": "calendar-times"
  }
]

Common Use Cases

Creating Standard Break Types

Create commonly used blocked time types for your organization:
const breakTypes = [
  { name: 'Lunch Break', duration: 60, icon: 'utensils' },
  { name: 'Coffee Break', duration: 15, icon: 'coffee' },
  { name: 'Team Meeting', duration: 30, icon: 'users' }
];

for (const type of breakTypes) {
  await fetch('/api/v1/merchant/blocked-time-types', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(type)
  });
}

Using Types with Blocked Times

Once created, blocked time types can be referenced when creating blocked times to standardize the duration and appearance of recurring unavailable periods.

Best Practices

  • Keep names descriptive: Use clear names like “Lunch Break” instead of “Break 1”
  • Standardize durations: Set realistic default durations that match your typical needs
  • Use meaningful icons: Choose icons that visually represent the type of blocked time
  • Limit the number of types: Create only the types you’ll regularly use to avoid clutter
  • Team consistency: Ensure all team members understand when to use each type

Build docs developers (and LLMs) love