Skip to main content

Overview

The Appointments API allows you to create, manage, and track veterinary appointments with intelligent scheduling and triage integration.

The Appointment Object

id
string
required
Unique identifier for the appointment
petId
string
required
ID of the pet
petName
string
required
Pet’s name (denormalized for performance)
ownerId
string
required
ID of the pet owner
ownerName
string
required
Owner’s full name
vetId
string
required
ID of the assigned veterinarian
type
enum
required
Appointment type: wellness, urgent, emergency, dental, surgery, grooming, follow_up
reason
string
Reason for visit
symptoms
string[]
default:"[]"
List of reported symptoms
triageLevel
enum
required
Triage urgency: emergency, urgent, routine, info
scheduledDate
string
required
Appointment date (YYYY-MM-DD)
scheduledTime
string
required
Appointment time (HH:MM)
durationMinutes
number
default:"30"
Expected duration in minutes
status
enum
default:"pending"
Status: pending, scheduled, confirmed, checked_in, in_progress, completed, cancelled, no_show, rescheduled
notes
string
Internal appointment notes
diagnosis
string
Diagnosis (filled after appointment)
treatmentNotes
string
Treatment notes
prescriptions
string[]
Prescribed medications
followUpDate
string
Follow-up appointment date
callId
string
Associated voice call ID (if booked via AI)
confirmationSent
boolean
default:"false"
Whether confirmation was sent
reminder24hSent
boolean
default:"false"
Whether 24h reminder was sent
reminder2hSent
boolean
default:"false"
Whether 2h reminder was sent
createdAt
string
Creation timestamp
updatedAt
string
Last update timestamp

List Appointments

curl -X GET "http://localhost:3000/api/appointments?date=2024-12-15&status=confirmed" \
  -H "Authorization: Bearer $TOKEN"

Query Parameters

date
string
Filter by date (YYYY-MM-DD)
vetId
string
Filter by veterinarian
status
string
Filter by status
triageLevel
string
Filter by triage level
petId
string
Get appointments for specific pet
ownerId
string
Get appointments for specific owner

Response

[
  {
    "id": "appt-001",
    "petId": "pet-123",
    "petName": "Buddy",
    "ownerId": "owner-456",
    "ownerName": "John Smith",
    "vetId": "vet-001",
    "type": "wellness",
    "reason": "Annual checkup and vaccinations",
    "symptoms": [],
    "triageLevel": "routine",
    "scheduledDate": "2024-12-15",
    "scheduledTime": "10:00",
    "durationMinutes": 30,
    "status": "confirmed",
    "notes": "First visit with Dr. Chen",
    "confirmationSent": true,
    "reminder24hSent": true,
    "reminder2hSent": false,
    "createdAt": "2024-12-01T09:30:00Z",
    "updatedAt": "2024-12-14T08:00:00Z"
  }
]

Get Appointment by ID

curl -X GET http://localhost:3000/api/appointments/appt-001 \
  -H "Authorization: Bearer $TOKEN"

Create Appointment

curl -X POST http://localhost:3000/api/appointments \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "petId": "pet-123",
    "petName": "Buddy",
    "ownerId": "owner-456",
    "ownerName": "John Smith",
    "vetId": "vet-001",
    "type": "urgent",
    "reason": "Vomiting and lethargy",
    "symptoms": ["vomiting", "lethargy"],
    "triageLevel": "urgent",
    "scheduledDate": "2024-12-16",
    "scheduledTime": "14:30",
    "durationMinutes": 45
  }'

Request Body

petId
string
required
Pet ID
petName
string
required
Pet name
ownerId
string
required
Owner ID
ownerName
string
required
Owner name
vetId
string
required
Veterinarian ID
type
string
required
Appointment type
reason
string
Visit reason
symptoms
string[]
Symptoms list
triageLevel
string
required
Triage level
scheduledDate
string
required
Date (YYYY-MM-DD)
scheduledTime
string
required
Time (HH:MM)
durationMinutes
number
default:"30"
Duration in minutes

Update Appointment

curl -X PATCH http://localhost:3000/api/appointments/appt-001 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "completed",
    "diagnosis": "Gastroenteritis",
    "treatmentNotes": "Administered anti-nausea medication. Prescribed bland diet for 3 days.",
    "prescriptions": ["Cerenia 16mg - 1 tablet daily for 3 days"]
  }'

Delete Appointment

curl -X DELETE http://localhost:3000/api/appointments/appt-001 \
  -H "Authorization: Bearer $TOKEN"

Search Available Slots

Find available appointment slots:
curl -X GET "http://localhost:3000/api/slots?date=2024-12-16&urgency=urgent&species=dog" \
  -H "Authorization: Bearer $TOKEN"

Query Parameters

date
string
Preferred date (YYYY-MM-DD)
urgency
string
Urgency level (emergency, urgent, routine)
species
string
Pet species (for specialized vets)
vetId
string
Specific veterinarian
appointmentType
string
Type of appointment

Response

[
  {
    "vetId": "vet-001",
    "vetName": "Dr. Sarah Chen",
    "date": "2024-12-16",
    "time": "14:30",
    "type": "urgent"
  },
  {
    "vetId": "vet-001",
    "vetName": "Dr. Sarah Chen",
    "date": "2024-12-16",
    "time": "15:00",
    "type": "urgent"
  }
]

Appointment Workflow Example

import { appointmentsApi, slotsApi } from '@/lib/api';

// 1. Find available slots
const slots = await slotsApi.search({
  date: '2024-12-16',
  urgency: 'urgent'
});

if (slots.length === 0) {
  console.log('No slots available');
  return;
}

// 2. Book the first available slot
const appointment = await appointmentsApi.create({
  petId: 'pet-123',
  petName: 'Buddy',
  ownerId: 'owner-456',
  ownerName: 'John Smith',
  vetId: slots[0].vetId,
  type: 'urgent',
  reason: 'Vomiting',
  symptoms: ['vomiting', 'lethargy'],
  triageLevel: 'urgent',
  scheduledDate: slots[0].date,
  scheduledTime: slots[0].time,
  durationMinutes: 30
});

console.log('Appointment booked:', appointment.id);

// 3. Update status when client arrives
await appointmentsApi.update(appointment.id, {
  status: 'checked_in'
});

// 4. Mark in progress during examination
await appointmentsApi.update(appointment.id, {
  status: 'in_progress'
});

// 5. Complete with diagnosis and treatment
await appointmentsApi.update(appointment.id, {
  status: 'completed',
  diagnosis: 'Gastroenteritis',
  treatmentNotes: 'Prescribed bland diet and anti-nausea medication',
  prescriptions: ['Cerenia 16mg'],
  followUpDate: '2024-12-23'
});

Build docs developers (and LLMs) love