curl --request POST \
--url https://api.cal.com/v2/discover/service-requests \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"service": "piano lessons",
"category": "lessons",
"subcategory": "music-and-voice",
"searchedArea": "within 10 miles of Seattle, WA"
}
'import requests
url = "https://api.cal.com/v2/discover/service-requests"
payload = {
"service": "piano lessons",
"category": "lessons",
"subcategory": "music-and-voice",
"searchedArea": "within 10 miles of Seattle, WA"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
service: 'piano lessons',
category: 'lessons',
subcategory: 'music-and-voice',
searchedArea: 'within 10 miles of Seattle, WA'
})
};
fetch('https://api.cal.com/v2/discover/service-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cal.com/v2/discover/service-requests",
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([
'service' => 'piano lessons',
'category' => 'lessons',
'subcategory' => 'music-and-voice',
'searchedArea' => 'within 10 miles of Seattle, WA'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://api.cal.com/v2/discover/service-requests"
payload := strings.NewReader("{\n \"service\": \"piano lessons\",\n \"category\": \"lessons\",\n \"subcategory\": \"music-and-voice\",\n \"searchedArea\": \"within 10 miles of Seattle, WA\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.cal.com/v2/discover/service-requests")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"service\": \"piano lessons\",\n \"category\": \"lessons\",\n \"subcategory\": \"music-and-voice\",\n \"searchedArea\": \"within 10 miles of Seattle, WA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/discover/service-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service\": \"piano lessons\",\n \"category\": \"lessons\",\n \"subcategory\": \"music-and-voice\",\n \"searchedArea\": \"within 10 miles of Seattle, WA\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"recorded": true,
"service": "piano lessons",
"notify": "account_email",
"matchedProviders": "nearby"
}
}Ask to be told when a Discover provider joins
Records that the authenticated user is looking for a service Discover has no listing for, so they are emailed at their account address when a matching provider joins. Asking again for the same need within 90 days returns the open request only in the same region: a repeat in another region, or with a searchedArea where there was none (or none where there was one), records a new request. matchedProviders in the response says which new providers can trigger the email: only online ones, or none, when the request is outside every launch region, so pass the searchedArea of the user’s search. The response never includes the request’s id, an email address or who else asked. Limited to 10 requests per hour per user, shared across all of the user’s API keys and access tokens. If accessed using an OAuth access token, the PROFILE_WRITE scope is required.
curl --request POST \
--url https://api.cal.com/v2/discover/service-requests \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"service": "piano lessons",
"category": "lessons",
"subcategory": "music-and-voice",
"searchedArea": "within 10 miles of Seattle, WA"
}
'import requests
url = "https://api.cal.com/v2/discover/service-requests"
payload = {
"service": "piano lessons",
"category": "lessons",
"subcategory": "music-and-voice",
"searchedArea": "within 10 miles of Seattle, WA"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
service: 'piano lessons',
category: 'lessons',
subcategory: 'music-and-voice',
searchedArea: 'within 10 miles of Seattle, WA'
})
};
fetch('https://api.cal.com/v2/discover/service-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cal.com/v2/discover/service-requests",
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([
'service' => 'piano lessons',
'category' => 'lessons',
'subcategory' => 'music-and-voice',
'searchedArea' => 'within 10 miles of Seattle, WA'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://api.cal.com/v2/discover/service-requests"
payload := strings.NewReader("{\n \"service\": \"piano lessons\",\n \"category\": \"lessons\",\n \"subcategory\": \"music-and-voice\",\n \"searchedArea\": \"within 10 miles of Seattle, WA\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.cal.com/v2/discover/service-requests")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"service\": \"piano lessons\",\n \"category\": \"lessons\",\n \"subcategory\": \"music-and-voice\",\n \"searchedArea\": \"within 10 miles of Seattle, WA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/discover/service-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service\": \"piano lessons\",\n \"category\": \"lessons\",\n \"subcategory\": \"music-and-voice\",\n \"searchedArea\": \"within 10 miles of Seattle, WA\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"recorded": true,
"service": "piano lessons",
"notify": "account_email",
"matchedProviders": "nearby"
}
}Headers
value must be Bearer <token> where <token> is api key prefixed with cal_, managed user access token, or OAuth access token
Body
The service in two or three words, as a provider would list it, such as dentist or piano lessons. Never the user's own words or personal details.
1 - 80"piano lessons"
The Discover category it belongs to.
medical, barbers, coaching, consulting, lessons, pets, sports, dance, social, online-services, saas, home-services, other "lessons"
The subcategory slug within that category, when one fits. A subcategory outside the category is ignored.
64^[a-z0-9-]+$"music-and-voice"
The searchedArea a search_listings (GET /v2/discover/listings/search) result returned when it found nothing, copied as given; it decides the region the request is matched in, and a repeat returns the open request only from the same region. Leave it out when there was none.
120"within 10 miles of Seattle, WA"
Was this page helpful?