Zoho: Update shift hours
Zoho shiftHours.updateShiftHours: arguments, response, policy and SDK examples.
← Shift hours operations · Get started
Operation zoho.updateshifthours
Provider route: PUT /crm/v8/settings/business_hours/shift_hours. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["shiftHours"]["updateShiftHours"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.shiftHours.updateShiftHours(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.shift_hours.update_shift_hours(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | object | Required within parent | Represents the request body for updating one or more shift hour configurations. Each entry in `shift_hours` updates an existing shift with its timing, break hours, optional holidays, and assigned users. Additional keys: not allowed |
body.shift_hours | array | Optional | Lists the shift hour configurations to be created or updated in the request. Maximum items: 50 |
body.shift_hours[] | object | Each item | Each object specifies a shift hour with its timing, break hours, holidays, and assigned users. Additional keys: not allowed |
body.shift_hours[].break_hours | array | Optional | Lists the break windows scheduled within the shift hour. A shift can have at most two break windows. Maximum items: 50 |
body.shift_hours[].break_hours[] | object | Each item | Each object specifies the days the break applies to and the break timing for those days. Additional keys: not allowed |
body.shift_hours[].break_hours[].break_days | array | Optional | Lists the days of the week on which the break hour applies. Maximum items: 7 |
body.shift_hours[].break_hours[].break_days[] | string | Each item | Represents one day of the week on which the break hour applies. Possible values: - Monday - Thursday - Friday - Sunday - Wednesday - Tuesday - Saturday One of: Monday, Thursday, Friday, Sunday, Wednesday, Tuesday, Saturday |
body.shift_hours[].break_hours[].custom_timing | array | Optional | Lists per-day break timing overrides. This field is mandatory when the parent same_as_everyday is false. A day can have at most two breaks and the total break time on a day cannot exceed two hours. Maximum items: 50 |
body.shift_hours[].break_hours[].custom_timing[] | Model | Each item | Expand Update shift hours — request body — body shift hours item break hours item custom timing item |
body.shift_hours[].break_hours[].daily_timing | array | Optional | Represents the start and end time of the break in `HH:MM` 24-hour format, applied uniformly to every day the break is scheduled. This field is mandatory when the parent same_as_everyday is true. A day can have at most two breaks and the total break time on a day cannot exceed two hours. Maximum items: 50 |
body.shift_hours[].break_hours[].daily_timing[] | string | Each item | ”Represents the start time or end time of the window in `HH:MM` 24-hour format. “ Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
body.shift_hours[].break_hours[].same_as_everyday | string | Optional | Indicates whether the shift hour follows the same timing on every active day. When the value is true, the daily_timing array becomes mandatory; when the value is false, the custom_timing array becomes mandatory. Maximum length: 100 |
body.shift_hours[].custom_timing | array | Optional | Lists per-day shift timing overrides. This field is mandatory when same_as_everyday is false. Maximum items: 50 |
body.shift_hours[].custom_timing[] | object | Each item | Each object specifies the day of the week and the start and end time of the shift on that day. Additional keys: not allowed |
body.shift_hours[].custom_timing[].days | string | Optional | Represents the day of the week to which this custom shift timing applies. Possible values: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday One of: Monday, Thursday, Friday, Sunday, Wednesday, Tuesday, Saturday |
body.shift_hours[].custom_timing[].shift_timing | array | Optional | Represents the start and end time of the shift on the specified day in `HH:MM` 24-hour format. Maximum items: 7 |
body.shift_hours[].custom_timing[].shift_timing[] | string | Each item | Each string represents the start time or end time of the window in `HH:MM` 24-hour format. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
body.shift_hours[].daily_timing | array | Optional | Represents the start and end time of the shift in `HH:MM` 24-hour format, applied uniformly to every active day. This field is mandatory when same_as_everyday is true. Maximum items: 50 |
body.shift_hours[].daily_timing[] | string | Each item | ”Represents the start time or end time of the window in `HH:MM` 24-hour format. “ Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
body.shift_hours[].holidays | array | Optional | Lists the holidays observed during the shift hour. The holiday date must fall between the current and the next financial year. Maximum items: 50 |
body.shift_hours[].holidays[] | object | Each item | Each object specifies the date and the name of the holiday. Additional keys: not allowed |
body.shift_hours[].holidays[].date | string | Optional | Represents the date of the holiday in `YYYY-MM-DD` format. Format: date |
body.shift_hours[].holidays[].name | string | Optional | Represents the name of the holiday. The name must not contain the special characters. Maximum length: 80 |
body.shift_hours[].name | string | Optional | Represents the name of the shift hour. The name must be unique within the organization and must not contain the special characters. Maximum length: 80 |
body.shift_hours[].same_as_everyday | boolean | Optional | Indicates whether the shift hour follows the same timing on every active day. Possible values: - true - the shift hour uses the same timing every day, and daily_timing becomes mandatory. - false - the shift hour uses different timing for different days, and custom_timing becomes mandatory. |
body.shift_hours[].shift_days | array | Optional | Lists the days of the week on which the shift hour is active. You can set shift timing only on the days your organization operates. Maximum items: 7 |
body.shift_hours[].shift_days[] | string | Each item | Each string represents one day of the week on which the shift hour is active. Possible values: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday One of: Monday, Thursday, Friday, Sunday, Wednesday, Tuesday, Saturday |
body.shift_hours[].timezone | string | Optional | Represents the time zone in which the shift hours are scheduled. Maximum length: 100 |
body.shift_hours[].users | array | Optional | Lists the users assigned to the shift hour. Maximum items: 200 |
body.shift_hours[].users[] | object | Each item | Each object specifies the user and the date from which the assignment becomes effective. Additional keys: not allowed |
body.shift_hours[].users[].id | string | Optional | Represents the unique identifier of the user assigned to the shift hour. Maximum length: 100 |
Referenced models: Update shift hours — request body — body shift hours item break hours item custom timing item
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Delete a shift hour — response body Response body details |
$ (anyOf 2) | Model | Alternative | Expand Delete a shift hour — response body |
Referenced models: Delete a shift hour — response body
Schemas
Section titled “Schemas”Delete a shift hour — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the response body that contains the shift hour configurations and the aggregate count of shifts with assigned users. Additional keys: not allowed |
shift_hours | array | Required within parent | Lists the shift hour configurations in the request or response. Maximum items: 50 |
shift_hours[] | object | Each item | Each object represents one shift hour with its timing, break hours, holidays, and assigned users. Additional keys: not allowed |
shift_hours[].code | string | Required within parent | Represents the response code of the operation. Known values: SUCCESS |
shift_hours[].details | object | Required within parent | Represents additional details about the outcome of the operation. Additional keys: not allowed |
shift_hours[].details.id | string | Required within parent | Represents the unique identifier of the shift hour affected by the operation. Maximum length: 100 |
shift_hours[].message | string | Required within parent | Represents the message that describes the outcome of the operation. Maximum length: 100 |
shift_hours[].status | string | Required within parent | Represents the status of the operation. Known values: success |
Update shift hours — request body — body shift hours item break hours item custom timing item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Each object specifies the day of the week and the start and end time of the break on that day. Additional keys: not allowed |
break_timing | array | Optional | Represents the start and end time of the break on the specified day in `HH:MM` 24-hour format. A break must be longer than 15 minutes and shorter than 2 hours. Maximum items: 7 |
break_timing[] | string | Each item | Each string represents the start time or end time of the window in `HH:MM` 24-hour format. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
days | string | Optional | Represents the day of the week to which this custom break timing applies. **Possible values**: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday One of: Monday, Thursday, Friday, Sunday, Wednesday, Tuesday, Saturday |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.updateshifthours. Catalog operation: updateShiftHours. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.