Skip to main content
POST
cURL

Matching an existing candidate

Alex looks for the candidate by external_id first, then by email, and returns 200 with the match:
  • A match deleted in your ATS returns 409 candidate_deleted and is left unchanged: it never takes the external_id you send. The message names its id, which you can read with GET /candidates/{id} or erase with DELETE /candidates/{id}.
  • A match by email with no external_id takes the one you send.
  • A match by email with a different external_id belongs to another record in your ATS. Alex returns 409 candidate_email_conflict rather 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

X-API-Key
string
header
required

Your company's API key, from Settings → Integrations in Alex. The earlier API's api-key header is accepted too; if you send both headers they must carry the same key.

Headers

Idempotency-Key
string

A unique value, 1 to 255 characters, that makes the request safe to retry. See Idempotency.

Required string length: 1 - 255

Body

application/json
email
string<email>
required

The candidate's email address.

Minimum string length: 1
first_name
string
required
Minimum string length: 1
last_name
string
required
Minimum string length: 1
phone
string | null

A phone number with 10 to 15 digits. null or a blank string counts as not sent.

external_id
string | null

Your identifier for the candidate, such as their ATS id. null or a blank string counts as not sent.

Response

An existing candidate matched.

object
string
required

Always "candidate".

Allowed value: "candidate"
id
string
required

The candidate's id. The same id the earlier API uses.

Example:

"5d2c7a90-1f4e-4b6a-8c3d-9e0f1a2b3c4d"

first_name
string | null
required
Example:

"Ada"

last_name
string | null
required
Example:

"Lovelace"

email
string | null
required

null when the candidate has no real email, only a placeholder.

phone
string | null
required
Example:

"+14155550123"

external_id
string | null
required

Your identifier for the candidate, such as their ATS id.

Example:

"CAND-881"

do_not_contact
boolean
required

true when the candidate opted out of contact, so Alex sends them nothing.

deleted_in_ats
boolean
required

true when the candidate's record was deleted in your ATS. Lists leave such candidates out unless you pass include_deleted=true; GET /candidates/{id} returns them.

custom_fields
object
required

Stored custom field values, by custom field key (see GET /custom-fields). A field with no stored value is left out. A field read live from your ATS (type: ats_field) is never stored, so it never appears here.

Example:
created_at
string<date-time> | null
required

When the candidate was created.

updated_at
string<date-time> | null
required

When the candidate last changed.