Skip to content

List Block Times

Retrieve a paginated list of block time entries for one or more doctors at specified clinics.

Endpoint

GET /v1/doctor-block

Query Parameters

Parameter Type Required Description
doctor_id array Yes One or more doctor IDs (repeat the parameter for multiple: doctor_id=1&doctor_id=2)
clinic_id array Yes One or more clinic IDs
start_date string (date) No Filter blocks on or after this date (YYYY-MM-DD)
end_date string (date) No Filter blocks on or before this date (YYYY-MM-DD)
page integer No Page number (default: 1)
size integer No Records per page (default: 10)

Request

curl --location '{base_url}/v1/doctor-block?doctor_id=485195&clinic_id=44&start_date=2025-07-01&end_date=2025-07-31&page=1&size=20' \
  --header 'Authorization: Bearer JWT_TOKEN'

Response

Success Response

Code: 200 OK

{
  "code": 2000,
  "data": {
    "total": 3,
    "pages": 1,
    "current": 1,
    "no_of_records": 3,
    "content": [
      {
        "doctor_blocking_schedule_id": 10045,
        "doctor_id": 485195,
        "clinic_id": 44,
        "block_reason": "LUNCH",
        "starts_at": "2025-07-24T09:00:00",
        "ends_at": "2025-07-24T10:00:00",
        "block_date": "2025-07-24",
        "slot_start_time": "09:00",
        "slot_end_time": "10:00",
        "recurrence_frequency": "NON_RECURRENT",
        "days_of_occurrence": null,
        "interval_count": 1,
        "block_identifier": "uuid-abc-123",
        "block_status": "ACTIVE",
        "comments": "Team lunch",
        "created_at": "2025-05-19T08:00:00"
      }
    ]
  },
  "message": "Success"
}

Response Fields

Field Type Description
total integer Total number of matching block entries
pages integer Total number of pages
current integer Current page number
no_of_records integer Number of records in this response
content array Array of block time objects

Block Time Object

Field Type Description
doctor_blocking_schedule_id integer Unique ID of the block entry
doctor_id integer Doctor the block applies to
clinic_id integer Clinic the block applies to
block_reason string Reason code
starts_at string (datetime) Block start datetime (UTC)
ends_at string (datetime) Block end datetime (UTC)
block_date string (date) Calendar date of this block
slot_start_time string Slot start time (HH:mm)
slot_end_time string Slot end time (HH:mm)
recurrence_frequency string Recurrence pattern
days_of_occurrence array Weekday integers for recurring blocks
interval_count integer Interval between occurrences
block_identifier string UUID shared by all occurrences of a recurring block
block_status string ACTIVE or DELETED
comments string Free-text note
created_at string (datetime) Creation timestamp

Error Response

Code: 400 Bad Request

{
  "code": 4000,
  "message": "Bad Request",
  "data": null
}