Skip to content

Appointments

Endpoints

MethodPathDescription
GET/wpappointments/v1/appointmentsList all appointments
GET/wpappointments/v1/appointments/upcomingList upcoming appointments
POST/wpappointments/v1/appointmentsCreate an appointment (admin)
POST/wpappointments/v1/public/appointmentsCreate an appointment (public)
PUT/PATCH/wpappointments/v1/appointments/{id}Update an appointment
PUT/PATCH/wpappointments/v1/appointments/{id}/cancelCancel an appointment
PUT/PATCH/wpappointments/v1/appointments/{id}/confirmConfirm an appointment
DELETE/wpappointments/v1/appointments/{id}Delete an appointment

All endpoints except POST /public/appointments require the wpa_manage_appointments capability.


GET /appointments

List all appointments with optional pagination and filtering.

Parameters

ParameterTypeRequiredDescription
queryobjectNoQuery filter object passed to AppointmentsQuery::all()

Response

{
"status": "success",
"message": "Appointments fetched successfully",
"data": {
"appointments": [
{
"id": 1,
"service": "Haircut",
"status": "confirmed",
"timestamp": 1711036800,
"duration": 60,
"customerId": 5,
"customer": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
}
}
],
"totalItems": 50,
"totalPages": 5,
"postsPerPage": 10,
"currentPage": 1
}
}

GET /appointments/upcoming

List upcoming (future) appointments.

Parameters

ParameterTypeRequiredDescription
queryobjectNoQuery filter object passed to AppointmentsQuery::upcoming()

Response

Same shape as GET /appointments.


POST /appointments

Create an appointment as an admin user.

Parameters

ParameterTypeRequiredDescription
datestringYesAppointment date/time string (parseable by rest_parse_date)
servicestringYesService name (used as appointment title)
durationintegerYesDuration in minutes
customerobjectNoCustomer data object (name, email, phone)
customerIdintegerNoExisting customer user ID
statusstringNoAppointment status (e.g. confirmed, pending, cancelled)

Response

{
"status": "success",
"message": "Appointment created successfully",
"data": {
"appointment": {
"id": 1,
"service": "Haircut",
"status": "confirmed",
"timestamp": 1711036800,
"duration": 60,
"customerId": 5,
"customer": { "name": "John Doe", "email": "john@example.com", "phone": "+1234567890" }
}
}
}

POST /public/appointments

Create an appointment from the public booking form. No authentication required.

Parameters

ParameterTypeRequiredDescription
datestringYesAppointment date/time string
customerobjectYesCustomer data (name, email, phone)
createAccountbooleanNoWhether to create a WordPress user account for the customer
passwordstringNoPassword for the new account (only when createAccount is true)

Duration, status, and service are resolved from plugin settings (defaultLength, defaultStatus, and the default service).

Response

Same shape as POST /appointments.


PUT/PATCH /appointments/{id}

Update an existing appointment.

Parameters

ParameterTypeRequiredDescription
idintegerYesAppointment ID (URL parameter)
datestringNoUpdated date/time
servicestringNoUpdated service name
durationintegerNoUpdated duration in minutes
statusstringNoUpdated status
customerobjectNoUpdated customer data
customerIdintegerNoUpdated customer user ID

Response

{
"status": "success",
"message": "Appointment updated successfully",
"data": {
"appointment": { ... }
}
}

PUT/PATCH /appointments/{id}/cancel

Cancel an appointment by setting its status to cancelled.

Parameters

ParameterTypeRequiredDescription
idintegerYesAppointment ID (URL parameter)

Response

{
"status": "success",
"message": "Appointment cancelled successfully",
"data": {
"appointmentId": 1
}
}

PUT/PATCH /appointments/{id}/confirm

Confirm a pending appointment.

Parameters

ParameterTypeRequiredDescription
idintegerYesAppointment ID (URL parameter)

Response

{
"status": "success",
"message": "Appointment confirmed successfully",
"data": {
"appointmentId": 1
}
}

DELETE /appointments/{id}

Permanently delete an appointment.

Parameters

ParameterTypeRequiredDescription
idintegerYesAppointment ID (URL parameter)

Response

{
"status": "success",
"message": "Appointment deleted successfully",
"data": {
"appointmentId": 1
}
}