Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyobjectRequired within parentRepresents 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_hoursarrayOptionalLists 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[]objectEach itemEach 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_hoursarrayOptionalLists 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[]objectEach itemEach 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_daysarrayOptionalLists the days of the week on which the break applies.
Maximum items: 7
body.shift_hours[].break_hours[].break_days[]stringEach itemRepresents 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_timingarrayOptionalLists 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[]objectEach itemRepresents the break timing override for a specific day of the week.
Additional keys: not allowed
body.shift_hours[].break_hours[].custom_timing[].break_timingarrayRequired within parentRepresents 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[]stringEach itemEach 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[].daysstringRequired within parentRepresents 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_timingarrayOptionalRepresents 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[]stringEach itemEach 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_everydaystringRequired within parentIndicates 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_timingarrayOptionalLists 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[]objectEach itemEach object represents the shift timing override for a specific day of the week.
Additional keys: not allowed
body.shift_hours[].custom_timing[].daysstringRequired within parentRepresents 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_timingarrayRequired within parentRepresents 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[]stringEach itemEach 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_timingarrayOptionalRepresents 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[]stringEach itemEach 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[].holidaysarrayOptionalLists 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[]objectEach itemEach 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[].datestringRequired within parentRepresents the date of the holiday in `YYYY-MM-DD` format.
Format: date
body.shift_hours[].holidays[].namestringRequired within parentRepresents the name of the holiday. The name must not contain the special characters.
Maximum length: 80
body.shift_hours[].namestringRequired within parentRepresents 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_everydaybooleanRequired within parentIndicates 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_daysarrayOptionalLists 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[]stringEach itemRepresents 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[].timezonestringRequired within parentRepresents 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[].usersarrayOptionalLists 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[]objectEach itemEach 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[].idstringRequired within parentRepresents the unique identifier of the user assigned to the shift hour.
Maximum length: 100

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Delete a shift hour — response body
$ (anyOf 2)ModelAlternativeExpand Delete a shift hour — response body

Referenced models: Delete a shift hour — response body

Delete a shift hour — response body
FieldTypePresenceDescription and constraints
$objectRootRepresents the response body that contains the shift hour configurations and the aggregate count of shifts with assigned users.
Additional keys: not allowed
shift_hoursarrayRequired within parentLists the shift hour configurations in the request or response.
Maximum items: 50
shift_hours[]objectEach itemEach object represents one shift hour with its timing, break hours, holidays, and assigned users.
Additional keys: not allowed
shift_hours[].codestringRequired within parentRepresents the response code of the operation.
Known values: SUCCESS
shift_hours[].detailsobjectRequired within parentRepresents additional details about the outcome of the operation.
Additional keys: not allowed
shift_hours[].details.idstringRequired within parentRepresents the unique identifier of the shift hour affected by the operation.
Maximum length: 100
shift_hours[].messagestringRequired within parentRepresents the message that describes the outcome of the operation.
Maximum length: 100
shift_hours[].statusstringRequired within parentRepresents the status of the operation.
Known values: success

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.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.