Talent Pool Automation

Automatically add promising candidates to the talent pool — no more manual effort.

The Problem

Good candidates who were not selected for a position are lost if no talent pool is built. Manually reviewing all rejections is too time-consuming.

Solution: Automatic Addition by Rating

talent-pool-automation.jsJavaScript
const BASE = "https://api.aeroselect.io/api/v2/external";
const headers = { "X-API-Key": process.env.AEROSELECT_API_KEY };

// Automatically add all candidates who reached the interview
// stage but were rejected to the talent pool
async function autoFillTalentPool() {
  const res = await fetch(
    `${BASE}/applications?status=rejected&per_page=100`,
    { headers }
  );
  const { data: rejected } = await res.json();

  // Only add candidates who reached at least the interview stage
  const promising = rejected.filter((app) =>
    ["interview", "offered"].some((status) =>
      app.status_history?.some((h) => h.status === status)
    )
  );

  let added = 0;
  for (const application of promising) {
    // Duplicate-safe: POST returns 200 if already exists
    const res = await fetch(`${BASE}/talent-pool`, {
      method: "POST",
      headers: { ...headers, "Content-Type": "application/json" },
      body: JSON.stringify({
        candidate_id: application.candidate.id,
        rating: 4,
        tags: ["Promising Candidate", "Rejected — Timing", application.job.title],
        notes: `Rejected for: ${application.job.title}. Reached interview stage.`,
      }),
    });
    if (res.ok) added++;
  }

  console.log(`${added} candidates added to talent pool`);
}

Filter Talent Pool by Qualification

pool-filter.pyPython
import requests, os

BASE = "https://api.aeroselect.io/api/v2/external"
headers = {"X-API-Key": os.environ["AEROSELECT_API_KEY"]}

def find_pool_candidates_with_rating(min_rating: int, tag: str) -> list:
    """Filter talent pool by rating and tag."""
    response = requests.get(
        f"{BASE}/talent-pool",
        headers=headers,
        params={"per_page": 100}
    )
    pool = response.json()["data"]
    return [
        entry for entry in pool
        if (entry.get("rating") or 0) >= min_rating
        and tag in (entry.get("tags") or [])
    ]

// All A320-rated candidates with rating >= 4
a320_candidates = find_pool_candidates_with_rating(4, "A320 Rated")
print(f"{len(a320_candidates)} suitable A320 candidates in pool")

Notify When a Matching Position Opens

notify-pool.jsJavaScript
// When a new job is published, notify matching talent pool candidates
async function notifyMatchingPoolCandidates(jobId: number) {
  const [jobRes, poolRes] = await Promise.all([
    fetch(`${BASE}/jobs/${jobId}`, { headers }),
    fetch(`${BASE}/talent-pool?per_page=100`, { headers }),
  ]);

  const { data: job } = await jobRes.json();
  const { data: pool } = await poolRes.json();

  // Simple tag matching
  const jobTags = job.skills ?? [];
  const matching = pool.filter((entry) =>
    entry.tags?.some((tag) => jobTags.includes(tag))
  );

  console.log(
    `New position "${job.title}": ${matching.length} matching candidates in pool`
  );

  // Send email notification via your email service
  for (const entry of matching) {
    await emailService.send({
      to: entry.candidate.email,
      subject: `New matching position: ${job.title}`,
      body: `A new position matches your profile...`,
    });
  }
}