JavaScript
import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const businessHour = await client.workers.businessHours.update('id');
console.log(businessHour.id);import os
from brainbase_labs import BrainbaseLabs
client = BrainbaseLabs(
api_key=os.environ.get("BRAINBASE_LABS_API_KEY"), # This is the default and can be omitted
)
business_hour = client.workers.business_hours.update(
id="id",
)
print(business_hour.id)curl --request PUT \
--url https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"hours": {},
"timezone": "<string>",
"primaryTag": "<string>",
"secondaryTag": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'hours' => [
],
'timezone' => '<string>',
'primaryTag' => '<string>',
'secondaryTag' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}"
payload := strings.NewReader("{\n \"hours\": {},\n \"timezone\": \"<string>\",\n \"primaryTag\": \"<string>\",\n \"secondaryTag\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"hours\": {},\n \"timezone\": \"<string>\",\n \"primaryTag\": \"<string>\",\n \"secondaryTag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hours\": {},\n \"timezone\": \"<string>\",\n \"primaryTag\": \"<string>\",\n \"secondaryTag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hours": {},
"timezone": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"primaryTag": "<string>",
"secondaryTag": "<string>"
}BusinessHours
Update business hours
PUT
/
api
/
workers
/
business-hours
/
{id}
JavaScript
import BrainbaseLabs from 'brainbase-labs';
const client = new BrainbaseLabs({
apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
});
const businessHour = await client.workers.businessHours.update('id');
console.log(businessHour.id);import os
from brainbase_labs import BrainbaseLabs
client = BrainbaseLabs(
api_key=os.environ.get("BRAINBASE_LABS_API_KEY"), # This is the default and can be omitted
)
business_hour = client.workers.business_hours.update(
id="id",
)
print(business_hour.id)curl --request PUT \
--url https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"hours": {},
"timezone": "<string>",
"primaryTag": "<string>",
"secondaryTag": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'hours' => [
],
'timezone' => '<string>',
'primaryTag' => '<string>',
'secondaryTag' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}"
payload := strings.NewReader("{\n \"hours\": {},\n \"timezone\": \"<string>\",\n \"primaryTag\": \"<string>\",\n \"secondaryTag\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"hours\": {},\n \"timezone\": \"<string>\",\n \"primaryTag\": \"<string>\",\n \"secondaryTag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/business-hours/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hours\": {},\n \"timezone\": \"<string>\",\n \"primaryTag\": \"<string>\",\n \"secondaryTag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hours": {},
"timezone": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"primaryTag": "<string>",
"secondaryTag": "<string>"
}Authorizations
API key authentication
Path Parameters
Body
application/json
JSON object containing business hours configuration
Show child attributes
Show child attributes
Timezone for the business hours (e.g., 'America/New_York', 'UTC', 'Europe/London')
Primary tag for categorization (e.g., business name, location)
Secondary tag for categorization (e.g., department, type)
⌘I
