cURL
curl -X DELETE "https://api.alex.com/v2/candidates/5d2c7a90-1f4e-4b6a-8c3d-9e0f1a2b3c4d" \
-H "X-API-Key: $ALEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"import requests
url = "https://api.alex.com/v2/candidates/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.alex.com/v2/candidates/{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.alex.com/v2/candidates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.alex.com/v2/candidates/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.alex.com/v2/candidates/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alex.com/v2/candidates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "candidate",
"id": "5d2c7a90-1f4e-4b6a-8c3d-9e0f1a2b3c4d",
"deleted": true,
"cleanup_succeeded": true
}Candidates
Delete a candidate
Deletes a candidate and all their data, including a candidate deleted in your ATS. Use it to erase a candidate, for example for a GDPR request: find every candidate with the person’s email or ATS id with GET /candidates?include_deleted=true, then delete each. An id with nothing to delete, including a candidate already erased, returns 404: to retry a delete safely, send an Idempotency-Key.
DELETE
/
candidates
/
{id}
cURL
curl -X DELETE "https://api.alex.com/v2/candidates/5d2c7a90-1f4e-4b6a-8c3d-9e0f1a2b3c4d" \
-H "X-API-Key: $ALEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"import requests
url = "https://api.alex.com/v2/candidates/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.alex.com/v2/candidates/{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.alex.com/v2/candidates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.alex.com/v2/candidates/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.alex.com/v2/candidates/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alex.com/v2/candidates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "candidate",
"id": "5d2c7a90-1f4e-4b6a-8c3d-9e0f1a2b3c4d",
"deleted": true,
"cleanup_succeeded": true
}Erasing a person
Deleting a candidate removes their records, interviews, recordings and résumés. It works on a candidate deleted in your ATS too. A person can have more than one candidate, for example one per ATS record. To erase everyone with an email address or ATS id:- List them, including those deleted in your ATS:
GET /[email protected]&include_deleted=true, or?external_id=CAND-881&include_deleted=true. Follownext_cursorifhas_moreistrue. - Delete each by
id.
cleanup_succeeded is false when the records were deleted but removing the candidate’s files could not be started. Contact support with the request_id: deleting again returns 404.Authorizations
apiKeyAuthbearerAuth
Headers
A unique value, 1 to 255 characters, that makes the request safe to retry. See Idempotency.
Required string length:
1 - 255Response
Deleted.