Zoho: Add shift hours
Zoho shiftHours.createShifts: arguments, response, policy and SDK examples.
← Shift hours operations · Get started
Operation zoho.createshifts
Provider route: POST /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"]["createShifts"]>[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.createShifts(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.create_shifts(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 creating one or more shift hour configurations. Each entry in `shift_hours` defines a 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. Each entry specifies a shift hour with its timing, break hours, holidays, and assigned users. Maximum items: 50 |
body.shift_hours[] | object | Each item | Each object represents one shift hour configuration to be created or updated. Each entry captures the shift name, time zone, active days, timing, optional 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. Each entry specifies the days the break applies to and the break timing for those days. A shift can have at most two break windows. Maximum items: 50 |
body.shift_hours[].break_hours[] | object | Each item | Each object represents one break window scheduled within the shift hour, including the days it applies to and the break timing. Additional keys: not allowed |
body.shift_hours[].break_hours[].break_days | array | Optional | Lists the days of the week on which the break applies. Maximum items: 7 |
body.shift_hours[].break_hours[].break_days[] | string | Each item | Represents one day of the week on which the break applies. Possible values: - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday One of: Monday, Thursday, Friday, Sunday, Wednesday, Tuesday, Saturday |
body.shift_hours[].break_hours[].custom_timing | array | Optional | Lists per-day break timing overrides. Each entry specifies the day of the week and the start and end time of the break on that day. This field is mandatory when the parent same_as_everyday is false. Maximum items: 50 |
body.shift_hours[].break_hours[].custom_timing[] | object | Each item | Represents the break timing override for a specific day of the week. Additional keys: not allowed |
body.shift_hours[].break_hours[].custom_timing[].break_timing | array | Required within parent | 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 |
body.shift_hours[].break_hours[].custom_timing[].break_timing[] | string | Each item | Each string represents the start time or end time of the window in `HH:MM` 24-hour format. The first array entry is the start time and the second is the end time. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
body.shift_hours[].break_hours[].custom_timing[].days | string | Required within parent | 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 |
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. > Note > 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 | Each string epresents the start time or end time of the window in `HH:MM` 24-hour format. The first array entry is the start time and the second is the end time. Maximum length: 5 Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$ |
body.shift_hours[].break_hours[].same_as_everyday | string | Required within parent | 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. Each entry specifies the day of the week and the start and end time of the shift on that day. This field is mandatory when same_as_everyday is false. Maximum items: 50 |
body.shift_hours[].custom_timing[] | object | Each item | Each object represents the shift timing override for a specific day of the week. Additional keys: not allowed |
body.shift_hours[].custom_timing[].days | string | Required within parent | 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 | Required within parent | Represents the start and end time of the shift on the specified day in `HH:MM` in the 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. The first array entry is the start time and the second is the end time. 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 | Each string represents the start time or end time of the window in `HH:MM` 24-hour format. The first array entry is the start time and the second is the end time. 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. Each entry specifies the date and the name of the holiday. 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 represents one holiday observed during the shift hour, including the date and name of the holiday. Additional keys: not allowed |
body.shift_hours[].holidays[].date | string | Required within parent | Represents the date of the holiday in `YYYY-MM-DD` format. Format: date |
body.shift_hours[].holidays[].name | string | Required within parent | Represents the name of the holiday. The name must not contain the special characters. Maximum length: 80 |
body.shift_hours[].name | string | Required within parent | 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 | Required within parent | 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 | 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 | Required within parent | Represents the time zone in which the shift hours are scheduled. Use a valid IANA time zone identifier such as `Asia/Kolkata` or `America/New_York`. Maximum length: 100 |
body.shift_hours[].users | array | Optional | Lists the users assigned to the shift hour. Each entry specifies the user and the date from which the assignment becomes effective. Maximum items: 200 |
body.shift_hours[].users[] | object | Each item | Each object represents one user assigned to the shift hour, including the user details and the effective date of the assignment. Additional keys: not allowed |
body.shift_hours[].users[].id | string | Required within parent | Represents the unique identifier of the user assigned to the shift hour. Maximum length: 100 |
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 |
$ (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 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.createshifts. Catalog operation: createShifts. 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.