Update a preset
curl --request PATCH \
--url https://api.spidra.io/api/presets/{presetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"query": "dentist",
"areas": [
"Lekki, Lagos",
"Ikeja, Lagos"
]
}
}
'import requests
url = "https://api.spidra.io/api/presets/{presetId}"
payload = { "inputs": {
"query": "dentist",
"areas": ["Lekki, Lagos", "Ikeja, Lagos"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {query: 'dentist', areas: ['Lekki, Lagos', 'Ikeja, Lagos']}})
};
fetch('https://api.spidra.io/api/presets/{presetId}', 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.spidra.io/api/presets/{presetId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'query' => 'dentist',
'areas' => [
'Lekki, Lagos',
'Ikeja, Lagos'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.spidra.io/api/presets/{presetId}"
payload := strings.NewReader("{\n \"inputs\": {\n \"query\": \"dentist\",\n \"areas\": [\n \"Lekki, Lagos\",\n \"Ikeja, Lagos\"\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.spidra.io/api/presets/{presetId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"query\": \"dentist\",\n \"areas\": [\n \"Lekki, Lagos\",\n \"Ikeja, Lagos\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/presets/{presetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {\n \"query\": \"dentist\",\n \"areas\": [\n \"Lekki, Lagos\",\n \"Ikeja, Lagos\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Preset updated successfully"
}Presets
Update a preset
Changes a preset’s name, description, inputs or saved request. Send only the fields that change. PUT works the same way.
nameanddescriptionwork on any preset.inputsandcolumnsare for template presets.inputsreplaces the saved inputs and is checked like a run.configis for tool presets. It replaces the saved request body.cookiesandwaitare dropped.
Sending inputs or columns to a tool preset, or config to a template preset, returns 400.
PATCH
/
presets
/
{presetId}
Update a preset
curl --request PATCH \
--url https://api.spidra.io/api/presets/{presetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {
"query": "dentist",
"areas": [
"Lekki, Lagos",
"Ikeja, Lagos"
]
}
}
'import requests
url = "https://api.spidra.io/api/presets/{presetId}"
payload = { "inputs": {
"query": "dentist",
"areas": ["Lekki, Lagos", "Ikeja, Lagos"]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: {query: 'dentist', areas: ['Lekki, Lagos', 'Ikeja, Lagos']}})
};
fetch('https://api.spidra.io/api/presets/{presetId}', 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.spidra.io/api/presets/{presetId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'query' => 'dentist',
'areas' => [
'Lekki, Lagos',
'Ikeja, Lagos'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.spidra.io/api/presets/{presetId}"
payload := strings.NewReader("{\n \"inputs\": {\n \"query\": \"dentist\",\n \"areas\": [\n \"Lekki, Lagos\",\n \"Ikeja, Lagos\"\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.spidra.io/api/presets/{presetId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": {\n \"query\": \"dentist\",\n \"areas\": [\n \"Lekki, Lagos\",\n \"Ikeja, Lagos\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spidra.io/api/presets/{presetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": {\n \"query\": \"dentist\",\n \"areas\": [\n \"Lekki, Lagos\",\n \"Ikeja, Lagos\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Preset updated successfully"
}Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The preset's id.
Body
application/json
A new name.
A new note.
Template presets only. The full set of inputs to save, replacing the old ones.
Template presets only. The columns the dashboard table shows, as { key, label, format } objects.
Tool presets only. The full request body to save, replacing the old one.
Was this page helpful?

