Update a Holiday
Purpose
To update the holidays set for your org.
Endpoint
- PUT /settings/holidays
- PUT /settings/holidays/{holiday_ID}
Request Details
Request URLs
{api-domain}/crm/{version}/settings/holidays
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
X-CRM-ORG:{your_org_id}
Scope
scope=ZohoCRM.settings.business_hours.ALL
(or)
scope=ZohoCRM.settings.business_hours.UPDATE
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/holidays"
-X PUT
-d "@update.json"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-H "X-CRM-ORG:{your_org_id}"Input JSON
- idstring, mandatoryThe unique ID of the holiday that you want to update. Use the Get Holidays API to retrieve the holiday ID. 
- namestring, mandatoryThe name of the holiday. Note that the special characters ~ , ` , # , % , & , + , = , [ , ] , { , } , | , ; , < , > , ^ are not allowed. 
- datestring, mandatoryThe date in the YYYY-MM-DD format that the holiday falls on. 
Note
A maximum of 100 holidays can be updated per API call.
Input JSON
Copied{
    "holidays": [
        {
            "id": "3652397000011199002",
            "name": "Founder's Day",
            "date": "2023-08-24"
        }
    ]
}Possible Errors
- INVALID_DATAHTTP 400Reasons: - The holiday name contains one or more of these special characters: ~ , ` , # , % , & , + , = , [ , ] , { , } , | , ; , < , > , ^.
- The date, shift's ID, holiday type, or name is invalid.
 Resolution: 
 Refer to the "details" key in the response for the API name of the field that has the error in the input.
- MANDATORY_NOT_FOUNDHTTP 400One or more of these data is invalid - name, date, type. Resolution: 
 Refer to the "details" key in the response for the API name of the field that has the error in the input.
- DEPENDENT_FIELD_MISSINGHTTP 400You have not specified one or more of the dependent fields. 
 Resolution: When you add holidays to a shift hour, the "type" key is mandatory.
- API_NOT_SUPPORTEDHTTP 400You are trying the API from API version 2 or below. 
 Resolution: This API is supported only from API version 2.1 and up.
- LIMIT_EXCEEDEDHTTP 400You are trying to create more than 52 holidays per year. 
 Resolution: A year cannot have more than 52 holidays.
- OAUTH_SCOPE_MISMATCHHTTP 401You do not have the right scope to access this API. 
 Resolution: Create new token with ZohoCRM.settings.business_hours.ALL or ZohoCRM.settings.business_hours.UPDATE scopes.
- INACTIVE_USERHTTP 403You are an inactive user in the org. 
 Resolution: Inactive users cannot access this API. Contact the administrator.
- NO_PERMISSIONHTTP 403You are not an admin. 
 Resolution: Only admin users can set the holidays for the org.
- INVALID_URL_PATTERNHTTP 404Please check if the URL trying to access is a correct one 
 Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to the request URL section above.
Sample Response
Copied{
    "holidays": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "3652397000011199002"
            },
            "message": "Holidays updated successfully",
            "status": "success"
        }
    ]
}