---
title: "Reschedule Appointment"
method: PATCH
path: "/appointments/v1/{appointment_id}/reschedule"
tags: ["Appointment API"]
---

# Reschedule Appointment

`PATCH /appointments/v1/{appointment_id}/reschedule`

### Overview

This API is used to reschedule an appointment. Rescheduling does **not** update the existing appointment. Instead, a brand new appointment is created with the supplied `start_time` and `end_time`, while the previous appointment's status is marked as `RES` (which represents *rescheduled*).

The newly created appointment carries a `prev_aids` field — an array containing the ids of the previous, rescheduled appointment(s). Each previous appointment in turn carries a `next_aid` field, which holds the id of the next appointment it was rescheduled to. This forms a linked chain across the reschedule history.

The response of this API is the **new appointment** that is created as a result of the reschedule.

## Path parameters

- `appointment_id` string, required

## Headers

- `auth` string, required

## Request body

- object
  - `start_time` integer, required — New start time of the appointment as a Unix epoch in seconds.
  - `end_time` integer, required — New end time of the appointment as a Unix epoch in seconds. Must be after start_time.
  - `partner_appointment_id` string — Optional partner-provided appointment id. When omitted, the server generates the new appointment id and the `appointment_id` path param is used as-is. When supplied, the new id is derived with the help of this field and the `appointment_id` path param is treated as a partner appointment id.

## Response `200`

OK — the newly created (rescheduled) appointment.

- object
  - `appointment_id` string — Id of the newly created appointment.
  - `patient_id` string
  - `doctor_id` string, nullable
  - `clinic_id` string
  - `status` string
  - `mode` string
  - `start_time` integer — Start time as a Unix epoch in seconds.
  - `end_time` integer — End time as a Unix epoch in seconds.
  - `created_at` integer — Creation time as a Unix epoch in seconds.
  - `prev_aids` string[] — Ids of the previous rescheduled appointment(s).
  - `next_aid` string — Id of the next appointment this one was rescheduled to. Present only on previous appointments.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `409` — Conflict — an appointment with the derived new id already exists.

---

[API](https://skmtc.net/eka/apis/eka-developer-apis.md) · [All operations](https://skmtc.net/eka/apis/eka-developer-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eka/eka-developer-apis/revisions/9ea23456f722/schema)
