Skip to main content
GET
/
v1
/
leads
/
bulk-delete
/
{job_id}
Poll a bulk-delete job
curl --request GET \
  --url https://api.topcalls.ai/v1/leads/bulk-delete/{job_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.topcalls.ai/v1/leads/bulk-delete/{job_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.topcalls.ai/v1/leads/bulk-delete/{job_id}', 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.topcalls.ai/v1/leads/bulk-delete/{job_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.topcalls.ai/v1/leads/bulk-delete/{job_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.topcalls.ai/v1/leads/bulk-delete/{job_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.topcalls.ai/v1/leads/bulk-delete/{job_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "total_leads": 123,
  "deleted": 123,
  "skipped": 123,
  "chunks_done": 123,
  "chunks_total": 123,
  "error": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "started_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z"
}
{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}
{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}
{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}
{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}

Authorizations

Authorization
string
header
required

Use Authorization: Bearer tc_live_xxxxx

Path Parameters

job_id
string<uuid>
required

Bulk-delete job UUID, returned as job_id by the 202 response.

Response

Job status

Status of an async bulk-delete job (POST /v1/leads/bulk-delete 202 branch).

job_id
string<uuid>
required
status
enum<string>
required
Available options:
pending,
running,
completed,
completed_with_skipped,
failed,
canceled
total_leads
integer
required

Number of leads the job matched at intake time.

deleted
integer
required

Number of leads deleted so far.

skipped
integer
required

Number of leads skipped (e.g. already deleted, cross-account filtered).

chunks_done
integer
required

Number of 1000-row chunks the worker has drained.

chunks_total
integer
required

Total number of chunks the job was split into.

error
string | null
required

Error message if the job failed. Null otherwise.

created_at
string<date-time>
required
started_at
string<date-time> | null
required
completed_at
string<date-time> | null
required