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 response = await client.workers.checkCallable({
phoneNumber: '+1 (954) 580-2181',
timestamp: 1730822400,
});
console.log(response.callable);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
)
response = client.workers.check_callable(
phone_number="+1 (954) 580-2181",
timestamp=1730822400,
)
print(response.callable)curl --request POST \
--url https://brainbase-monorepo-api.onrender.com/api/workers/check-callable \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumber": "+1 (954) 580-2181",
"timestamp": 1730822400
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/check-callable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '+1 (954) 580-2181',
'timestamp' => 1730822400
]),
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/check-callable"
payload := strings.NewReader("{\n \"phoneNumber\": \"+1 (954) 580-2181\",\n \"timestamp\": 1730822400\n}")
req, _ := http.NewRequest("POST", 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.post("https://brainbase-monorepo-api.onrender.com/api/workers/check-callable")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+1 (954) 580-2181\",\n \"timestamp\": 1730822400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/check-callable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"+1 (954) 580-2181\",\n \"timestamp\": 1730822400\n}"
response = http.request(request)
puts response.read_body{
"callable": true
}BusinessHours
Check if a phone number is callable at a given time
Checks if a phone number is callable at a specific timestamp by:
- Taking a UTC Unix timestamp
- Converting it to the business hours timezone (from BusinessHours table)
- Checking if the local time falls within the business hours for that day
POST
/
api
/
workers
/
check-callable
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 response = await client.workers.checkCallable({
phoneNumber: '+1 (954) 580-2181',
timestamp: 1730822400,
});
console.log(response.callable);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
)
response = client.workers.check_callable(
phone_number="+1 (954) 580-2181",
timestamp=1730822400,
)
print(response.callable)curl --request POST \
--url https://brainbase-monorepo-api.onrender.com/api/workers/check-callable \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumber": "+1 (954) 580-2181",
"timestamp": 1730822400
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://brainbase-monorepo-api.onrender.com/api/workers/check-callable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '+1 (954) 580-2181',
'timestamp' => 1730822400
]),
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/check-callable"
payload := strings.NewReader("{\n \"phoneNumber\": \"+1 (954) 580-2181\",\n \"timestamp\": 1730822400\n}")
req, _ := http.NewRequest("POST", 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.post("https://brainbase-monorepo-api.onrender.com/api/workers/check-callable")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"+1 (954) 580-2181\",\n \"timestamp\": 1730822400\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://brainbase-monorepo-api.onrender.com/api/workers/check-callable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"+1 (954) 580-2181\",\n \"timestamp\": 1730822400\n}"
response = http.request(request)
puts response.read_body{
"callable": true
}Authorizations
API key authentication
Body
application/json
Response
Callable status
Whether the phone number is callable at the given time
⌘I
