Save the brand's business hours and out-of-hours auto-reply (replaces the previous ones). Requires brand.manage
const url = 'https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/business-hours';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"weekly":{"mon":[{"from":"example","to":"example"}],"tue":[{"from":"example","to":"example"}],"wed":[{"from":"example","to":"example"}],"thu":[{"from":"example","to":"example"}],"fri":[{"from":"example","to":"example"}],"sat":[{"from":"example","to":"example"}],"sun":[{"from":"example","to":"example"}]},"closedDates":[],"timezone":"America/Mexico_City","autoReply":{"enabled":true,"text":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/business-hours \ --header 'Content-Type: application/json' \ --data '{ "weekly": { "mon": [ { "from": "example", "to": "example" } ], "tue": [ { "from": "example", "to": "example" } ], "wed": [ { "from": "example", "to": "example" } ], "thu": [ { "from": "example", "to": "example" } ], "fri": [ { "from": "example", "to": "example" } ], "sat": [ { "from": "example", "to": "example" } ], "sun": [ { "from": "example", "to": "example" } ] }, "closedDates": [], "timezone": "America/Mexico_City", "autoReply": { "enabled": true, "text": "example" } }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
brd_01hx0000000000000000000000Request Bodyrequired
Section titled “Request Bodyrequired”object
Per weekday (mon..sun), 0, 1 or 2 slots HH:MM–HH:MM in the brand time zone. No slot in any day = no schedule (always open).
object
object
object
object
object
object
object
object
Closed days (holidays), YYYY-MM-DD.
IANA zone. Null = the brand time zone.
Example
America/Mexico_Cityobject
Free text (≤ 1000). Null = the default text in the brand language. {horario} is replaced by the schedule.
Responses
Section titled “Responses”Business hours
object
False when no day has a slot: the brand counts as always open and nothing is auto-replied.
object
object
object
Default text in the brand language, with the {horario} marker.
At most one auto-reply per conversation in this many hours (12).
Example generated
{ "brandId": "example", "configured": true, "weekly": { "additionalProperty": [ { "from": "example", "to": "example" } ] }, "closedDates": [ "example" ], "timezone": "example", "effectiveTimezone": "example", "autoReply": { "enabled": true, "text": "example", "defaultText": "example", "sendsOnlyEveryHours": 1 }, "updatedAt": "example"}Invalid data
object
object
Example
{ "error": { "code": "not_found" }}No session, expired session, or invalid, expired or revoked API key
object
object
Example
{ "error": { "code": "not_found" }}Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)
object
object
Example
{ "error": { "code": "not_found" }}Does not exist or is not visible to you
object
object
Example
{ "error": { "code": "not_found" }}Internal error
object
object
Example
{ "error": { "code": "not_found" }}