Skip to main content
DELETE
/
api
/
schedules
/
:id
curl -X DELETE "https://api.saludya.com/api/schedules/101" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DUVAN100/saludya-api/llms.txt

Use this file to discover all available pages before exploring further.

Permanently delete a doctor schedule. This removes the recurring availability slot from the system.
Deleting a schedule is permanent and cannot be undone. Consider setting is_available to false instead if you want to temporarily disable a schedule.

Path Parameters

id
integer
required
The unique identifier of the schedule to delete

Query Parameters

force
boolean
default:"false"
Force deletion even if future appointments exist for this schedule. When false, the API will reject deletion if appointments are scheduled.

Response

Successful deletion returns a 204 No Content response with an empty body.
curl -X DELETE "https://api.saludya.com/api/schedules/101" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Important Considerations

Impact on Appointments

Deleting a schedule affects appointment booking:
  • Future appointments: Existing appointments remain valid but may fall outside doctor’s availability
  • New bookings: Patients cannot book new appointments in the deleted time slot
  • Recurring pattern: The weekly availability pattern is permanently removed

Safe Deletion Workflow

  1. Check for existing appointments:
    curl "https://api.saludya.com/api/appointments?schedule_id=101&status=scheduled"
    
  2. Option A - Disable instead of delete (recommended):
    curl -X PUT "https://api.saludya.com/api/schedules/101" \
      -H "Authorization: Bearer YOUR_API_TOKEN" \
      -d '{"is_available": false}'
    
  3. Option B - Handle appointments first:
    • Reschedule or cancel affected appointments
    • Notify patients of changes
    • Then delete the schedule
  4. Option C - Force delete:
    curl -X DELETE "https://api.saludya.com/api/schedules/101?force=true" \
      -H "Authorization: Bearer YOUR_API_TOKEN"
    

When to Delete vs. Disable

Delete when:
  • Doctor permanently changes their schedule pattern
  • Removing incorrect or duplicate schedules
  • Doctor leaves the practice
Disable when:
  • Temporary absence (vacation, medical leave)
  • Seasonal schedule changes
  • Testing new availability patterns
  • Unsure if the schedule will be needed again

Bulk Delete Example

To remove all schedules for a doctor:
#!/bin/bash
# Get all schedule IDs for doctor
SCHEDULES=$(curl -s "https://api.saludya.com/api/schedules?doctor_id=5" \
  -H "Authorization: Bearer YOUR_API_TOKEN" | \
  jq -r '.schedules[].id')

# Delete each schedule
for schedule_id in $SCHEDULES; do
  curl -X DELETE "https://api.saludya.com/api/schedules/$schedule_id" \
    -H "Authorization: Bearer YOUR_API_TOKEN"
  echo "Deleted schedule $schedule_id"
done

Build docs developers (and LLMs) love