Zoho CRM Business Hours

Manage organization-wide business hours configuration for Zoho CRM. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 3 operation(s).

OpenAPI Specification

zoho-crm-business-hours-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Business Hours",
    "description": "Manage organization-wide business hours configuration for Zoho CRM",
    "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.files.CREATE",
        "ZohoCRM.settings.business_hours.ALL"
      ]
    }
  ],
  "paths": {
    "/settings/business_hours": {
      "post": {
        "summary": "Create business hours configuration",
        "description": "Creates a new business hours configuration specifying working days, hours, and timezone for the organization.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.business_hours.CREATE"
            ]
          }
        ],
        "operationId": "createBusinessHours",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Business hours creation request body",
                "additionalProperties": false,
                "properties": {
                  "business_hours": {
                    "type": "object",
                    "description": "Business hours configuration details",
                    "additionalProperties": false,
                    "properties": {
                      "week_starts_on": {
                        "type": "string",
                        "description": "First day of the work week for the organization",
                        "enum": [
                          "Monday",
                          "Tuesday",
                          "Wednesday",
                          "Thursday",
                          "Friday",
                          "Saturday",
                          "Sunday"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "description": "Business hours configuration type: 24/7 operation, 24/5 weekdays, or custom hours",
                        "enum": [
                          "24_by_7",
                          "24_by_5",
                          "custom"
                        ]
                      },
                      "business_days": {
                        "type": "array",
                        "description": "Days of the week when the organization operates",
                        "items": {
                          "description": "Day of the week",
                          "type": "string",
                          "enum": [
                            "Monday",
                            "Tuesday",
                            "Wednesday",
                            "Thursday",
                            "Friday",
                            "Saturday",
                            "Sunday"
                          ]
                        },
                        "minItems": 1,
                        "maxItems": 7,
                        "uniqueItems": true
                      },
                      "same_as_everyday": {
                        "type": "boolean",
                        "description": "Indicates if business hours are the same every day (true) or vary by day (false)"
                      },
                      "daily_timing": {
                        "type": "array",
                        "description": "Default working hours applied to all business days (start and end time)",
                        "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
                      },
                      "custom_timing": {
                        "type": "array",
                        "description": "Different business hours for different days when same_as_everyday is false",
                        "maxItems": 7,
                        "items": {
                          "description": "Different business hours for different days when same_as_everyday is false",
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "days": {
                              "type": "string",
                              "description": "Specific day of the week for custom business hours",
                              "enum": [
                                "Monday",
                                "Tuesday",
                                "Wednesday",
                                "Thursday",
                                "Friday",
                                "Saturday",
                                "Sunday"
                              ]
                            },
                            "business_timing": {
                              "type": "array",
                              "description": "Start and end time for business hours on this specific day",
                              "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",
                            "business_timing"
                          ]
                        }
                      }
                    },
                    "required": [
                      "week_starts_on",
                      "type"
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/BusinessHoursSuccessResponse"
          },
          "400": {
            "description": "Bad request due to invalid data, missing mandatory fields, business rule violations, or attempting to create multiple business hours configurations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessHoursErrorResponses"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          }
        }
      },
      "put": {
        "summary": "Update business hours configuration",
        "description": "Updates the existing business hours configuration with new working days, hours, or timezone settings.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.business_hours.UPDATE"
            ]
          }
        ],
        "operationId": "updateBusinessHours",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Business hours update request body",
                "additionalProperties": false,
                "properties": {
                  "business_hours": {
                    "type": "object",
                    "description": "Business hours configuration details",
                    "additionalProperties": false,
                    "properties": {
                      "week_starts_on": {
                        "type": "string",
                        "description": "First day of the work week for the organization",
                        "enum": [
                          "Monday",
                          "Tuesday",
                          "Wednesday",
                          "Thursday",
                          "Friday",
                          "Saturday",
                          "Sunday"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "description": "Business hours configuration type: 24/7 operation, 24/5 weekdays, or custom schedule",
                        "enum": [
                          "24_by_7",
                          "24_by_5",
                          "custom"
                        ]
                      },
                      "business_days": {
                        "type": "array",
                        "description": "Days of the week when the organization operates",
                        "items": {
                          "description": "Days of the week when the organization operates",
                          "type": "string",
                          "enum": [
                            "Monday",
                            "Tuesday",
                            "Wednesday",
                            "Thursday",
                            "Friday",
                            "Saturday",
                            "Sunday"
                          ]
                        },
                        "minItems": 1,
                        "maxItems": 7,
                        "uniqueItems": true
                      },
                      "same_as_everyday": {
                        "type": "boolean",
                        "description": "Indicates if business hours are the same every day (true) or vary by day (false)"
                      },
                      "daily_timing": {
                        "type": "array",
                        "description": "Default working hours applied to all business days (start and end time)",
                        "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
                      },
                      "custom_timing": {
                        "type": "array",
                        "description": "Different business hours for different days when same_as_everyday is false",
                        "maxItems": 7,
                        "items": {
                          "description": "Different business hours for different days when same_as_everyday is false",
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "days": {
                              "type": "string",
                              "description": "Specific day of the week for custom business hours",
                              "enum": [
                                "Monday",
                                "Tuesday",
                                "Wednesday",
                                "Thursday",
                                "Friday",
                                "Saturday",
                                "Sunday"
                              ]
                            },
                            "business_timing": {
                              "type": "array",
                              "description": "Start and end time for business hours on this specific day",
                              "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",
                            "business_timing"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/BusinessHoursSuccessResponse"
          },
          "400": {
            "description": "Bad request due to invalid data, missing mandatory fields, or business rule violations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessHoursErrorResponses"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          }
        }
      },
      "get": {
        "summary": "Retrieve business hours configuration",
        "description": "Retrieves the current business hours configuration including working days, hours, and timezone.",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.business_hours.READ"
            ]
          }
        ],
        "operationId": "getBusinessHours",
        "responses": {
          "200": {
            "description": "Successfully retrieved business hours configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Business hours retrieval response",
                  "additionalProperties": false,
                  "properties": {
                    "business_hours": {
                      "type": "object",
                      "description": "Business hours configuration details",
                      "additionalProperties": false,
                      "properties": {
                        "week_starts_on": {
                          "type": "string",
                          "description": "First day of the work week for the organization",
                          "enum": [
                            "Monday",
                            "Tuesday",
                            "Wednesday",
                            "Thursday",
                            "Friday",
                            "Saturday",
                            "Sunday"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "description": "Business hours configuration type: 24/7 operation, 24/5 weekdays, or custom schedule",
                          "enum": [
                            "24_by_7",
                            "24_by_5",
                            "custom"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "description": "Unique identifier for this business hours configuration",
                          "pattern": "^[0-9]+$",
                          "maxLength": 255
                        },
                        "timezone": {
                          "type": "string",
                          "description": "Timezone for business hours (IANA timezone identifier)",
                          "maxLength": 100
                        },
                        "business_days": {
                          "type": "array",
                          "description": "Days of the week when the organization operates",
                          "items": {
                            "description": "Days of the week when the organization operates",
                            "type": "string",
                            "enum": [
                              "Monday",
                              "Tuesday",
                              "Wednesday",
                              "Thursday",
                              "Friday",
                              "Saturday",
                              "Sunday"
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 7,
                          "uniqueItems": true
                        },
                        "same_as_everyday": {
                          "type": "boolean",
                          "description": "Indicates if business hours are the same every day (true) or vary by day (false)"
                        },
                        "daily_timing": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "description": "Default working hours applied to all business days (start and end time)",
                          "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
                        },
                        "custom_timing": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "description": "Different business hours for different days when same_as_everyday is false",
                          "maxItems": 7,
                          "items": {
                            "description": "Different business hours for different days when same_as_everyday is false",
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "days": {
                                "type": "string",
                                "description": "Specific day of the week for custom business hours",
                                "enum": [
                                  "Monday",
                                  "Tuesday",
                                  "Wednesday",
                                  "Thursday",
                                  "Friday",
                                  "Saturday",
                                  "Sunday"
                                ]
                              },
                              "business_timing": {
                                "type": "array",
                                "description": "Start and end time for business hours on this specific day",
                                "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",
                              "business_timing"
                            ]
                          }
                        }
                      },
                      "required": [
                        "week_starts_on",
                        "type",
                        "id",
                        "timezone",
                        "business_days",
                        "same_as_everyday",
                        "daily_timing",
                        "custom_timing"
                      ]
                    }
                  },
                  "required": [
                    "business_hours"
                  ]
                }
              }
            }
          },
          "204": {
            "$ref": "#/components/responses/NoContentResponse"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BusinessHoursErrorResponses": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "description": "Error response for multiple business hours creation attempt",
            "properties": {
              "business_hours": {
                "$ref": "#/components/schemas/ErrorResponse"
              }
            },
            "required": [
              "business_hours"
            ]
          },
          {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Business hours error details",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code",
            "enum": [
              "NOT_ALLOWED",
              "MINIMUM_DATA_NOT_FOUND",
              "MISSING_MANDATORY_FIELDID",
              "ALREADY_USED",
              "MANDATORY_NOT_FOUND",
              "DEPENDENT_FIELD_MISSING",
              "INVALID_DATA",
              "CANNOT_BE_UPDATED",
              "CANNOT_UPDATE",
              "DEPENDENT_MISMATCH"
            ]
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Error details"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "maxLength": 255
          },
          "status": {
            "type": "string",
            "description": "Error status",
            "enum": [
              "error"
            ]
          }
        },
        "required": [
          "code",
          "details",
          "message",
          "status"
        ]
      }
    },
    "securitySchemes": {
      "iam-oauth2-schema": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth",
            "tokenUrl": "https://accounts.zoho.com/oauth/v2/token",
            "refreshUrl": "https://accounts.zoho.com/oauth/v2/token",
            "scopes": {
              "ZohoCRM.files.CREATE": "Create and upload files in Zoho CRM",
              "ZohoCRM.settings.business_hours.ALL": "Full access to manage business hours settings including creation, modification, and deletion",
              "ZohoCRM.settings.business_hours.CREATE": "Create access to manage business hours settings including creation, modification, and deletion",
              "ZohoCRM.settings.business_hours.READ": "Get access to manage business hours settings including creation, modification, and deletion",
              "ZohoCRM.settings.business_hours.UPDATE": "Update access to manage business hours settings including creation, modification, and deletion",
              "ZohoCRM.settings.business_hours.DELETE": "Delete access to manage business hours settings including creation, modification, and deletion"
            }
          }
        }
      }
    },
    "responses": {
      "BusinessHoursSuccessResponse": {
        "description": "Business hours operation completed successfully",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": false,
              "description": "Standard success response for business hours operations",
              "properties": {
                "business_hours": {
                  "type": "object",
                  "description": "Business hours response object",
                  "additionalProperties": false,
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "Status of the operation",
                      "enum": [
                        "success"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "description": "Code representing the operation status",
                      "enum": [
                        "SUCCESS"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "Message representing the operation status",
                      "enum": [
                        "Business Hours saved successfully"
                      ]
                    },
                    "details": {
                      "type": "object",
                      "additionalProperties": false,
                      "description": "Details of the created business hours",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Unique identifier of the created business hours",
                          "maxLength": 255
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "code",
                    "message",
                    "details"
                  ]
                }
              }
            }
          }
        }
      },
      "ForbiddenResponse": {
        "description": "Forbidden due to insufficient permissions to manage business hours",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": false,
              "description": "Forbidden response schema",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Error code",
                  "enum": [
                    "NO_PERMISSION"
                  ]
                },
                "details": {
                  "type": "object",
                  "additionalProperties": false,
                  "description": "Error details",
                  "properties": {
                    "permissions": {
                      "type": "array",
                      "description": "List of missing permissions",
                      "maxItems": 5,
                      "items": {
                        "description": "Permission name",
                        "type": "string",
                        "enum": [
                          "Crm_Implied_Manage_Users"
                        ]
                      }
                    }
                  }
                },
                "message": {
                  "type": "string",
                  "description": "Error message",
                  "maxLength": 255
                },
                "status": {
                  "type": "string",
                  "description": "Error status",
                  "enum": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "NoContentResponse": {
        "description": "No business hours configuration found"
      }
    }
  }
}