---
title: "Update business hours"
method: POST
path: "/locations/{locationId}/businesshours"
tags: ["AfterHours"]
---

# Update business hours

`POST /locations/{locationId}/businesshours`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/locations/{locationId}/businesshours`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/locations/:locationId/businesshours/post.ts> (a function with typed inputs; its response is checked against the schema)

Modifies the existing business hours for the specified location.
            <br />Send this request [GET /locations/{locationId}/businesshours](/swagger/ui/index?version=3#/AfterHours/GETv3_locations__locationId__businesshours) to get the location business hours.
            <br />Learn [how to manage business hours](https://servicechannel.atlassian.net/wiki/spaces/SCU/pages/683409418/Managing+Business+Hours+and+Holidays+for+a+Location) in ServiceChannel University.
            <br />**Example Request**
            
                POST / locations/{locationId}/businesshours
                {
                  "businessHours": [
                    {
                      "DayOfWeek": "Monday",
                      "OpenTime": "10:15 AM",
                      "CloseTime": "06:00 PM",
                      "ClosedAllDay": false
                    }
                }

## Path parameters

- `locationId` integer, required

## Request body

- ServiceChannelServicesMessagingAfterHoursUpdateLocationBusinessHoursApiModelRequest: Request object to update business hours for a location.
  - `businessHours` ServiceChannelServicesMessagingAfterHoursLocationBusinessHoursApiModel[]: Business hours details to add to the location.
    - `DayOfWeek` 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday': Day of the week.
    - `OpenTime` string: Location opening hours.
    - `CloseTime` string: Location closing hours.
    - `ClosedAllDay` boolean: Defines whether the location is closed on the specified day.

## Response `200`

Business hours are updated for the specified location.

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: <br/> 613 — Incorrect format of the Open Time or Close Time. Valid format: HH:mm or hh:mm tt (for example, 23:59 or 11:59 PM). <br/> 614 — Business Hours should not overlap between days of the week <br/> 615 — Incorrect format of the day of the week. Valid values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. <br/> 616 — Duplicate 'Day of the Week' value; <br/> 617 — Business Hours are not set for the location. For the initial setup, configure Business Hours for each day of the week. <br/> 618 — Open Time or Close Time cannot be empty for a specific day of the week <br/> 628 — Incorrect format of the `Close All Day` value. Valid values: true, false.
- `401`: The request is not authorized. <br/>Error codes: <br/> 504 — API call rejected by security permissions
- `404`: The requested resource does not exist on the server. <br/>Error codes: <br/> 601 — Location is not found
- `500`: The server was unable to complete the request due to an internal error.

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
