Developer Documentation

Integrate with PencilMe's API and WebMCP tools to build AI-powered booking experiences. Our platform exposes structured, machine-readable interfaces that any AI agent can discover and use.

Base URL: https://booking.redhillsmediafl.cloud

All API responses are JSON. No authentication is required for read-only endpoints. Booking endpoints accept standard JSON request bodies.

REST API

The PencilMe REST API provides access to businesses, services, availability, and booking management. All endpoints are publicly accessible for reading; booking creation requires customer details.

GET/api/businesses

List all businesses registered on PencilMe. Returns an array of business objects with name, slug, description, address, phone, and category.

GET/api/businesses/[slug]

Get detailed information about a specific business, including its services and providers. The slug is the URL-friendly identifier (e.g., capital-cuts).

GET/api/businesses/[slug]/services

List all services offered by a business. Each service includes name, description, duration in minutes, and price in cents.

GET/api/businesses/[slug]/providers

List staff members and providers at a business. Each provider includes name, title, bio, and their schedule.

GET/api/businesses/[slug]/availability?date=YYYY-MM-DD&serviceId=N

Check available appointment slots for a given date and service. Returns an array of time slots with start times and provider information.

POST/api/businesses/[slug]/book

Create a new booking. Requires service_id, start_time (ISO 8601), and customer_name. Optionally include provider_id, customer_email, and customer_phone. Returns a confirmation code.

GET/api/businesses/[slug]/bookings/[id]

Retrieve the status of a specific booking by its ID. Returns booking details including service, provider, time, status, and confirmation code.

PUT/api/businesses/[slug]/bookings/[id]

Update a booking. Send { "action": "cancel" } to cancel, or { "action": "reschedule", "start_time": "ISO 8601" } to reschedule to a new time.

WebMCP Tools

WebMCP is the emerging standard for AI tool use on the web. When an AI agent visits a PencilMe booking page, structured tools are automatically registered via the navigator.modelContext API.

No scraping, no brittle selectors, no custom integrations. Agents discover what actions are available and invoke them directly.

search_services

Search and list services offered by a business. Can filter by an optional text query to find specific services.

Parameters

querystringOptional text to filter services by name or description

check_availability

Look up available appointment slots for a specific service and date. Returns real-time availability from the business's connected booking platform.

Parameters

service_idstringrequiredThe ID of the service to check
datestringrequiredDate to check in YYYY-MM-DD format
provider_idstringOptional specific provider to check

book_appointment

Book an appointment at the business. Creates a confirmed booking and returns a confirmation code that can be used for cancellation or rescheduling.

Parameters

service_idstringrequiredThe ID of the service to book
start_timestringrequiredAppointment start time in ISO 8601 format
customer_namestringrequiredFull name of the customer
provider_idstringPreferred provider ID
customer_emailstringCustomer email for confirmation
customer_phonestringCustomer phone number

get_business_info

Retrieve general information about the business including hours, location, contact details, and policies.

No parameters required.

cancel_booking

Cancel an existing booking using its confirmation code. The booking status will be updated to cancelled and the time slot will be released.

Parameters

confirmation_codestringrequiredThe confirmation code received when booking

Code Example

Here's how an AI agent interacts with a PencilMe booking page using WebMCP:

webmcp-integration.js
// Check if WebMCP is available on this page
if (navigator.modelContext) {

  // 1. Get business info
  const info = await navigator.modelContext
    .invokeTool("get_business_info", {});
  console.log(info.name, info.hours);

  // 2. Search for services
  const services = await navigator.modelContext
    .invokeTool("search_services", {
      query: "haircut"
    });

  // 3. Check availability for a service
  const slots = await navigator.modelContext
    .invokeTool("check_availability", {
      service_id: services[0].id,
      date: "2026-02-20"
    });

  // 4. Book the appointment
  const booking = await navigator.modelContext
    .invokeTool("book_appointment", {
      service_id: services[0].id,
      provider_id: slots[0].provider_id,
      start_time: slots[0].start_time,
      customer_name: "Alex Chen",
      customer_email: "alex@example.com"
    });

  // 5. Confirmation
  console.log("Booked!", booking.confirmation_code);
  // => "HKQW3N7R"
}

Declarative fallback: PencilMe booking pages also include data-webmcp-* attributes on form elements as a declarative fallback for agents that don't support the imperative API. The booking form can be discovered and filled by any agent that understands HTML form semantics.

Ready to integrate?

Get your business on PencilMe and start receiving bookings from AI agents today. Free during beta.