Zoho CRM Shift Hours

Manage shift hours configuration for Zoho CRM business hours, including shift timing, break schedules, user assignments, and holiday definitions.

OpenAPI Specification

zoho-crm-shift-hours-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Shift Hours",
    "description": "Manage shift hours configuration for Zoho CRM business hours, including shift timing, break schedules, user assignments, and holiday definitions.",
    "version": "8"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au"
          ],
          "default": "com",
          "description": "API Server URL TLD"
        },
        "version": {
          "default": "v8",
          "description": "API version"
        }
      }
    }
  ],
  "security": [
    {
      "iam-oauth2-schema": [
        "ZohoCRM.settings.business_hours.ALL"
      ]
    }
  ],
  "paths": {
    "/settings/business_hours/shift_hours": {
      "get": {
        "summary": "Retrieve all shift hours",
        "description": "Retrieves all configured shift hours including shift timing, break hours, users, and holidays for each shift.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.business_hours.READ"
            ]
          }
        ],
        "operationId": "getShifts",
        "responses": {
          "200": {
            "description": "Successfully retrieved all shift hours with their configurations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Schema definition",
                  "properties": {
                    "shift_count": {
                      "type": "object",
                      "description": "Count of shifts with user assignments",
                      "properties": {
                        "total_shift_with_user": {
                          "type": "integer",
                          "description": "Total number of shifts that have users assigned",
                          "minimum": 0,
                          "format": "int32"
                        }
                      },
                      "required": [
                        "total_shift_with_user"
                      ],
                      "additionalProperties": false
                    },
                    "shift_hours": {
                      "type": "array",
                      "description": "List of configured shift hours",
                      "items": {
                        "type": "object",
                        "description": "Item details",
                        "properties": {
                          "custom_timing": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "description": "Different shift timings for different days (null when same_as_everyday is true)",
                            "items": {
                              "type": "object",
                              "description": "Item details",
                              "properties": {
                                "days": {
                                  "type": "string",
                                  "description": "Day of the week",
                                  "enum": [
                                    "Monday",
                                    "Tuesday",
                                    "Wednesday",
                                    "Thursday",
                                    "Friday",
                                    "Saturday",
                                    "Sunday"
                                  ]
                                },
                                "shift_timing": {
                                  "type": "array",
                                  "description": "Start and end time for the shift",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$",
                                    "description": "Time in HH:MM format (24-hour)",
                                    "maxLength": 5
                                  },
                                  "minItems": 2,
                                  "maxItems": 2
                                }
                              },
                              "required": [
                                "days",
                                "shift_timing"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "users_count": {
                            "type": "integer",
                            "description": "Number of users assigned to this shift",
                            "minimum": 0,
                            "format": "int32"
                          },
                          "holidays": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "description": "List of holidays for this shift",
                            "items": {
                              "type": "object",
                              "description": "Item details",
                              "properties": {
                                "date": {
                                  "type": "string",
                                  "format": "date",
                                  "description": "Holiday date in YYYY-MM-DD format"
                                },
                                "year": {
                                  "type": "string",
                                  "description": "Year of the holiday",
                                  "maxLength": 100
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Name of the holiday",
                                  "maxLength": 100
                                },
                                "userFmt": {
                                  "type": "string",
                                  "description": "User-formatted date string",
                                  "maxLength": 100
                                },
                                "id": {
                                  "type": "string",
                                  "description": "Unique identifier for the holiday",
                                  "pattern": "^[0-9]+$",
                                  "maxLength": 100
                                }
                              },
                              "required": [
                                "date",
                                "year",
                                "name",
                                "userFmt",
                                "id"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "daily_timing": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "description": "Default timing for all days (null when same_as_everyday is false)",
                            "items": {
                              "type": "string",
                              "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$",
                              "description": "Time in HH:MM format (24-hour)",
                              "maxLength": 5
                            },
                            "minItems": 2,
                            "maxItems": 2
                          },
                          "timezone": {
                            "type": "string",
                            "description": "Timezone identifier (e.g., Africa/Abidjan, America/New_York)",
                            "maxLength": 100
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the shift",
                            "maxLength": 80
                          },
                          "break_hours": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "description": "List of break periods for this shift",
                            "items": {
                              "type": "object",
                              "description": "Item details",
                              "properties": {
                                "custom_timing": {
                                  "type": [
                                    "array",
                                    "null"
                                  ],
                                  "description": "Different break timings for different days (null when same_as_everyday is true)",
                                  "items": {
                                    "type": "object",
                                    "description": "Item details",
                                    "properties": {
                                      "break_timing": {
                                        "type": "array",
                                        "description": "Start and end time for the break",
                                        "items": {
                                          "type": "string",
                                          "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$",
                                          "description": "Time in HH:MM format (24-hour)",
                                          "maxLength": 5
                                        },
                                        "minItems": 2,
                                        "maxItems": 2
                                      },
                                      "days": {
                                        "type": "string",
                                        "description": "Day of the week",
                                        "enum": [
                                          "Monday",
                                          "Tuesday",
                                          "Wednesday",
                                          "Thursday",
                                          "Friday",
                                          "Saturday",
                                          "Sunday"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "break_timing",
                                      "days"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "daily_timing": {
                                  "type": [
                                    "array",
                                    "null"
                                  ],
                                  "description": "Default break timing for all days (null when same_as_everyday is false)",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$",
                                    "description": "Time in HH:MM format (24-hour)",
                                    "maxLength": 5
                                  },
                                  "minItems": 2,
                                  "maxItems": 2
                                },
                                "same_as_everyday": {
                                  "type": "boolean",
                                  "description": "Indicates if break has same timing every day"
                                },
                                "id": {
                                  "type": "string",
                                  "description": "Unique identifier for the break hour",
                                  "pattern": "^[0-9]+$",
                                  "maxLength": 100
                                },
                                "break_days": {
                                  "type": "array",
                                  "description": "Days when this break applies",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "Monday",
                                      "Tuesday",
                                      "Wednesday",
                                      "Thursday",
                                      "Friday",
                                      "Saturday",
                                      "Sunday"
                                    ],
                                    "description": "Break days"
                                  },
                                  "maxItems": 50
                                }
                              },
                              "required": [
                                "custom_timing",
                                "daily_timing",
                                "same_as_everyday",
                                "id",
                                "break_days"
                              ],
                              "additionalProperties": false
                            },
                            "maxItems": 2
                          },
                          "shift_days": {
                            "type": "array",
                            "description": "Days when this shift is active",
                            "items": {
                              "type": "string",
                              "enum": [
                                "Monday",
                                "Tuesday",
                                "Wednesday",
                                "Thursday",
                                "Friday",
                                "Saturday",
                                "Sunday"
                              ],
                              "description": "Shift days"
                            },
                            "maxItems": 50
                          },
                          "same_as_everyday": {
                            "type": "boolean",
                            "description": "Indicates if shift has same timing every day"
                          },
                          "id": {
                            "type": "string",
                            "description": "Unique identifier for the shift hour",
                            "pattern": "^[0-9]+$",
                            "maxLength": 100
                          },
                          "users": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "description": "List of users assigned to this shift (null when no users assigned)",
                            "items": {
                              "type": "object",
                              "description": "Item details",
                              "properties": {
                                "role": {
                                  "type": "object",
                                  "description": "User's role information",
                                  "properties": {
                                    "name": {
                                      "type": "string",
                                      "description": "Role name",
                                      "maxLength": 100
                                    },
                                    "id": {
                                      "type": "string",
                                      "description": "Role ID",
                                      "pattern": "^[0-9]+$",
                                      "maxLength": 100
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                },
                                "name": {
                                  "type": "string",
                                  "description": "User's name",
                                  "maxLength": 100
                                },
                                "id": {
                                  "type": "string",
                                  "description": "User's ID",
                                  "pattern": "^[0-9]+$",
                                  "maxLength": 100
                                },
                                "email": {
                                  "type": "string",
                                  "format": "email",
                                  "description": "User's email address"
                                },
                                "zuid": {
                                  "type": "string",
                                  "description": "Zoho unique identifier for the user",
                                  "maxLength": 100
                                },
                                "effective_from": {
                                  "type": "string",
                                  "format": "date",
                                  "description": "Date from which the user is assigned to this shift"
                                }
                              },
                              "required": [
                                "role",
                                "name",
                                "id",
                                "email",
                                "zuid",
                                "effective_from"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "custom_timing",
                          "users_count",
                          "holidays",
                          "daily_timing",
                          "timezone",
                          "name",
                          "break_hours",
                          "shift_days",
                          "same_as_everyday",
                          "id",
                          "users"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 50
                    }
                  },
                  "required": [
                    "shift_count",
                    "shift_hours"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "204": {
            "$ref": "#/components/responses/NoContentResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          }
        }
      },
      "post": {
        "summary": "Create new shifts",
        "description": "Creates one or more new shift hour configurations with timing, break hours, and timezone settings.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.business_hours.CREATE"
            ]
          }
        ],
        "operationId": "createShifts",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Error scenario",
                "properties": {
                  "shift_hours": {
                    "type": "array",
                    "description": "List of shift hours to create",
                    "items": {
                      "type": "object",
                      "description": "Shift hour configuration",
                      "properties": {
                        "break_hours": {
                          "type": "array",
                          "description": "List of break hours for the shift",
                          "items": {
                            "type": "object",
                            "description": "Break hour configuration",
                            "properties": {
                              "break_days": {
                                "type": "array",
                                "description": "Days when this break applies",
                                "items": {
                                  "type": "string",
                                  "description": "Day of the week",
                                  "enum": [
                                    "Monday",
                                    "Thursday",
                                    "Friday",
                                    "Sunday",
                                    "Wednesday",
                                    "Tuesday",
                                    "Saturday"
                                  ]
                                },
                                "maxItems": 50
                              },
                              "daily_timing": {
                                "type": "array",
                                "description": "Default break timing for all days",
                                "items": {
                                  "type": "string",
                                  "description": "Time in HH:MM format",
                                  "maxLength": 5,
                                  "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$"
                                },
                                "maxItems": 50
                              },
                              "custom_timing": {
                                "type": "array",
                                "description": "Different break timings for different days",
                                "items": {
                                  "type": "object",
                                  "description": "Custom break timing configuration",
                                  "properties": {
                                    "break_timing": {
                                      "type": "array",
                                      "description": "Start and end time for the break",
                                      "items": {
                                        "type": "string",
                                        "description": "Time in HH:MM format",
                                        "maxLength": 5,
                                        "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$"
                                      },
                                      "maxItems": 50
                                    },
                                    "days": {
                                      "type": "string",
                                      "description": "Day of the week",
                                      "enum": [
                                        "Monday",
                                        "Thursday",
                                        "Friday",
                                        "Sunday",
                                        "Wednesday",
                                        "Tuesday",
                                        "Saturday"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "maxItems": 50
                              },
                              "same_as_everyday": {
                                "type": "string",
                                "description": "Indicates if break has same timing every day",
                                "maxLength": 100
                              }
                            },
                            "additionalProperties": false
                          },
                          "maxItems": 50
                        },
                        "daily_timing": {
                          "type": "array",
                          "description": "Default timing for all days",
                          "items": {
                            "type": "string",
                            "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$",
                            "description": "Time in HH:MM format",
                            "maxLength": 5
                          },
                          "maxItems": 50
                        },
                        "shift_days": {
                          "type": "array",
                          "description": "Days when this shift is active",
                          "items": {
                            "type": "string",
                            "description": "Day of the week",
                            "enum": [
                              "Monday",
                              "Thursday",
                              "Friday",
                              "Sunday",
                              "Wednesday",
                              "Tuesday",
                              "Saturday"
                            ]
                          },
                          "maxItems": 50
                        },
                        "custom_timing": {
                          "type": "array",
                          "description": "Different shift timings for different days",
                          "items": {
                            "type": "object",
                            "description": "Custom shift timing configuration",
                            "properties": {
                              "shift_timing": {
                                "type": "array",
                                "description": "Start and end time for the shift",
                                "items": {
                                  "type": "string",
                                  "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]$",
                                  "description": "Time in HH:MM format",
                                  "maxLength": 5
                                },
                                "maxItems": 50
                              },
                              "days": {
                                "type": "string",
                                "description": "Day of the week",
                                "enum": [
                                  "Monday",
                                  "Thursday",
                                  "Friday",
                                  "Sunday",
                                  "Wednesday",
                                  "Tuesday",
                                  "Saturday"
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "maxItems": 50
                        },
                        "timezone": {
                          "type": "string",
                          "description": "Timezone identifier",
                          "maxLength": 100
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the shift",
                          "maxLength": 100
                        },
                        "same_as_everyday": {
                          "type": "boolean",
                          "description": "Indicates if shift has same timing every day"
                        },
                        "holidays": {
                          "type": "array",
                          "description": "List of holidays for this shift",
                          "items": {
                            "type": "object",
                            "description": "Holiday configuration",
                            "properties": {
                              "date": {
                                "type": "string",
                                "format": "date",
                                "description": "Holiday date"
                              },
                              "name": {
                                "type": "string",
                                "description": "Name of the holiday",
                                "maxLength": 100
                              }
                            },
                            "additionalProperties": false
                          },
                          "maxItems": 50
                        },
                        "users": {
                          "type": "array",
                          "description": "List of users assigned to this shift",
                          "items": {
                            "type": "object",
                            "description": "User assignment",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "User ID",
                                "maxLength": 100
                              }
                            },
                            "additionalProperties": false
                          },
                          "maxItems": 50
                        }
                      },
                      "additionalProperties": false
                    },
                    "maxItems": 50
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/ShiftHoursSuccessResponse"
          },
          "400": {
            "description": "Bad request due to invalid data, missing mandatory fields, duplicate data, or dependency violations",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Error scenario",
                      "properties": {
                        "shift_hours": {
                          "type": "array",
                          "description": "List of shift hours",
                          "items": {
                            "type": "object",
                            "description": "Item details",
                            "properties": {
                              "code": {
                                "type": "string",
                                "description": "Error code",
                                "enum": [
                                  "LIMIT_EXCEEDED"
                                ]
                              },
                              "details": {
                                "type": "object",
                                "description": "Error details",
                                "properties": {
                                  "limit": {
                                    "type": "integer",
                                    "description": "Maximum allowed limit",
                                    "enum": [
                                      50
                                    ],
                                    "format": "int32"
                                  },
                                  "limit_due_to": {
                                    "type": "array",
                                 

# --- truncated at 32 KB (192 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zoho-crm/refs/heads/main/openapi/zoho-crm-shift-hours-openapi.json