Skip to content

Zoho: Get shift hours

Zoho shiftHours.getShifts: arguments, response, policy and SDK examples.

← Shift hours operations · Get started

Operation zoho.getshifts

Provider route: GET /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"]["getShifts"]>[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.getShifts(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.get_shifts(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed

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)objectAlternativeRepresents the error response body for the operation.
Additional keys: not allowed
$ (anyOf 1).shift_countobjectRequired within parentRepresents aggregate counts that summarize the shift hour configurations returned in the response.
Additional keys: not allowed
$ (anyOf 1).shift_count.total_shift_with_userJSONRequired within parent
$ (anyOf 1).shift_count.total_shift_with_user (anyOf 1)integerAlternativeRepresents the total number of shift hours that have at least one user assigned.
Format: int32
Minimum: 0
$ (anyOf 1).shift_count.total_shift_with_user (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (anyOf 1).shift_hoursarrayRequired within parentLists the shift hour configurations returned in the response.
Maximum items: 50
$ (anyOf 1).shift_hours[]objectEach itemEach object represents one shift hour with its timing, break hours, holidays, and assigned users.
Additional keys: not allowed
$ (anyOf 1).shift_hours[].break_hoursJSONRequired within parent
$ (anyOf 1).shift_hours[].break_hours (anyOf 1)arrayAlternativeLists the break windows scheduled within the shift hour. A shift can have at most two break windows.
Maximum items: 2
$ (anyOf 1).shift_hours[].break_hours (anyOf 1)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item break hours null item
$ (anyOf 1).shift_hours[].break_hours (anyOf 2)nullAlternativeLists the break windows scheduled within the shift hour. A shift can have at most two break windows.
Maximum items: 2
$ (anyOf 1).shift_hours[].break_hours (anyOf 2)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item break hours null item
$ (anyOf 1).shift_hours[].custom_timingJSONRequired within parent
$ (anyOf 1).shift_hours[].custom_timing (anyOf 1)arrayAlternativeLists per-day shift timing overrides.
Maximum items: 7
$ (anyOf 1).shift_hours[].custom_timing (anyOf 1)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item custom timing Lists per-day shift timing overrides item
$ (anyOf 1).shift_hours[].custom_timing (anyOf 2)nullAlternativeLists per-day shift timing overrides.
Maximum items: 7
$ (anyOf 1).shift_hours[].custom_timing (anyOf 2)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item custom timing Lists per-day shift timing overrides item
$ (anyOf 1).shift_hours[].daily_timingJSONRequired within parent
$ (anyOf 1).shift_hours[].daily_timing (anyOf 1)arrayAlternativeRepresents 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: 2
Minimum items: 2
$ (anyOf 1).shift_hours[].daily_timing (anyOf 1)[]stringEach 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]$
$ (anyOf 1).shift_hours[].daily_timing (anyOf 2)nullAlternativeRepresents 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: 2
Minimum items: 2
$ (anyOf 1).shift_hours[].daily_timing (anyOf 2)[]stringEach 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]$
$ (anyOf 1).shift_hours[].holidaysJSONRequired within parent
$ (anyOf 1).shift_hours[].holidays (anyOf 1)arrayAlternativeLists the holidays observed during the shift hour. The holiday date must fall between the current and the next financial year.
Maximum items: 365
$ (anyOf 1).shift_hours[].holidays (anyOf 1)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item holidays null item
$ (anyOf 1).shift_hours[].holidays (anyOf 2)nullAlternativeLists the holidays observed during the shift hour. The holiday date must fall between the current and the next financial year.
Maximum items: 365
$ (anyOf 1).shift_hours[].holidays (anyOf 2)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item holidays null item
$ (anyOf 1).shift_hours[].idstringRequired within parentRepresents the unique identifier of the shift hour.
Maximum length: 100
Pattern: ^[0-9]+$
$ (anyOf 1).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
$ (anyOf 1).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.
$ (anyOf 1).shift_hours[].shift_daysarrayRequired within parentLists the days of the week on which the shift hour
is active. You can set shift timing only on the days
your organization operates.


Possible values:

- Monday

- Tuesday

- Wednesday

- Thursday

- Friday

- Saturday

- Sunday

Maximum items: 7
$ (anyOf 1).shift_hours[].shift_days[]stringEach itemRepresents one day of the week on which the shift hour is active.

Known values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
$ (anyOf 1).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
$ (anyOf 1).shift_hours[].usersJSONRequired within parent
$ (anyOf 1).shift_hours[].users (anyOf 1)arrayAlternativeLists the users assigned to the shift hour.
Maximum items: 200
$ (anyOf 1).shift_hours[].users (anyOf 1)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item users Lists the users assigned to the shift hour item
$ (anyOf 1).shift_hours[].users (anyOf 2)nullAlternativeLists the users assigned to the shift hour.
Maximum items: 200
$ (anyOf 1).shift_hours[].users (anyOf 2)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item users Lists the users assigned to the shift hour item
$ (anyOf 1).shift_hours[].users_countJSONRequired within parent
$ (anyOf 1).shift_hours[].users_count (anyOf 1)integerAlternativeRepresents the number of users currently assigned to the shift hour.
Format: int32
Minimum: 0
$ (anyOf 1).shift_hours[].users_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (anyOf 2)nullAlternative

Referenced models: Get shift hours — response body — shift count, shift hours shift hours item break hours null item, Get shift hours — response body — shift count, shift hours shift hours item custom timing Lists per-day shift timing overrides item, Get shift hours — response body — shift count, shift hours shift hours item holidays null item, Get shift hours — response body — shift count, shift hours shift hours item users Lists the users assigned to the shift hour item

Get shift hours — response body — shift count, shift hours shift hours item break hours null item
FieldTypePresenceDescription and constraints
$objectRootEach object specifies the days the break applies to and the break timing for those days.
Additional keys: not allowed
break_daysarrayRequired within parentLists the days of the week on which the break
hour applies.


Possible values:

- Monday

- Tuesday

- Wednesday

- Thursday

- Friday

- Saturday

- Sunday

Maximum items: 7
break_days[]stringEach itemRepresents one day of the week on which the break hour applies.


Known values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
custom_timingJSONRequired within parent
custom_timing (anyOf 1)arrayAlternativeLists 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: 7
custom_timing (anyOf 1)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item break hours null item custom timing null item
custom_timing (anyOf 2)nullAlternativeLists 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: 7
custom_timing (anyOf 2)[]ModelEach itemExpand Get shift hours — response body — shift count, shift hours shift hours item break hours null item custom timing null item
daily_timingJSONRequired within parent
daily_timing (anyOf 1)arrayAlternativeRepresents 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: 2
Minimum items: 2
daily_timing (anyOf 1)[]stringEach itemEach string represents the start time or end time of the window in `HH:MM` 24-hour format.
`HH:MM` 24-hour format. "

Maximum length: 5
Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
daily_timing (anyOf 2)nullAlternativeRepresents 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: 2
Minimum items: 2
daily_timing (anyOf 2)[]stringEach itemEach string represents the start time or end time of the window in `HH:MM` 24-hour format.
`HH:MM` 24-hour format. "

Maximum length: 5
Pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$
idstringRequired within parentRepresents the unique identifier of the break hour within the shift hour.
Maximum length: 100
Pattern: ^[0-9]+$
same_as_everydaybooleanRequired within parentIndicates whether the break hour follows the
same timing on every day the break is
scheduled.


Possible values:

- `true` - the break hour uses the same timing
every day, and `daily_timing` becomes
mandatory.

- `false` - the break hour uses different
timing for different days, and `custom_timing`
becomes mandatory.

Referenced models: Get shift hours — response body — shift count, shift hours shift hours item break hours null item custom timing null item

Get shift hours — response body — shift count, shift hours shift hours item custom timing Lists per-day shift timing overrides item
FieldTypePresenceDescription and constraints
$objectRootEach object 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**.
Additional keys: not allowed
daysstringRequired within parentRepresents the day of the week to which this
custom shift timing applies.


**Possible values**:

- Monday

- Tuesday

- Wednesday

- Thursday

- Friday

- Saturday

- Sunday

Known values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
shift_timingarrayRequired within parentRepresents the start and end time of the shift on the specified
day in `HH:MM` 24-hour format.

Maximum items: 2
Minimum items: 2
shift_timing[]stringEach itemRepresents 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]$
Get shift hours — response body — shift count, shift hours shift hours item holidays null item
FieldTypePresenceDescription and constraints
$objectRootEach entry specifies the date and the name of the holiday.
Additional keys: not allowed
datestringRequired within parentRepresents the date of the holiday in `YYYY-MM-DD` format.
Format: date
idstringRequired within parentRepresents the unique identifier of the holiday.
Maximum length: 100
Pattern: ^[0-9]+$
namestringRequired within parentRepresents the name of the holiday. The name must not contain the special characters.
Maximum length: 80
userFmtstringRequired within parentRepresents the holiday date formatted using the date format configured for the requesting user.
Maximum length: 100
yearstringRequired within parentRepresents the year of the holiday.
Maximum length: 100
Get shift hours — response body — shift count, shift hours shift hours item users Lists the users assigned to the shift hour item
FieldTypePresenceDescription and constraints
$objectRootEach object specifies the user and the date from which the assignment becomes effective.
Additional keys: not allowed
effective_fromstringRequired within parentRepresents the date from which the user assignment to the shift hour becomes effective, in `YYYY-MM-DD` format. The date must be in the future and must not be more than six months ahead of the current date.
Format: date
emailstringRequired within parentRepresents the email address of the user assigned to the shift hour.
Format: email
idstringRequired within parentRepresents the unique identifier of the user assigned to the shift hour.
Maximum length: 100
Pattern: ^[0-9]+$
namestringRequired within parentRepresents the full name of the user assigned to the shift hour.
Maximum length: 100
roleobjectRequired within parentRepresents the role information of the user assigned to the shift hour.
Additional keys: not allowed
role.idstringRequired within parentRepresents the unique identifier of the role assigned to the user.
Maximum length: 100
Pattern: ^[0-9]+$
role.namestringRequired within parentRepresents the name of the role assigned to the user.
Maximum length: 100
zuidstringRequired within parentRepresents the unique identifier of the user assigned to the shift hour.
Maximum length: 100
Get shift hours — response body — shift count, shift hours shift hours item break hours null item custom timing null item
FieldTypePresenceDescription and constraints
$objectRootEach object specifies the day of the week and the start and end time of the break on that day.
Additional keys: not allowed
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: 2
Minimum items: 2
break_timing[]stringEach 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]$
daysstringRequired within parentRepresents the day of the week to which
this custom break timing applies.


**Possible values**:

- Monday

- Tuesday

- Wednesday

- Thursday

- Friday

- Saturday

- Sunday

Known values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

SDK function policy ID: zoho.getshifts. Catalog operation: getShifts. 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.

No-content response statuses: [204]

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.