Set availability-constraints for a single resource in order to limit availability. A common use-case is to set an employees working hours, especially if these are different than a company's opening hours. Another common use-case is setting up vacation which are also employee-specific and not business-specific.
A resource's availability constraints are set by providing the availability_constraints
parameter when creating or updating a resource. The most common use-case is Opening Hours that specifies when a given resource is available (globally, no matter which project they are added to).
Here's how a request would look like:
curl --request PUT \
--url https://api.timekit.io/v2/resources/d187d6e0-d6cb-409a-ae60-45a8fd0ec879 \
--header 'Content-Type: application/json' \
--user :live_api_key_7nzvc7wsBQQISLeFSVhROys9V1bUJ1z7 \
--data '{
"availability_constraints": [
{ "allow_day_and_time": {"day": "Monday", "start": 9, "end": 12 }},
{ "allow_day_and_time": {"day": "Monday", "start": 14, "end": 17 }},
{ "allow_day_and_time": {"day": "Tuesday", "start": 9, "end": 17 }},
]
}'
This will make the resource available only on Mondays and Tuesdays. These constraints will be combined with any provided constraints passed to the POST /availability endpoint when calculating availability for the resource.
Please refer to our availability constraints section for more on the topic
Caution
Please be advised that we have a character limit of 64000 characters of JSON in requests; therefore, we advise that old constraints in the past that are no longer valid be removed when sending requests to the API.