cURL
curl -X POST "https://api.alex.com/v2/jobs" \
-H "X-API-Key: $ALEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"external_id": "REQ-12345",
"description": "We are hiring a senior backend engineer to build distributed systems...",
"name": "Senior Backend Engineer",
"workflow_id": "wf_6c2e8a1f4b9d",
"rounds": [
{
"number": 1,
"additional_questions": [
"What is your expected start date?"
]
},
{
"number": 2,
"recruiter_user_ids": [
"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c"
]
}
]
}'import requests
url = "https://api.alex.com/v2/jobs"
payload = {
"external_id": "REQ-12345",
"description": "We are hiring a senior backend engineer to build distributed systems...",
"name": "Senior Backend Engineer",
"workflow_id": "wf_6c2e8a1f4b9d",
"rounds": [
{
"number": 1,
"additional_questions": ["What is your expected start date?"]
},
{
"number": 2,
"recruiter_user_ids": ["u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c"]
}
]
}
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({
external_id: 'REQ-12345',
description: 'We are hiring a senior backend engineer to build distributed systems...',
name: 'Senior Backend Engineer',
workflow_id: 'wf_6c2e8a1f4b9d',
rounds: [
{number: 1, additional_questions: ['What is your expected start date?']},
{number: 2, recruiter_user_ids: ['u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c']}
]
})
};
fetch('https://api.alex.com/v2/jobs', 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/jobs",
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([
'external_id' => 'REQ-12345',
'description' => 'We are hiring a senior backend engineer to build distributed systems...',
'name' => 'Senior Backend Engineer',
'workflow_id' => 'wf_6c2e8a1f4b9d',
'rounds' => [
[
'number' => 1,
'additional_questions' => [
'What is your expected start date?'
]
],
[
'number' => 2,
'recruiter_user_ids' => [
'u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c'
]
]
]
]),
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/jobs"
payload := strings.NewReader("{\n \"external_id\": \"REQ-12345\",\n \"description\": \"We are hiring a senior backend engineer to build distributed systems...\",\n \"name\": \"Senior Backend Engineer\",\n \"workflow_id\": \"wf_6c2e8a1f4b9d\",\n \"rounds\": [\n {\n \"number\": 1,\n \"additional_questions\": [\n \"What is your expected start date?\"\n ]\n },\n {\n \"number\": 2,\n \"recruiter_user_ids\": [\n \"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c\"\n ]\n }\n ]\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/jobs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"REQ-12345\",\n \"description\": \"We are hiring a senior backend engineer to build distributed systems...\",\n \"name\": \"Senior Backend Engineer\",\n \"workflow_id\": \"wf_6c2e8a1f4b9d\",\n \"rounds\": [\n {\n \"number\": 1,\n \"additional_questions\": [\n \"What is your expected start date?\"\n ]\n },\n {\n \"number\": 2,\n \"recruiter_user_ids\": [\n \"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alex.com/v2/jobs")
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 \"external_id\": \"REQ-12345\",\n \"description\": \"We are hiring a senior backend engineer to build distributed systems...\",\n \"name\": \"Senior Backend Engineer\",\n \"workflow_id\": \"wf_6c2e8a1f4b9d\",\n \"rounds\": [\n {\n \"number\": 1,\n \"additional_questions\": [\n \"What is your expected start date?\"\n ]\n },\n {\n \"number\": 2,\n \"recruiter_user_ids\": [\n \"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "job",
"id": "8b1f0c52-3e4a-4d8e-9a77-2f6c1d0b9e31",
"name": "Senior Backend Engineer",
"candidate_facing_name": "Senior Backend Engineer",
"description": "We are hiring a senior backend engineer to build distributed systems...",
"external_id": "REQ-12345",
"status": "active",
"workflow_id": "wf_6c2e8a1f4b9d",
"language": null,
"application_url": null,
"rounds": [],
"custom_fields": {},
"generation_status": "pending",
"failure_reason": null,
"updated_at": null
}Jobs
Create a job
Starts building a job from its description, on the workflow you name or your company’s default workflow. Generation runs after the response, so this returns 202 with generation_status: pending. Poll GET /jobs/{id} until generation_status is complete or failed. Emits job.created once the job exists.
POST
/
jobs
cURL
curl -X POST "https://api.alex.com/v2/jobs" \
-H "X-API-Key: $ALEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"external_id": "REQ-12345",
"description": "We are hiring a senior backend engineer to build distributed systems...",
"name": "Senior Backend Engineer",
"workflow_id": "wf_6c2e8a1f4b9d",
"rounds": [
{
"number": 1,
"additional_questions": [
"What is your expected start date?"
]
},
{
"number": 2,
"recruiter_user_ids": [
"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c"
]
}
]
}'import requests
url = "https://api.alex.com/v2/jobs"
payload = {
"external_id": "REQ-12345",
"description": "We are hiring a senior backend engineer to build distributed systems...",
"name": "Senior Backend Engineer",
"workflow_id": "wf_6c2e8a1f4b9d",
"rounds": [
{
"number": 1,
"additional_questions": ["What is your expected start date?"]
},
{
"number": 2,
"recruiter_user_ids": ["u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c"]
}
]
}
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({
external_id: 'REQ-12345',
description: 'We are hiring a senior backend engineer to build distributed systems...',
name: 'Senior Backend Engineer',
workflow_id: 'wf_6c2e8a1f4b9d',
rounds: [
{number: 1, additional_questions: ['What is your expected start date?']},
{number: 2, recruiter_user_ids: ['u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c']}
]
})
};
fetch('https://api.alex.com/v2/jobs', 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/jobs",
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([
'external_id' => 'REQ-12345',
'description' => 'We are hiring a senior backend engineer to build distributed systems...',
'name' => 'Senior Backend Engineer',
'workflow_id' => 'wf_6c2e8a1f4b9d',
'rounds' => [
[
'number' => 1,
'additional_questions' => [
'What is your expected start date?'
]
],
[
'number' => 2,
'recruiter_user_ids' => [
'u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c'
]
]
]
]),
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/jobs"
payload := strings.NewReader("{\n \"external_id\": \"REQ-12345\",\n \"description\": \"We are hiring a senior backend engineer to build distributed systems...\",\n \"name\": \"Senior Backend Engineer\",\n \"workflow_id\": \"wf_6c2e8a1f4b9d\",\n \"rounds\": [\n {\n \"number\": 1,\n \"additional_questions\": [\n \"What is your expected start date?\"\n ]\n },\n {\n \"number\": 2,\n \"recruiter_user_ids\": [\n \"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c\"\n ]\n }\n ]\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/jobs")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"REQ-12345\",\n \"description\": \"We are hiring a senior backend engineer to build distributed systems...\",\n \"name\": \"Senior Backend Engineer\",\n \"workflow_id\": \"wf_6c2e8a1f4b9d\",\n \"rounds\": [\n {\n \"number\": 1,\n \"additional_questions\": [\n \"What is your expected start date?\"\n ]\n },\n {\n \"number\": 2,\n \"recruiter_user_ids\": [\n \"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alex.com/v2/jobs")
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 \"external_id\": \"REQ-12345\",\n \"description\": \"We are hiring a senior backend engineer to build distributed systems...\",\n \"name\": \"Senior Backend Engineer\",\n \"workflow_id\": \"wf_6c2e8a1f4b9d\",\n \"rounds\": [\n {\n \"number\": 1,\n \"additional_questions\": [\n \"What is your expected start date?\"\n ]\n },\n {\n \"number\": 2,\n \"recruiter_user_ids\": [\n \"u7f3a9c1-2b4d-4e6f-8a0c-1e3b5d7f9a2c\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "job",
"id": "8b1f0c52-3e4a-4d8e-9a77-2f6c1d0b9e31",
"name": "Senior Backend Engineer",
"candidate_facing_name": "Senior Backend Engineer",
"description": "We are hiring a senior backend engineer to build distributed systems...",
"external_id": "REQ-12345",
"status": "active",
"workflow_id": "wf_6c2e8a1f4b9d",
"language": null,
"application_url": null,
"rounds": [],
"custom_fields": {},
"generation_status": "pending",
"failure_reason": null,
"updated_at": null
}Waiting for the job
The response is202 with generation_status: "pending". Poll the job until generation finishes:
curl "https://api.alex.com/v2/jobs/8b1f0c52-3e4a-4d8e-9a77-2f6c1d0b9e31" \
-H "X-API-Key: $ALEX_API_KEY"
complete: the job is ready. Invite candidates to it.failed: generation stopped.failure_reasonsays why. Fix the request and create the job again.
pending, GET /jobs doesn’t list it and PATCH /jobs/{id} returns 409 job_generating. DELETE /jobs/{id} cancels it.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
Accepted. The job is being generated.