cURL
curl -X POST "https://api.alex.com/v2/candidates" \
-H "X-API-Key: $ALEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"first_name": "Ada",
"last_name": "Lovelace",
"external_id": "CAND-881"
}'import requests
url = "https://api.alex.com/v2/candidates"
payload = {
"email": "[email protected]",
"first_name": "Ada",
"last_name": "Lovelace",
"external_id": "CAND-881"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
first_name: 'Ada',
last_name: 'Lovelace',
external_id: 'CAND-881'
})
};
fetch('https://api.alex.com/v2/candidates', 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",
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([
'email' => '[email protected]',
'first_name' => 'Ada',
'last_name' => 'Lovelace',
'external_id' => 'CAND-881'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alex.com/v2/candidates"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"first_name\": \"Ada\",\n \"last_name\": \"Lovelace\",\n \"external_id\": \"CAND-881\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.alex.com/v2/candidates")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"first_name\": \"Ada\",\n \"last_name\": \"Lovelace\",\n \"external_id\": \"CAND-881\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alex.com/v2/candidates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"first_name\": \"Ada\",\n \"last_name\": \"Lovelace\",\n \"external_id\": \"CAND-881\"\n}"
response = http.request(request)
puts response.read_body{
"object": "candidate",
"id": "5d2c7a90-1f4e-4b6a-8c3d-9e0f1a2b3c4d",
"first_name": "Ada",
"last_name": "Lovelace",
"email": "[email protected]",
"phone": "+14155550123",
"external_id": "CAND-881",
"do_not_contact": false,
"deleted_in_ats": false,
"custom_fields": {},
"created_at": "2026-11-28T09:30:00.000Z",
"updated_at": "2026-11-30T14:05:12.000Z"
}Candidates
Create a candidate
Finds or creates a candidate. Returns 201 with a new candidate, or 200 with the one that already has this external_id or email. A candidate matched by email that has no external_id takes the one you send. A candidate matched by email that has a different external_id is another record in your ATS, so the request returns 409 candidate_email_conflict rather than that candidate. A match deleted in your ATS returns 409 candidate_deleted and is left unchanged.
POST
/
candidates
cURL
curl -X POST "https://api.alex.com/v2/candidates" \
-H "X-API-Key: $ALEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"first_name": "Ada",
"last_name": "Lovelace",
"external_id": "CAND-881"
}'import requests
url = "https://api.alex.com/v2/candidates"
payload = {
"email": "[email protected]",
"first_name": "Ada",
"last_name": "Lovelace",
"external_id": "CAND-881"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
first_name: 'Ada',
last_name: 'Lovelace',
external_id: 'CAND-881'
})
};
fetch('https://api.alex.com/v2/candidates', 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",
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([
'email' => '[email protected]',
'first_name' => 'Ada',
'last_name' => 'Lovelace',
'external_id' => 'CAND-881'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.alex.com/v2/candidates"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"first_name\": \"Ada\",\n \"last_name\": \"Lovelace\",\n \"external_id\": \"CAND-881\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.alex.com/v2/candidates")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"first_name\": \"Ada\",\n \"last_name\": \"Lovelace\",\n \"external_id\": \"CAND-881\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alex.com/v2/candidates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"first_name\": \"Ada\",\n \"last_name\": \"Lovelace\",\n \"external_id\": \"CAND-881\"\n}"
response = http.request(request)
puts response.read_body{
"object": "candidate",
"id": "5d2c7a90-1f4e-4b6a-8c3d-9e0f1a2b3c4d",
"first_name": "Ada",
"last_name": "Lovelace",
"email": "[email protected]",
"phone": "+14155550123",
"external_id": "CAND-881",
"do_not_contact": false,
"deleted_in_ats": false,
"custom_fields": {},
"created_at": "2026-11-28T09:30:00.000Z",
"updated_at": "2026-11-30T14:05:12.000Z"
}Matching an existing candidate
Alex looks for the candidate byexternal_id first, then by email, and returns 200 with the match:
- A match deleted in your ATS returns
409candidate_deletedand is left unchanged: it never takes theexternal_idyou send. The message names its id, which you can read withGET /candidates/{id}or erase withDELETE /candidates/{id}. - A match by email with no
external_idtakes the one you send. - A match by email with a different
external_idbelongs to another record in your ATS. Alex returns409candidate_email_conflictrather than that candidate, so you never act on the wrong person. The message names the existing candidate’s id.
phone and external_id sent as null or a blank string count as not sent.Authorizations
apiKeyAuthbearerAuth
Headers
A unique value, 1 to 255 characters, that makes the request safe to retry. See Idempotency.
Required string length:
1 - 255Body
application/json
Response
An existing candidate matched.
null when the candidate has no real email, only a placeholder.
Example: