Reschedule a Service Appointment

Purpose

To reschedule a service appointment. The user performing this action should have the Reschedule permission for service appointments.

Request URL

https://fsm.zoho.com/fsm/v1/Service_Appointments/<record_id>/actions/reschedule

record_id - The unique ID of the record.

Request Method

PUT

Scope

scope=ZohoFSM.modules.serviceappointments.UPDATE

Mandatory Parameters

NameDescriptionType
Scheduled_Start_Date_Time                                                     The start date and time at which you want to reschedule the appointment. The value must be in the ISO format YYYY-MM-DDThh:mm:ssTZDDateTime
Scheduled_End_Date_TimeThe end date and time at which you want to reschedule the appointment. The value must be in the ISO format YYYY-MM-DDThh:mm:ssTZDDateTime
$Service_ResourcesInclude the IDs of the service resources assigned to the service appointment. If the ID of any of the currently assigned service resource is not included, then the service resource will be removed from the service appointment. You can also include the ID (the id in the Service_Resources key present in the List Users API response) of any other service resource you want to assign to the service appointment.Array
Lead

ID of the service resource you want to assign as the lead. If no lead information is provided and the existing lead is not included in $Service_Resources, the first service resource from $Service_Resources will be updated as lead of service appointment.

String

Sample Request

Copiedcurl --request PUT 'https://fsm.zoho.com/fsm/v1/Service_Appointments/8283XXX271124/actions/reschedule' \
--header 'Authorization: Zoho-oauthtoken 1000.26xxxxxxxxxx.xxxxxxxxxx0' \
--header 'content-type: application/json' \
--data "{"field1":"value1","field2":"value2"}"

Sample Input

Copied{
 "data": [
   {
     "Scheduled_Start_Date_Time": "2024-02-12T12:00:00-08:00",
     "Scheduled_End_Date_Time": "2024-02-12T12:30:00-08:00",
     "Lead": "8283000000237066",
     "$Service_Resources": [
       "8283000000237066",
       "8283000000251042"
     ]
   }
 ]
}

Sample Success Response

Copied{
    "data": [
        {
            "code": "SUCCESS",
            "details": {
                "Modified_Time": "2024-02-12T00:01:03-08:00",
                "Modified_By": {
                    "name": "Robin Ellacott",
                    "id": "8283000000237001"
                },
                "Created_Time": "2024-02-11T22:28:28-08:00",
                "id": "8283000000271124",
                "Created_By": {
                    "name": "Robin Ellacott",
                    "id": "8283000000237001"
                }
            },
            "message": "record updated",
            "status": "success"
        }
    ]
}

Sample Error Response

Copied//The service resource is not available during the rescheduled time
{
    "data": [
        {
            "code": "SERVICE_RESOURCE_NOT_AVAILABLE",
            "details": {
                "availability_check": [
                    {
                        "Service_Resources": {
                            "Crew": null,
                            "Type": "Agent",
                            "User": {
                                "id": "8283000000237001"
                            },
                            "id": "8283000000237066",
                            "isActive": true,
                            "Name": "Robin Ellacott"
                        },
                        "Time_Off": [],
                        "Territories": [
                            {
                                "End_Date_Time": null,
                                "Start_Date_Time": "2023-12-19T01:48:51-08:00",
                                "id": "8283000000237061",
                                "Name": "Zylker"
                            }
                        ],
                        "Service_Appointments": [
                            {
                                "Scheduled_End_Date_Time": "2024-02-12T12:30:00-08:00",
                                "Actual_Start_Date_Time": null,
                                "id": "8283000000271287",
                                "Scheduled_Start_Date_Time": "2024-02-12T12:00:00-08:00",
                                "Name": "AP-3",
                                "Actual_End_Date_Time": null
                            }
                        ],
                        "Crew_Members": [],
                        "is_available": false
                    },
                    {
                        "Service_Resources": {
                            "Crew": null,
                            "Type": "Agent",
                            "User": {
                                "id": "8283000000251030"
                            },
                            "id": "8283000000251042",
                            "isActive": true,
                            "Name": "potter"
                        },
                        "Time_Off": [],
                        "Territories": [
                            {
                                "End_Date_Time": null,
                                "Start_Date_Time": "2024-01-24T23:41:34-08:00",
                                "id": "8283000000237061",
                                "Name": "Zylker"
                            }
                        ],
                        "Service_Appointments": [
                            {
                                "Scheduled_End_Date_Time": "2024-02-12T12:30:00-08:00",
                                "Actual_Start_Date_Time": null,
                                "id": "8283000000271287",
                                "Scheduled_Start_Date_Time": "2024-02-12T12:00:00-08:00",
                                "Name": "AP-3",
                                "Actual_End_Date_Time": null
                            }
                        ],
                        "Crew_Members": [],
                        "is_available": false
                    }
                ],
                "module": "Service_Appointments"
            },
            "message": "Service Resource is not available"
        }
    ]
}

Sample Error Response

Copied//Improper time values provided for rescheduling. E.g. Scheduled end time is before the scheduled start time.
{
    "data": [
        {
            "code": "INVALID_DATA",
            "details": {
                "module": "Service_Appointments"
            },
            "message": "Invalid scheduled time(s)"
        }
    ]
}