Batches
...
Batches API
Searches
Clear Searches
4min
clear searches all of the searches in a batch can be cleared by making an http delete request to the /batches/batch id/clear endpoint (where batch id is the id of the batch) batch status batches can only be cleared from a batch when it is not running to check whether a batch is currently running use the get batch https //docs trajectdata com/scaleserp/batches api/batches/get endpoint example delete delete /batches/batch id/clear in the example below we clear a batch with id=123456 $ curl x delete "https //api scaleserp com/batches/123456/clear?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios delete('https //api scaleserp com/batches/123456/clear', { params }) then(response => { console log('search deleted '); }) catch(error => { console log(error); });import requests api result = requests delete('https //api scaleserp com/batches/123456/clear?api key=demo') print ("search deleted ")\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api scaleserp com/batches/123456/clear', $querystring)); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); curl setopt($ch, curlopt customrequest, "delete"); $json = curl exec($ch); curl close($ch); echo "search deleted ", php eol; ?> scale serp responds with a json object confirming that the batch has been cleared { "request info" { "success" true, "message" "batch searches cleared" } } next steps update search https //docs trajectdata com/scaleserp/batches api/searches/update list search https //docs trajectdata com/scaleserp/batches api/searches/list