Fetch Available Time Slots

Purpose

To fetch available time slots for service resources (agents or crews) based on various filters such as date/time, resource type, skills, territory, etc.

The service resources will be considered available if they meet the following conditions:

  • The service resource is present in the specified territory during the given time.
  • The service resource has no appointments scheduled during that time.
  • The service resource is not on time off during that time.

Request URL

https://fsm.zoho.com/fsm/v1/Service_Resources/Available_TimeSlots

Request Method

POST

Scope

scope=ZohoFSM.modules.custom.READ

Input JSON Keys

NameData TypeDescription
date_time_rangeJSON ObjectThe date range within which you want to find the time slots

start

(mandatory)

StringThe start date/time from which you want to check the time slots. It can either be in the ISO8601 format YYYY-MM-DDThh:mm:ssTZD or YYYY-MM-DD
endString

The end date/time till which you want to check the time slots. It can either be in the ISO8601 format YYYY-MM-DDThh:mm:ssTZD or YYYY-MM-DD

If an end date/time is not given, then the end of the day of the given start date/time will be considered as the end date/time

The end date/time should be within 48 hours of the start date/time

 
service_resource_filterJSON ObjectThe criteria you want to specify for fetching the service resources
typeStringWhether the service resource is a Crew or Agent
sr_idsArrayThe IDs of the service resources. Use the id in the Service_Resources key present in the List Users API response
skill_idsArrayThe IDs of the skills of the service resource. You can get these IDs from the List Skills API
sr_nameStringThe name of the service resource. All the service resources whose name or substring of their name matches this search string will be fetched
countNumberThe number of service resources you want to fetch. You can give a value between 20 and 100.
 
territoryJSON Object 

id

(mandatory)

StringThe ID of the territory in which you want to check the availability. You can get this ID from the List Service Territories API
 
time_slotJSON Object 
durationNumberThe duration of the time slot in minutes. If not specified, then 60 minutes will be considered. The duration should be greater than 0.

Sample Request

Copiedcurl --request POST 'https://fsm.zoho.com/fsm/v1/Service_Resources/Available_TimeSlots' \
--header 'Authorization: Zoho-oauthtoken 1000.26xxxxxxxxxx.xxxxxxxxxx0' \
--header 'content-type: application/json' \
--data "{"field1":"value1","field2":"value2"}"

Sample Input

Copied{
    "date_time_range": {
        "start": "2025-05-17T00:00:00+05:30",
        "end": "2025-05-17T18:00:00+05:30"
    },
    "service_resource_filter": {
        "type": "Agent",
        "skill_ids": [
            "1003000002100029"
        ],
        "sr_name": "Mar",
        "count": 20
    },
    "territory": {
        "id": "1003000000208154"
    },
    "time_slot": {
        "duration": 90
    }
}

Sample Success Response

Copied{
    "data": [
        {
            "Service_Resources": {
                "Crew": null,
                "Type": "Agent",
                "User": {
                    "id": "1003000000413005"
                },
                "Time_Slots": [
                    {
                        "start_time": "2025-05-17T00:00:00+05:30",
                        "end_time": "2025-05-17T01:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T01:30:00+05:30",
                        "end_time": "2025-05-17T03:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T03:00:00+05:30",
                        "end_time": "2025-05-17T04:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T04:30:00+05:30",
                        "end_time": "2025-05-17T06:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T06:00:00+05:30",
                        "end_time": "2025-05-17T07:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T07:30:00+05:30",
                        "end_time": "2025-05-17T09:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T09:00:00+05:30",
                        "end_time": "2025-05-17T10:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T10:30:00+05:30",
                        "end_time": "2025-05-17T12:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T12:00:00+05:30",
                        "end_time": "2025-05-17T13:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T13:30:00+05:30",
                        "end_time": "2025-05-17T15:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T15:00:00+05:30",
                        "end_time": "2025-05-17T16:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T16:30:00+05:30",
                        "end_time": "2025-05-17T18:00:00+05:30"
                    }
                ],
                "id": "1003000000413017",
                "isActive": true,
                "Name": "Martin Fernando"
            }
        },
        {
            "Service_Resources": {
                "Crew": null,
                "Type": "Agent",
                "User": {
                    "id": "1003000000208001"
                },
                "Time_Slots": [
                    {
                        "start_time": "2025-05-17T00:00:00+05:30",
                        "end_time": "2025-05-17T01:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T01:30:00+05:30",
                        "end_time": "2025-05-17T03:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T03:00:00+05:30",
                        "end_time": "2025-05-17T04:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T04:30:00+05:30",
                        "end_time": "2025-05-17T06:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T06:00:00+05:30",
                        "end_time": "2025-05-17T07:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T07:30:00+05:30",
                        "end_time": "2025-05-17T09:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T09:00:00+05:30",
                        "end_time": "2025-05-17T10:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T10:30:00+05:30",
                        "end_time": "2025-05-17T12:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T12:00:00+05:30",
                        "end_time": "2025-05-17T13:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T13:30:00+05:30",
                        "end_time": "2025-05-17T15:00:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T15:00:00+05:30",
                        "end_time": "2025-05-17T16:30:00+05:30"
                    },
                    {
                        "start_time": "2025-05-17T16:30:00+05:30",
                        "end_time": "2025-05-17T18:00:00+05:30"
                    }
                ],
                "id": "1003000000208159",
                "isActive": true,
                "Name": "Marianne Sheehan"
            }
        }
    ],
    "info": {
        "count": 2
    }
}

Sample Error Response

Copied{
 "code": "INVALID_DATA",
 "details": {},
 "message": "Invalid territory.id",
 "status": "error"
}

Sample Error Response

Copied{
    "code": "INVALID_DATA",
    "details": {},
    "message": "Start Date should be in ISO8601 format",
    "status": "error"
}